View Source

[modwtcl]
apreq.h
dist/
libapreq1/
mod_wtcl.c
mod_wtcl.h
setupExclude.txt
util/
win.def
win.mak
wt1.1/
WtAppTable.c
WtAppTable.h
WtBasicCmds.c
WtBasicCmds.h
WtClientRequest.c
WtClientRequest.h
WtCollection.c
WtCollection.h
WtCollectionCmds.c
WtCollectionCmds.h
WtContext.c
WtContext.h
WtContextEvents.c
WtContextEvents.h
WtCookie.c
WtCookie.h
WtDbSession.c
WtDbSession.h
WtExecute.c
WtExecute.h
WtHtmlEntities.c
WtHtmlEntities.h
WtInitCmds.c
WtInitCmds.h
WtMtTable.c
WtMtTable.h
WtMultiTable.c
WtMultiTable.h
WtOS.h
WtProcSession.c
WtProcSession.h
WtResponse.c
WtResponse.h
WtServerCmds.c
WtServerCmds.h
WtSession.c
WtSession.h
WtSettings.c
WtSettings.h
WtTable.c
WtTable.h
WtTableCmds.c
WtTableCmds.h
WtTableUtil.c
WtTableUtil.h
WtUpload.c
WtUpload.h
WtUtil.c
WtUtil.h
WtWebErrors.c
WtWebErrors.h
WtWindows.h
File: / archive / modwtcl / WtTable.h

Lines Size Modified Created Owner MIME Types
159 6,468 2010/05/08 18:46:41 2011/06/13 15:35:15 BUILTIN\Administrators text/x-chdr

0001
/*
0002
 * Copyright 2001 Alexander Boverman and the original authors.
0003
 * 
0004
 * Licensed under the Apache License, Version 2.0 (the "License");
0005
 * you may not use this file except in compliance with the License.
0006
 * You may obtain a copy of the License at
0007
 * 
0008
 *      http://www.apache.org/licenses/LICENSE-2.0
0009
 * 
0010
 * Unless required by applicable law or agreed to in writing, software
0011
 * distributed under the License is distributed on an "AS IS" BASIS,
0012
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013
 * See the License for the specific language governing permissions and
0014
 * limitations under the License.
0015
 */
0016
0017
#ifndef _WT_TABLE_H
0018
#define _WT_TABLE_H
0019
0020
#include <tcl.h>
0021
0022
/* Table data */
0023
0024
typedef struct WtTableT {
0025
  Tcl_HashTable items;
0026
} WtTable;
0027
0028
/* Generic table functions */
0029
0030
int WtTableSize(Tcl_Obj *tbl);
0031
int WtTableHas(Tcl_Obj *tbl, Tcl_Obj *key);
0032
Tcl_Obj *WtTableGet(Tcl_Obj *tbl, Tcl_Obj *key);
0033
Tcl_Obj *WtTableGetDefault(Tcl_Obj *tbl, Tcl_Obj *key,
0034
  Tcl_Obj *fallback);
0035
int WtTableGetFirst(Tcl_Obj *tbl, Tcl_Obj *key, Tcl_Obj **val,
0036
  Tcl_Interp *interp);
0037
int WtTableGetFirstDefault(Tcl_Obj *tbl, Tcl_Obj *key,
0038
  Tcl_Obj **val, Tcl_Obj *fallback, Tcl_Interp *interp);
0039
int WtTableGetList(Tcl_Obj *tbl, Tcl_Obj *key, Tcl_Obj **list,
0040
  Tcl_Interp *interp);
0041
int WtTableGetListDefault(Tcl_Obj *tbl, Tcl_Obj *key,
0042
  Tcl_Obj **list, Tcl_Obj *fallback, Tcl_Interp *interp);
0043
void WtTableSet(Tcl_Obj *tbl, Tcl_Obj *key, Tcl_Obj *val);
0044
void WtTableSetInternal(WtTable *tbl, Tcl_Obj *key, Tcl_Obj *val);
0045
void WtTableSetDefault(Tcl_Obj *tbl, Tcl_Obj *key, Tcl_Obj *val,
0046
  Tcl_Obj **result);
0047
void WtTableSetOneValueList(Tcl_Obj *tbl, Tcl_Obj *key,
0048
  Tcl_Obj *val, Tcl_Obj **result);
