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_APP_TABLE_H |
0018 |
#define _WT_APP_TABLE_H |
0019 |
|
0020 |
#include <tcl.h> |
0021 |
#include "WtTableCmds.h" |
0022 |
|
0023 |
typedef struct WtAppTableSet |
0024 |
{ |
0025 |
Tcl_HashTable tables; |
0026 |
Tcl_Mutex lock; |
0027 |
unsigned long seqId; |
0028 |
} WtAppTableSet; |
0029 |
|
0030 |
typedef struct WtAppTableT |
0031 |
{ |
0032 |
Tcl_Obj *sharedTable; |
0033 |
time_t accessTime; |
0034 |
} WtAppTable; |
0035 |
|
0036 |
void WtInitAppTableSet(WtAppTableSet *set); |
0037 |
Tcl_Obj *WtOpenAppTable(WtAppTableSet *set, Tcl_Obj *id, |
0038 |
Tcl_Interp *interp, int *created); |
0039 |
int WtCloseAppTable(Tcl_Obj *tbl); |
0040 |
int WtDeleteAppTable(WtAppTableSet *set, Tcl_Obj *id, Tcl_Interp *interp); |
0041 |
WtTableCmdStatus WtAppTableCmdHelper(ClientData clientData, |
0042 |
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], |
0043 |
int *tclRet, int readOnly, int appendUsage); |
0044 |
void WtAppTableCmdUsageError(Tcl_Interp *interp, Tcl_Obj *cmd, |
0045 |
int readOnly); |
0046 |
void WtAppTableCmdAppendUsage(Tcl_Interp *interp, Tcl_Obj *cmd, |
0047 |
int readOnly); |
0048 |
int WtAppTableCmd(ClientData clientData, Tcl_Interp *interp, |
0049 |
int objc, Tcl_Obj *const objv[]); |
0050 |
Tcl_Obj *WtAppTableCmdGetTarget(Tcl_Obj *id, Tcl_Interp *interp); |
0051 |
Tcl_Obj *WtAppTableCmdGetStorage(Tcl_Obj *id, Tcl_Obj **tbl, |
0052 |
Tcl_Interp *interp); |
0053 |
Tcl_Obj *WtNewAppTableObj(); |
0054 |
WtAppTable *WtAppTableRep(Tcl_Obj *obj); |
0055 |
void WtInitAppTableCommands(Tcl_Interp *interp); |
0056 |
|
0057 |
extern WtAppTableSet wtAppTables; |
0058 |
extern Tcl_ObjType WtAppTableType; |
0059 |
|
0060 |
#endif /* !_WT_APP_TABLE_H */ |