0049
void WtTableSetOneValueListDefault(Tcl_Obj *tbl, Tcl_Obj *key,
0050
  Tcl_Obj *val, Tcl_Obj **result);
0051
int WtTableAppendToList(Tcl_Obj *tbl, Tcl_Obj *key,
0052
  Tcl_Obj *val, Tcl_Obj **list, Tcl_Interp *interp);
0053
int WtTableAppendListToList(Tcl_Obj *tbl, Tcl_Obj *key,
0054
  Tcl_Obj *valList, Tcl_Obj **list, Tcl_Interp *interp);
0055
int WtTableAppendToListInternal(Tcl_Obj *tbl, Tcl_Obj *key,
0056
  Tcl_Obj *val, int multipleVals, Tcl_Obj **list,
0057
  Tcl_Interp *interp);
0058
int WtTableKeys(Tcl_Obj *tbl, Tcl_Obj **keys, Tcl_Interp *interp);
0059
int WtTableValues(Tcl_Obj *tbl, Tcl_Obj **vals, Tcl_Interp *interp);
0060
int WtTableFirstValues(Tcl_Obj *tbl, Tcl_Obj **vals,
0061
  Tcl_Interp *interp);
0062
void WtTableRemove(Tcl_Obj *tbl, Tcl_Obj *key);
0063
int WtTableRemoveList(Tcl_Obj *tbl, Tcl_Obj *list,
0064
  Tcl_Interp *interp);
0065
int WtUpdateTable(Tcl_Obj *dest, Tcl_Obj *src);
0066
void WtClearTable(Tcl_Obj *tbl);
0067
int WtConvertToTableObj(Tcl_Obj *obj, Tcl_ObjType *type, Tcl_Interp *interp);
0068
void WtInitTableItems(WtTable *tbl, Tcl_ObjType *type);
0069
void WtDeleteTableItems(WtTable *tbl);
0070
WtTable *WtTableRep(Tcl_Obj *tblObj);
0071
Tcl_HashTable *WtGetTableMap(Tcl_Obj *tblObj);
0072
int WtIsTableType(Tcl_ObjType *type);
0073
0074
/* Standard table object */
0075
0076
Tcl_Obj *WtNewTableObj();
0077
void WtFreeTable(Tcl_Obj *tbl);
0078
void WtDupTable(Tcl_Obj *src, Tcl_Obj *dest);
0079
void WtUpdateTableString(Tcl_Obj *tbl);
0080
int WtSetTableFromAny(Tcl_Interp *interp, Tcl_Obj *obj);
0081
int WtConvertToTable(Tcl_Obj *obj, Tcl_Interp *interp);
0082
0083
/* Case-insensitive table object */
0084
0085
Tcl_Obj *WtNewCaselessTableObj();
0086
void WtFreeCaselessTable(Tcl_Obj *tbl);
0087
void WtDupCaselessTable(Tcl_Obj *src, Tcl_Obj *dest);
0088
void WtUpdateCaselessTableString(Tcl_Obj *tbl);
0089
int WtSetCaselessTableFromAny(Tcl_Interp *interp, Tcl_Obj *obj);
0090
int WtConvertToCaselessTable(Tcl_Obj *obj, Tcl_Interp *interp);
0091
unsigned int HashCaselessKey(Tcl_HashTable *hashTable, void *keyPtr);
0092
int CompareCaselessKeys(void *keyPtr, Tcl_HashEntry *entry);
0093
Tcl_HashEntry *AllocCaselessEntry(Tcl_HashTable *hashTable, void *keyPtr);
0094
void FreeCaselessEntry(Tcl_HashEntry *ent);
0095
0096
/* Type-guarded table functions */
0097
0098
Tcl_Obj *WtNewTableObjWithType(Tcl_ObjType *type);
0099
Tcl_Obj *WtNewTableObjWithElements(Tcl_ObjType *type,
0100
  int objc, const Tcl_Obj *objv[], Tcl_Interp *interp);
0101
int WtTableObjSize(Tcl_Obj *tbl, int *size, Tcl_ObjType *type,
0102
  Tcl_Interp *interp);
0103
int WtTableObjHas(Tcl_Obj *tbl, Tcl_Obj *key, int *has,
0104
  Tcl_ObjType *type, Tcl_Interp *interp);
0105
int WtTableObjGet(Tcl_Obj *tbl, Tcl_Obj *key, Tcl_Obj **val,
0106
  Tcl_ObjType *type, Tcl_Interp *interp);
0107
int WtTableObjGetDefault(Tcl_Obj *tbl, Tcl_Obj *key, Tcl_Obj **val,
0108
  Tcl_Obj *fallback, Tcl_ObjType *type, Tcl_Interp *interp);
0109
int WtTableObjGetFirst(Tcl_Obj *tbl, Tcl_Obj *key, Tcl_Obj **val,
0110
  Tcl_ObjType *type, Tcl_Interp *interp);
0111
int WtTableObjGetFirstDefault(Tcl_Obj *tbl, Tcl_Obj *key,
0112
  Tcl_Obj **val, Tcl_Obj *fallback, Tcl_ObjType *type,
0113
  Tcl_Interp *interp);
0114
int WtTableObjGetList(Tcl_Obj *tbl, Tcl_Obj *key, Tcl_Obj **list,
0115
  Tcl_ObjType *type, Tcl_Interp *interp);
0116
int WtTableObjGetListDefault(Tcl_Obj *tbl, Tcl_Obj *key,
0117
  Tcl_Obj **list, Tcl_Obj *fallback, Tcl_ObjType *type,
0118
  Tcl_Interp *interp);
0119
int WtTableObjSetDefault(Tcl_Obj *tbl, Tcl_Obj *key, Tcl_Obj *val,
0120
  Tcl_Obj **result, Tcl_ObjType *type, Tcl_Interp *interp);
0121
int WtTableObjSetOneValueList(Tcl_Obj *tbl, Tcl_Obj *key,
0122
  Tcl_Obj *val, Tcl_Obj **result, Tcl_ObjType *type,
0123
  Tcl_Interp *interp);
0124
int WtTableObjSetOneValueListDefault(Tcl_Obj *tbl, Tcl_Obj *key,
0125
  Tcl_Obj *val, Tcl_Obj **result, Tcl_ObjType *type,
0126
  Tcl_Interp *interp);
0127
int WtTableObjAppendToList(Tcl_Obj *tbl, Tcl_Obj *key,
0128
  Tcl_Obj *val, Tcl_Obj **list, Tcl_ObjType *type,
0129
  Tcl_Interp *interp);
0130
int WtTableObjAppendListToList(Tcl_Obj *tbl, Tcl_Obj *key,
0131
  Tcl_Obj *valList, Tcl_Obj **list, Tcl_ObjType *type,
0132
  Tcl_Interp *interp);
0133
int WtTableObjKeys(Tcl_Obj *tbl, Tcl_Obj **keys, Tcl_ObjType *type,
0134
  Tcl_Interp *interp);
0135
int WtTableObjValues(Tcl_Obj *tbl, Tcl_Obj **vals,
0136
  Tcl_ObjType *type, Tcl_Interp *interp);
0137
int WtTableObjFirstValues(Tcl_Obj *tbl, Tcl_Obj **vals,
0138
  Tcl_ObjType *type, Tcl_Interp *interp);
0139
int WtTableObjRemove(Tcl_Obj *tbl, Tcl_Obj *key,
0140
  Tcl_ObjType *type, Tcl_Interp *interp);
0141
int WtTableObjRemoveList(Tcl_Obj *tbl, Tcl_Obj *list,
0142
  Tcl_ObjType *type, Tcl_Interp *interp);
0143
int WtClearTableObj(Tcl_Obj *tbl, Tcl_ObjType *type, Tcl_Interp *interp);
0144
0145
/* Common type handlers */
0146
0147
void WtFreeTableObj(Tcl_Obj *tbl);
0148
void WtDupTableObj(Tcl_Obj *src, Tcl_Obj *dest);
0149
void WtUpdateTableObjString(Tcl_Obj *tbl);
0150
int WtSetTableObjFromAny(Tcl_Interp *interp, Tcl_Obj *obj,
0151
  Tcl_ObjType *type);
0152
0153
/* Globals */
0154
0155
extern struct Tcl_ObjType WtTableType;
0156
extern struct Tcl_ObjType WtCaselessTableType;
0157
extern Tcl_HashKeyType WtCaselessHashKeyType;
0158
0159
#endif /* ! _WT_TABLE_H */