There are no available options for this view.

Parent Directory Parent Directory | Revision <a href="/cvs/aolserver/aolserver/nsd/log.c#A_Log">Log</a> Revision <a href="/cvs/aolserver/aolserver/nsd/log.c#A_Log">Log</a>

Revision 1.6 - (show annotations) (download) (as text)
Mon Mar 28 00:13:54 2005 UTC (5 years, 4 months ago) by jgdavidson
Branch: MAIN
CVS Tags: aolserver_v45_r0, HEAD
Branch point for: aolserver_v45_r1, aolserver_v45_bp
Changes since 1.5: +3 -3 lines
File MIME type: text/x-chdr
Fixed misnamed <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_Ns_TclDbGetHandle">Ns_TclDbGetHandle</a> function.
1 /*
2 * The contents of this file are subject to the AOLserver Public License
3 * Version 1.1 (the "License"); you may not use this file except in
4 * compliance with the License. You may obtain a copy of the License at
5 * http://aolserver.com/.
6 *
7 * Software distributed under the License is distributed on an "AS IS"
8 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
9 * the License for the specific language governing rights and limitations
10 * under the License.
11 *
12 * The Original Code is AOLserver Code and related documentation
13 * distributed by AOL.
14 *
15 * The Initial Developer of the Original Code is America Online,
16 * Inc. Portions created by AOL are Copyright (C) 1999 America Online,
17 * Inc. All Rights Reserved.
18 *
19 * Alternatively, the contents of this file may be used under the terms
20 * of the GNU General Public License (the "GPL"), in which case the
21 * provisions of GPL are applicable instead of those above. If you wish
22 * to allow use of your version of this file only under the terms of the
23 * GPL and not to allow others to use your version of this file under the
24 * License, indicate your decision by deleting the provisions above and
25 * replace them with the notice and other provisions required by the GPL.
26 * If you do not delete the provisions above, a recipient may use your
27 * version of this file under either the License or the GPL.
28 */
29
30 /*
31 * dbtcl.c --
32 *
33 * Tcl database access routines.
34 */
35
36 static const char *RCSID = "@(#) $Header: /cvsroot-fuse/aolserver/aolserver/nsdb/dbtcl.c,v 1.6 2005/03/28 00:13:54 jgdavidson Exp $, compiled: " __DATE__ " " __TIME__;
37
38 #include "db.h"
39
40 /*
41 * The following structure maintains per-interp data.
42 */
43
44 typedef struct InterpData {
45 Tcl_Interp *interp;
46 char *server;
47 int cleanup;
48 Tcl_HashTable dbs;
49 } InterpData;
50
51 /*
52 * Local functions defined in this file
53 */
54
55 static void <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_EnterRow">EnterRow</a>(Tcl_Interp *interp, Ns_Set *row, int flags,
56 int *statusPtr);
57 static void <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_EnterHandle">EnterHandle</a>(InterpData *idataPtr, Tcl_Interp *interp,
58 Ns_DbHandle *handle);
59 static int <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetHandle">GetHandle</a>(InterpData *idataPtr, char *id,
60 Ns_DbHandle **handle, int clear, Tcl_HashEntry **hPtrPtr);
61 static int <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetHandleObj">GetHandleObj</a>(InterpData *idataPtr, Tcl_Obj *obj,
62 Ns_DbHandle **handle, int clear, Tcl_HashEntry **hPtrPtr);
63 static Tcl_InterpDeleteProc <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_FreeData">FreeData</a>;
64 static Ns_TclDeferProc <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_ReleaseDbs">ReleaseDbs</a>;
65 static Tcl_ObjCmdProc <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_DbObjCmd">DbObjCmd</a>;
66 static Tcl_CmdProc <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_QuoteListToListCmd">QuoteListToListCmd</a>, <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetCsvCmd">GetCsvCmd</a>, <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_DbErrorCodeCmd">DbErrorCodeCmd</a>,
67 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_DbErrorMsgCmd">DbErrorMsgCmd</a>, <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetCsvCmd">GetCsvCmd</a>, <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_DbConfigPathCmd">DbConfigPathCmd</a>, <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_PoolDescriptionCmd">PoolDescriptionCmd</a>;
68 static char *datakey = "nsdb:data";
69
70
71 /*
72 *----------------------------------------------------------------------
73 * <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_Ns_TclDbGetHandle">Ns_TclDbGetHandle</a> --
74 *
75 * Get database handle from its handle id.
76 *
77 * Results:
78 * See <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetHandle">GetHandle</a>().
79 *
80 * Side effects:
81 * None.
82 *
83 *----------------------------------------------------------------------
84 */
85
86 int
87 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_Ns_TclDbGetHandle">Ns_TclDbGetHandle</a>(Tcl_Interp *interp, char *id, Ns_DbHandle **handle)
88 {
89 InterpData *idataPtr;
90
91 idataPtr = Tcl_GetAssocData(interp, datakey, NULL);
92 if (idataPtr == NULL) {
93 return TCL_ERROR;
94 }
95 return <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetHandle">GetHandle</a>(idataPtr, id, handle, 0, NULL);
96 }
97
98
99 /*
100 *----------------------------------------------------------------------
101 *
102 * <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_NsDbAddCmds">NsDbAddCmds</a> --
103 *
104 * Add the nsdb commands.
105 *
106 * Results:
107 * None.
108 *
109 * Side effects:
110 * None.
111 *
112 *----------------------------------------------------------------------
113 */
114
115 int
116 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_NsDbAddCmds">NsDbAddCmds</a>(Tcl_Interp *interp, void *arg)
117 {
118 InterpData *idataPtr;
119
120 /*
121 * Initialize the per-interp data.
122 */
123
124 idataPtr = ns_malloc(sizeof(InterpData));
125 idataPtr->server = arg;
126 idataPtr->interp = interp;
127 idataPtr->cleanup = 0;
128 Tcl_InitHashTable(&idataPtr->dbs, TCL_STRING_KEYS);
129 Tcl_SetAssocData(interp, datakey, <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_FreeData">FreeData</a>, idataPtr);
130
131 Tcl_CreateObjCommand(interp, "ns_db", <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_DbObjCmd">DbObjCmd</a>, idataPtr, NULL);
132 Tcl_CreateCommand(interp, "ns_quotelisttolist", <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_QuoteListToListCmd">QuoteListToListCmd</a>, idataPtr, NULL);
133 Tcl_CreateCommand(interp, "ns_getcsv", <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetCsvCmd">GetCsvCmd</a>, idataPtr, NULL);
134 Tcl_CreateCommand(interp, "ns_dberrorcode", <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_DbErrorCodeCmd">DbErrorCodeCmd</a>, idataPtr, NULL);
135 Tcl_CreateCommand(interp, "ns_dberrormsg", <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_DbErrorMsgCmd">DbErrorMsgCmd</a>, idataPtr, NULL);
136 Tcl_CreateCommand(interp, "ns_getcsv", <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetCsvCmd">GetCsvCmd</a>, idataPtr, NULL);
137 Tcl_CreateCommand(interp, "ns_dbconfigpath", <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_DbConfigPathCmd">DbConfigPathCmd</a>, idataPtr, NULL);
138 Tcl_CreateCommand(interp, "ns_pooldescription", <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_PoolDescriptionCmd">PoolDescriptionCmd</a>, idataPtr, NULL);
139 return TCL_OK;
140 }
141
142
143 /*
144 *----------------------------------------------------------------------
145 *
146 * <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_DbCmd">DbCmd</a> --
147 *
148 * Implement the AOLserver ns_db Tcl command.
149 *
150 * Results:
151 * Return TCL_OK upon success and TCL_ERROR otherwise.
152 *
153 * Side effects:
154 * Depends on the command.
155 *
156 *----------------------------------------------------------------------
157 */
158
159 static int
160 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_DbObjCmd">DbObjCmd</a>(ClientData data, Tcl_Interp *interp, int objc, Tcl_Obj **objv)
161 {
162 #define MAXHANDLES 4
163 InterpData *idataPtr = data;
164 Ns_DbHandle *handle, **handlesPtrPtr, *staticHandles[MAXHANDLES];
165 Ns_Set *row;
166 Tcl_HashEntry *hPtr;
167 Tcl_Obj *resultPtr;
168 char *arg, *pool, buf[32];
169 int timeout, nhandles, n, status;
170 static CONST char *opts[] = {
171 "getrow", "gethandle", "releasehandle", "select", "dml",
172 "1row", "0or1row", "bindrow", "exec", "sp_exec", "sp_getparams",
173 "sp_returncode", "sp_setparam", "sp_start", "exception",
174 "flush", "bouncepool", "cancel", "connected", "datasource",
175 "dbtype", "disconnect", "driver", "interpretsqlfile",
176 "password", "poolname", "pools", "resethandle", "setexception",
177 "user", "verbose", NULL
178 }; enum {
179 Db_getrowIdx, Db_gethandleIdx, Db_releasehandleIdx,
180 Db_selectIdx, Db_dmlIdx, Db_1rowIdx, Db_0or1rowIdx,
181 Db_bindrowIdx, Db_execIdx, Db_sp_execIdx, Db_sp_getparamsIdx,
182 Db_sp_returncodeIdx, Db_sp_setparamIdx, Db_sp_startIdx,
183 Db_exceptionIdx, Db_flushIdx, Db_bouncepoolIdx, Db_cancelIdx,
184 Db_connectedIdx, Db_datasourceIdx, Db_dbtypeIdx, Db_disconnectIdx,
185 Db_driverIdx, Db_interpretsqlfileIdx, Db_passwordIdx,
186 Db_poolnameIdx, Db_poolsIdx, Db_resethandleIdx, Db_setexceptionIdx,
187 Db_userIdx, Db_verboseIdx
188 } opt;
189 static CONST char *spopts[] = {
190 "in", "out", NULL
191 };
192 enum {
193 Sp_inIdx, Sp_outIdx
194 } spopt;
195
196 if (objc < 2) {
197 Tcl_WrongNumArgs(interp, 1, objv, "option ?args?");
198 return TCL_ERROR;
199 }
200 if (Tcl_GetIndexFromObj(interp, objv[1], opts, "option", 1,
201 (int *) &opt) != TCL_OK) {
202 return TCL_ERROR;
203 }
204
205 resultPtr = Tcl_GetObjResult(interp);
206 handle = NULL;
207 status = NS_OK;
208
209 switch (opt) {
210
211 /*
212 * The following options require just a db arg and clears
213 * any exception when getting the handle.
214 */
215
216 case Db_bindrowIdx:
217 case Db_cancelIdx:
218 case Db_connectedIdx:
219 case Db_datasourceIdx:
220 case Db_dbtypeIdx:
221 case Db_disconnectIdx:
222 case Db_driverIdx:
223 case Db_flushIdx:
224 case Db_passwordIdx:
225 case Db_poolnameIdx:
226 case Db_releasehandleIdx:
227 case Db_resethandleIdx:
228 case Db_sp_execIdx:
229 case Db_sp_getparamsIdx:
230 case Db_sp_returncodeIdx:
231 case Db_userIdx:
232 if (objc != 3) {
233 Tcl_WrongNumArgs(interp, 2, objv, "dbId");
234 return 0;
235 }
236 if (<a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetHandleObj">GetHandleObj</a>(idataPtr, objv[2], &handle, 1, &hPtr) != TCL_OK) {
237 return TCL_ERROR;
238 }
239 switch ((int) opt) {
240 case Db_bindrowIdx:
241 row = <a href="/cvs/aolserver/aolserver/nsdb/dbdrv.c#A_Ns_DbBindRow">Ns_DbBindRow</a>(handle);
242 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_EnterRow">EnterRow</a>(interp, row, NS_TCL_SET_STATIC, &status);
243 break;
244
245 case Db_cancelIdx:
246 status = <a href="/cvs/aolserver/aolserver/nsdb/dbdrv.c#A_Ns_DbCancel">Ns_DbCancel</a>(handle);
247 break;
248
249 case Db_connectedIdx:
250 Tcl_SetBooleanObj(resultPtr, handle->connected);
251 break;
252
253 case Db_datasourceIdx:
254 Tcl_SetResult(interp, handle->datasource, TCL_STATIC);
255 break;
256
257 case Db_dbtypeIdx:
258 Tcl_SetResult(interp, <a href="/cvs/aolserver/aolserver/nsdb/dbdrv.c#A_Ns_DbDriverDbType">Ns_DbDriverDbType</a>(handle), TCL_STATIC);
259 break;
260
261 case Db_disconnectIdx:
262 <a href="/cvs/aolserver/aolserver/nsdb/dbinit.c#A_NsDbDisconnect">NsDbDisconnect</a>(handle);
263 break;
264
265 case Db_driverIdx:
266 Tcl_SetResult(interp, <a href="/cvs/aolserver/aolserver/nsdb/dbdrv.c#A_Ns_DbDriverName">Ns_DbDriverName</a>(handle), TCL_STATIC);
267 break;
268
269 case Db_flushIdx:
270 status = <a href="/cvs/aolserver/aolserver/nsdb/dbdrv.c#A_Ns_DbFlush">Ns_DbFlush</a>(handle);
271 break;
272
273 case Db_passwordIdx:
274 Tcl_SetResult(interp, handle->password, TCL_VOLATILE);
275 break;
276
277 case Db_poolnameIdx:
278 Tcl_SetResult(interp, handle->poolname, TCL_VOLATILE);
279 break;
280
281 case Db_releasehandleIdx:
282 Tcl_DeleteHashEntry(hPtr);
283 <a href="/cvs/aolserver/aolserver/nsdb/dbinit.c#A_Ns_DbPoolPutHandle">Ns_DbPoolPutHandle</a>(handle);
284 break;
285
286 case Db_resethandleIdx:
287 status = <a href="/cvs/aolserver/aolserver/nsdb/dbdrv.c#A_Ns_DbResetHandle">Ns_DbResetHandle</a>(handle);
288 if (status == NS_OK) {
289 Tcl_SetIntObj(resultPtr, NS_OK);
290 }
291 break;
292
293 case Db_sp_execIdx:
294 status = <a href="/cvs/aolserver/aolserver/nsdb/dbdrv.c#A_Ns_DbSpExec">Ns_DbSpExec</a>(handle);
295 if (status == NS_DML) {
296 Tcl_SetResult(interp, "NS_DML", TCL_STATIC);
297 } else if (status == NS_ROWS) {
298 Tcl_SetResult(interp, "NS_ROWS", TCL_STATIC);
299 }
300 break;
301
302 case Db_sp_getparamsIdx:
303 row = <a href="/cvs/aolserver/aolserver/nsdb/dbdrv.c#A_Ns_DbSpGetParams">Ns_DbSpGetParams</a>(handle);
304 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_EnterRow">EnterRow</a>(interp, row, NS_TCL_SET_DYNAMIC, &status);
305 break;
306
307 case Db_sp_returncodeIdx:
308 status = <a href="/cvs/aolserver/aolserver/nsdb/dbdrv.c#A_Ns_DbSpReturnCode">Ns_DbSpReturnCode</a>(handle, buf, 32);
309 if (status == NS_OK) {
310 Tcl_SetResult(interp, buf, TCL_VOLATILE);
311 }
312 break;
313
314 case Db_userIdx:
315 Tcl_SetResult(interp, handle->user, TCL_VOLATILE);
316 break;
317 }
318 break;
319
320 /*
321 * The following also requires just a db argument and
322 * preserves any exception.
323 */
324
325 case Db_exceptionIdx:
326 if (objc != 3) {
327 Tcl_WrongNumArgs(interp, 2, objv, "dbId");
328 return 0;
329 }
330 if (<a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetHandleObj">GetHandleObj</a>(idataPtr, objv[2], &handle, 0, &hPtr) != TCL_OK) {
331 return TCL_ERROR;
332 }
333 Tcl_AppendElement(interp, handle->cExceptionCode);
334 Tcl_AppendElement(interp, handle->dsExceptionMsg.string);
335 break;
336
337 /*
338 * The following options require a db and extra string arg and
339 * clear any exception.
340 */
341
342 case Db_0or1rowIdx:
343 case Db_1rowIdx:
344 case Db_dmlIdx:
345 case Db_execIdx:
346 case Db_getrowIdx:
347 case Db_interpretsqlfileIdx:
348 case Db_selectIdx:
349 case Db_sp_startIdx:
350 if (objc != 4) {
351 Tcl_WrongNumArgs(interp, 2, objv, "dbId arg");
352 return 0;
353 }
354 if (<a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetHandleObj">GetHandleObj</a>(idataPtr, objv[2], &handle, 1, &hPtr) != TCL_OK) {
355 return TCL_ERROR;
356 }
357 arg = Tcl_GetString(objv[3]);
358
359 switch ((int) opt) {
360 case Db_0or1rowIdx:
361 row = <a href="/cvs/aolserver/aolserver/nsdb/dbutil.c#A_Ns_Db0or1Row">Ns_Db0or1Row</a>(handle, arg, &n);
362 if (row != NULL && n == 0) {
363 <a href="/cvs/aolserver/aolserver/nsd/set.c#A_Ns_SetFree">Ns_SetFree</a>(row);
364 } else {
365 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_EnterRow">EnterRow</a>(interp, row, NS_TCL_SET_DYNAMIC, &status);
366 }
367 break;
368
369 case Db_1rowIdx:
370 row = <a href="/cvs/aolserver/aolserver/nsdb/dbutil.c#A_Ns_Db1Row">Ns_Db1Row</a>(handle, arg);
371 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_EnterRow">EnterRow</a>(interp, row, NS_TCL_SET_DYNAMIC, &status);
372 break;
373
374 case Db_dmlIdx:
375 status = <a href="/cvs/aolserver/aolserver/nsdb/dbdrv.c#A_Ns_DbDML">Ns_DbDML</a>(handle, arg);
376 break;
377
378 case Db_execIdx:
379 status = <a href="/cvs/aolserver/aolserver/nsdb/dbdrv.c#A_Ns_DbExec">Ns_DbExec</a>(handle, arg);
380 if (status == NS_DML) {
381 Tcl_SetResult(interp, "NS_DML", TCL_STATIC);
382 } else if (status == NS_ROWS) {
383 Tcl_SetResult(interp, "NS_ROWS", TCL_STATIC);
384 }
385 break;
386
387 case Db_getrowIdx:
388 if (<a href="/cvs/aolserver/aolserver/nsd/tclset.c#A_Ns_TclGetSet2">Ns_TclGetSet2</a>(interp, arg, &row) != TCL_OK) {
389 return TCL_ERROR;
390 }
391 status = <a href="/cvs/aolserver/aolserver/nsdb/dbdrv.c#A_Ns_DbGetRow">Ns_DbGetRow</a>(handle, row);
392 if (status == NS_OK) {
393 Tcl_SetBooleanObj(resultPtr, 1);
394 } else if (status == NS_END_DATA) {
395 Tcl_SetBooleanObj(resultPtr, 0);
396 }
397 break;
398
399 case Db_interpretsqlfileIdx:
400 status = <a href="/cvs/aolserver/aolserver/nsdb/dbutil.c#A_Ns_DbInterpretSqlFile">Ns_DbInterpretSqlFile</a>(handle, arg);
401 break;
402
403 case Db_selectIdx:
404 row = <a href="/cvs/aolserver/aolserver/nsdb/dbdrv.c#A_Ns_DbSelect">Ns_DbSelect</a>(handle, arg);
405 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_EnterRow">EnterRow</a>(interp, row, NS_TCL_SET_STATIC, &status);
406 break;
407
408 case Db_sp_startIdx:
409 status = <a href="/cvs/aolserver/aolserver/nsdb/dbdrv.c#A_Ns_DbSpStart">Ns_DbSpStart</a>(handle, arg);
410 if (status == NS_OK) {
411 Tcl_SetBooleanObj(resultPtr, 0);
412 }
413 break;
414 }
415 break;
416
417 /*
418 * The remaining options requiring specific args.
419 */
420
421 case Db_sp_setparamIdx:
422 if (objc != 7) {
423 Tcl_WrongNumArgs(interp, 2, objv,
424 "dbId paramname type in|out value");
425 return TCL_ERROR;
426 }
427 if (Tcl_GetIndexFromObj(interp, objv[5], spopts, "option", 0,
428 (int *) &spopt) != TCL_OK) {
429 return TCL_ERROR;
430 }
431 if (<a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetHandleObj">GetHandleObj</a>(idataPtr, objv[2], &handle, 1, &hPtr) != TCL_OK) {
432 return TCL_ERROR;
433 }
434 status = <a href="/cvs/aolserver/aolserver/nsdb/dbdrv.c#A_Ns_DbSpSetParam">Ns_DbSpSetParam</a>(handle, Tcl_GetString(objv[3]),
435 Tcl_GetString(objv[4]),
436 spopts[spopt],
437 Tcl_GetString(objv[6]));
438 if (status == NS_OK) {
439 Tcl_SetBooleanObj(resultPtr, 1);
440 }
441 break;
442
443 case Db_gethandleIdx:
444 timeout = -1;
445 if (objc >= 4) {
446 arg = Tcl_GetString(objv[2]);
447 if (STREQ(arg, "-timeout")) {
448 if (Tcl_GetIntFromObj(interp, objv[3], &timeout) != TCL_OK) {
449 return TCL_ERROR;
450 }
451 objv += 2;
452 objc -= 2;
453 } else if (objc > 4) {
454 Tcl_WrongNumArgs(interp, 2, objv,
455 "?-timeout seconds? ?pool? ?nhandles?");
456 return TCL_ERROR;
457 }
458 }
459 objv += 2;
460 objc -= 2;
461
462 /*
463 * Determine the pool and requested number of handles
464 * from the remaining args.
465 */
466
467 if (objc > 0) {
468 pool = Tcl_GetString(objv[0]);
469 } else {
470 pool = <a href="/cvs/aolserver/aolserver/nsdb/dbinit.c#A_Ns_DbPoolDefault">Ns_DbPoolDefault</a>(idataPtr->server);
471 if (pool == NULL) {
472 Tcl_SetResult(interp, "no defaultpool configured", TCL_STATIC);
473 return TCL_ERROR;
474 }
475 }
476 if (<a href="/cvs/aolserver/aolserver/nsdb/dbinit.c#A_Ns_DbPoolAllowable">Ns_DbPoolAllowable</a>(idataPtr->server, pool) == NS_FALSE) {
477 Tcl_AppendResult(interp, "no access to pool: \"", pool, "\"",
478 NULL);
479 return TCL_ERROR;
480 }
481 if (objc < 2) {
482 nhandles = 1;
483 } else {
484 if (Tcl_GetIntFromObj(interp, objv[1], &nhandles) != TCL_OK) {
485 return TCL_ERROR;
486 }
487 if (nhandles <= 0) {
488 Tcl_AppendResult(interp, "invalid nhandles: \"",
489 Tcl_GetString(objv[1]),
490 "\": should be greater than 0.", NULL);
491 return TCL_ERROR;
492 }
493 }
494
495 /*
496 * Allocate handles and enter them into Tcl.
497 */
498
499 if (nhandles > MAXHANDLES) {
500 handlesPtrPtr = ns_malloc(nhandles * sizeof(Ns_DbHandle *));
501 } else {
502 handlesPtrPtr = staticHandles;
503 }
504 status = <a href="/cvs/aolserver/aolserver/nsdb/dbinit.c#A_Ns_DbPoolTimedGetMultipleHandles">Ns_DbPoolTimedGetMultipleHandles</a>(handlesPtrPtr, pool,
505 nhandles, timeout);
506 if (status == NS_OK) {
507 while (--nhandles >= 0) {
508 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_EnterHandle">EnterHandle</a>(idataPtr, interp, handlesPtrPtr[nhandles]);
509 }
510 }
511 if (handlesPtrPtr != staticHandles) {
512 ns_free(handlesPtrPtr);
513 }
514 if (status != NS_TIMEOUT && status != NS_OK) {
515 sprintf(buf, "%d", nhandles);
516 Tcl_AppendResult(interp, "could not allocate ", buf,
517 " handle(s) from pool \"", pool, "\"", NULL);
518 return TCL_ERROR;
519 }
520 break;
521
522 case Db_bouncepoolIdx:
523 if (objc != 3) {
524 Tcl_WrongNumArgs(interp, 2, objv, "pool");
525 return TCL_ERROR;
526 }
527 status = <a href="/cvs/aolserver/aolserver/nsdb/dbinit.c#A_Ns_DbBouncePool">Ns_DbBouncePool</a>(Tcl_GetString(objv[2]));
528 break;
529
530 case Db_poolsIdx:
531 if (objc > 2) {
532 Tcl_WrongNumArgs(interp, 2, objv, NULL);
533 return TCL_ERROR;
534 }
535 pool = <a href="/cvs/aolserver/aolserver/nsdb/dbinit.c#A_Ns_DbPoolList">Ns_DbPoolList</a>(idataPtr->server);
536 if (pool != NULL) {
537 while (*pool != '\0') {
538 Tcl_AppendElement(interp, pool);
539 pool = pool + strlen(pool) + 1;
540 }
541 }
542 break;
543
544 case Db_setexceptionIdx:
545 if (objc != 5) {
546 Tcl_WrongNumArgs(interp, 2, objv, "dbId code message");
547 return TCL_ERROR;
548 }
549 if (<a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetHandleObj">GetHandleObj</a>(idataPtr, objv[2], &handle, 1, NULL) != TCL_OK) {
550 return TCL_ERROR;
551 }
552 arg = Tcl_GetStringFromObj(objv[3], &n);
553 if (n > 5) {
554 Tcl_AppendResult(interp, "code \"", arg,
555 "\" more than 5 characters", NULL);
556 return TCL_ERROR;
557 }
558 <a href="/cvs/aolserver/aolserver/nsdb/dbutil.c#A_Ns_DbSetException">Ns_DbSetException</a>(handle, arg, Tcl_GetString(objv[4]));
559 break;
560
561 case Db_verboseIdx:
562 if (objc != 3 && objc != 4) {
563 Tcl_WrongNumArgs(interp, 2, objv, "dbId ?bool?");
564 return TCL_ERROR;
565 }
566 if (<a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetHandleObj">GetHandleObj</a>(idataPtr, objv[2], &handle, 1, NULL) != TCL_OK) {
567 return TCL_ERROR;
568 }
569 if (objc == 4) {
570 if (Tcl_GetBooleanFromObj(interp, objv[3], &n) != TCL_OK) {
571 return TCL_ERROR;
572 }
573 handle->verbose = n;
574 }
575 Tcl_SetIntObj(resultPtr, handle->verbose);
576 break;
577 }
578
579 if (status == NS_ERROR) {
580 Tcl_AppendResult(interp, "Database operation \"", opts[opt],
581 "\" failed", NULL);
582 if (handle != NULL && handle->cExceptionCode[0] != '\0') {
583 Tcl_AppendResult(interp, " (exception ",
584 handle->cExceptionCode, NULL);
585 if (handle->dsExceptionMsg.length > 0) {
586 Tcl_AppendResult(interp, ", \"",
587 handle->dsExceptionMsg.string, "\"", NULL);
588 }
589 Tcl_AppendResult(interp, ")", NULL);
590 }
591 return TCL_ERROR;
592 }
593
594 return TCL_OK;
595 }
596
597
598 /*
599 *----------------------------------------------------------------------
600 * <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_DbErrorCodeCmd">DbErrorCodeCmd</a> --
601 *
602 * Get database exception code for the database handle.
603 *
604 * Results:
605 * Returns TCL_OK and database exception code is set as Tcl result
606 * or TCL_ERROR if failure.
607 *
608 * Side effects:
609 * None.
610 *
611 *----------------------------------------------------------------------
612 */
613
614 static int
615 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_ErrorCmd">ErrorCmd</a>(ClientData arg, Tcl_Interp *interp, int argc, CONST char **argv, int cmd)
616 {
617 InterpData *idataPtr = arg;
618 Ns_DbHandle *handle;
619
620 if (argc != 2) {
621 Tcl_AppendResult(interp, "wrong # args: should be \"",
622 argv[0], " dbId\"", NULL);
623 return TCL_ERROR;
624 }
625 if (<a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetHandle">GetHandle</a>(idataPtr, (char*) argv[1], &handle, 0, NULL) != TCL_OK) {
626 return TCL_ERROR;
627 }
628 if (cmd == 'c') {
629 Tcl_SetResult(interp, handle->cExceptionCode, TCL_VOLATILE);
630 } else {
631 Tcl_SetResult(interp, handle->dsExceptionMsg.string, TCL_VOLATILE);
632 }
633 return TCL_OK;
634 }
635
636 static int
637 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_DbErrorCodeCmd">DbErrorCodeCmd</a>(ClientData arg, Tcl_Interp *interp, int argc, CONST char **argv)
638 {
639 return <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_ErrorCmd">ErrorCmd</a>(arg, interp, argc, argv, 'c');
640 }
641
642 static int
643 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_DbErrorMsgCmd">DbErrorMsgCmd</a>(ClientData arg, Tcl_Interp *interp, int argc, CONST char **argv)
644 {
645 return <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_ErrorCmd">ErrorCmd</a>(arg, interp, argc, argv, 'm');
646 }
647
648
649 /*
650 *----------------------------------------------------------------------
651 * <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_DbConfigPathCmd">DbConfigPathCmd</a> --
652 *
653 * Get the database section name from the configuration file.
654 *
655 * Results:
656 * TCL_OK and the database section name is set as the Tcl result
657 * or TCL_ERROR if failure.
658 *
659 * Side effects:
660 * None.
661 *
662 *----------------------------------------------------------------------
663 */
664
665 static int
666 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_DbConfigPathCmd">DbConfigPathCmd</a>(ClientData arg, Tcl_Interp *interp, int argc, CONST char **argv)
667 {
668 InterpData *idataPtr = arg;
669 char *section;
670
671 if (argc != 1) {
672 Tcl_AppendResult(interp, "wrong # of args: should be \"", argv[0],
673 "\"", NULL);
674 return TCL_ERROR;
675 }
676 section = <a href="/cvs/aolserver/aolserver/nsd/config.c#A_Ns_ConfigGetPath">Ns_ConfigGetPath</a>(idataPtr->server, NULL, "db", NULL);
677 Tcl_SetResult(interp, section, TCL_STATIC);
678 return TCL_OK;
679 }
680
681
682 /*
683 *----------------------------------------------------------------------
684 * <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_PoolDescriptionCmd">PoolDescriptionCmd</a> --
685 *
686 * Get the pool's description string.
687 *
688 * Results:
689 * Return TCL_OK and the pool's description string is set as the
690 * Tcl result string or TCL_ERROR if failure.
691 *
692 * Side effects:
693 * None.
694 *
695 *----------------------------------------------------------------------
696 */
697
698 static int
699 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_PoolDescriptionCmd">PoolDescriptionCmd</a>(ClientData arg, Tcl_Interp *interp, int argc,
700 CONST char **argv)
701 {
702 if (argc != 2) {
703 Tcl_AppendResult(interp, "wrong # of args: should be \"",
704 (char*)argv[0], " poolname\"", NULL);
705 return TCL_ERROR;
706 }
707 Tcl_SetResult(interp, <a href="/cvs/aolserver/aolserver/nsdb/dbinit.c#A_Ns_DbPoolDescription">Ns_DbPoolDescription</a>((char*)argv[1]),TCL_STATIC);
708 return TCL_OK;
709 }
710
711
712 /*
713 *----------------------------------------------------------------------
714 * <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_QuoteListToListCmd">QuoteListToListCmd</a> --
715 *
716 * Remove space, \ and ' characters in a string.
717 *
718 * Results:
719 * TCL_OK and set the stripped string as the Tcl result or TCL_ERROR
720 * if failure.
721 *
722 * Side effects:
723 * None.
724 *
725 *----------------------------------------------------------------------
726 */
727
728 static int
729 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_QuoteListToListCmd">QuoteListToListCmd</a>(ClientData arg, Tcl_Interp *interp, int argc,
730 CONST char **argv)
731 {
732 char *quotelist;
733 int inquotes;
734 Ns_DString ds;
735
736 if (argc != 2) {
737 Tcl_AppendResult(interp, "wrong # of args: should be \"",
738 argv[0], " quotelist\"", NULL);
739 return TCL_ERROR;
740 }
741 quotelist = (char*)argv[1];
742 inquotes = NS_FALSE;
743 <a href="/cvs/aolserver/aolserver/nsd/dstring.c#A_Ns_DStringInit">Ns_DStringInit</a>(&ds);
744 while (*quotelist != '\0') {
745 if (isspace(UCHAR(*quotelist)) && inquotes == NS_FALSE) {
746 if (ds.length != 0) {
747 Tcl_AppendElement(interp, ds.string);
748 <a href="/cvs/aolserver/aolserver/nsd/dstring.c#A_Ns_DStringTrunc">Ns_DStringTrunc</a>(&ds, 0);
749 }
750 while (isspace(UCHAR(*quotelist))) {
751 quotelist++;
752 }
753 } else if (*quotelist == '\\' && (*(quotelist + 1) != '\0')) {
754 <a href="/cvs/aolserver/aolserver/nsd/dstring.c#A_Ns_DStringNAppend">Ns_DStringNAppend</a>(&ds, quotelist + 1, 1);
755 quotelist += 2;
756 } else if (*quotelist == '\'') {
757 if (inquotes) {
758 /* Finish element */
759 Tcl_AppendElement(interp, ds.string);
760 <a href="/cvs/aolserver/aolserver/nsd/dstring.c#A_Ns_DStringTrunc">Ns_DStringTrunc</a>(&ds, 0);
761 inquotes = NS_FALSE;
762 } else {
763 /* Start element */
764 inquotes = NS_TRUE;
765 }
766 quotelist++;
767 } else {
768 <a href="/cvs/aolserver/aolserver/nsd/dstring.c#A_Ns_DStringNAppend">Ns_DStringNAppend</a>(&ds, quotelist, 1);
769 quotelist++;
770 }
771 }
772 if (ds.length != 0) {
773 Tcl_AppendElement(interp, ds.string);
774 }
775 <a href="/cvs/aolserver/aolserver/nsd/dstring.c#A_Ns_DStringFree">Ns_DStringFree</a>(&ds);
776 return TCL_OK;
777 }
778
779
780 /*
781 *----------------------------------------------------------------------
782 *
783 * <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetCsvCmd">GetCsvCmd</a> --
784 *
785 * Implement the ns_getcvs command to read a line from a CSV file
786 * and parse the results into a Tcl list variable.
787 *
788 * Results:
789 * A standard Tcl result.
790 *
791 * Side effects:
792 * One line is read for given open channel.
793 *
794 *----------------------------------------------------------------------
795 */
796
797 static int
798 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetCsvCmd">GetCsvCmd</a>(ClientData arg, Tcl_Interp *interp, int argc,
799 CONST char **argv)
800 {
801 int ncols, inquote, quoted, blank;
802 char c, *p, buf[20];
803 const char *result;
804 Tcl_DString line, cols, elem;
805 Tcl_Channel chan;
806
807 if (argc != 3) {
808 Tcl_AppendResult(interp, "wrong # of args: should be \"",
809 argv[0], " fileId varName\"", NULL);
810 return TCL_ERROR;
811 }
812 if (<a href="/cvs/aolserver/aolserver/nsd/tclfile.c#A_Ns_TclGetOpenChannel">Ns_TclGetOpenChannel</a>(interp, (char*)argv[1], 0, 0, &chan) == TCL_ERROR) {
813 return TCL_ERROR;
814 }
815
816 Tcl_DStringInit(&line);
817 if (Tcl_Gets(chan, &line) < 0) {
818 Tcl_DStringFree(&line);
819 if (!Tcl_Eof(chan)) {
820 Tcl_AppendResult(interp, "could not read from ", argv[1],
821 ": ", Tcl_PosixError(interp), NULL);
822 return TCL_ERROR;
823 }
824 Tcl_SetResult(interp, "-1", TCL_STATIC);
825 return TCL_OK;
826 }
827
828 Tcl_DStringInit(&cols);
829 Tcl_DStringInit(&elem);
830 ncols = 0;
831 inquote = 0;
832 quoted = 0;
833 blank = 1;
834 p = line.string;
835 while (*p != '\0') {
836 c = *p++;
837 loopstart:
838 if (inquote) {
839 if (c == '"') {
840 c = *p++;
841 if (c == '\0') {
842 break;
843 }
844 if (c == '"') {
845 Tcl_DStringAppend(&elem, &c, 1);
846 } else {
847 inquote = 0;
848 goto loopstart;
849 }
850 } else {
851 Tcl_DStringAppend(&elem, &c, 1);
852 }
853 } else {
854 if ((c == '\n') || (c == '\r')) {
855 while ((c = *p++) != '\0') {
856 if ((c != '\n') && (c != '\r')) {
857 --p;
858 break;
859 }
860 }
861 break;
862 }
863 if (c == '"') {
864 inquote = 1;
865 quoted = 1;
866 blank = 0;
867 } else if ((c == '\r') || (elem.length == 0 && isspace(UCHAR(c)))) {
868 continue;
869 } else if (c == ',') {
870 if (!quoted) {
871 <a href="/cvs/aolserver/aolserver/nsd/str.c#A_Ns_StrTrimRight">Ns_StrTrimRight</a>(elem.string);
872 }
873 Tcl_DStringAppendElement(&cols, elem.string);
874 Tcl_DStringTrunc(&elem, 0);
875 ncols++;
876 quoted = 0;
877 } else {
878 blank = 0;
879 Tcl_DStringAppend(&elem, &c, 1);
880 }
881 }
882 }
883 if (!quoted) {
884 <a href="/cvs/aolserver/aolserver/nsd/str.c#A_Ns_StrTrimRight">Ns_StrTrimRight</a>(elem.string);
885 }
886 if (!blank) {
887 Tcl_DStringAppendElement(&cols, elem.string);
888 ncols++;
889 }
890 result = Tcl_SetVar(interp, argv[2], cols.string, TCL_LEAVE_ERR_MSG);
891 Tcl_DStringFree(&line);
892 Tcl_DStringFree(&cols);
893 Tcl_DStringFree(&elem);
894 if (result == NULL) {
895 return TCL_ERROR;
896 }
897 sprintf(buf, "%d", ncols);
898 Tcl_SetResult(interp, buf, TCL_VOLATILE);
899 return TCL_OK;
900 }
901
902
903 /*
904 *----------------------------------------------------------------------
905 * <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetHandle">GetHandle</a>, <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetHandleObj">GetHandleObj</a> --
906 *
907 * Get database handle from its handle id.
908 *
909 * Results:
910 * Return TCL_OK if handle is found or TCL_ERROR otherwise.
911 *
912 * Side effects:
913 * None.
914 *
915 *----------------------------------------------------------------------
916 */
917
918 static int
919 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetHandle">GetHandle</a>(InterpData *idataPtr, char *id, Ns_DbHandle **handlePtr,
920 int clear, Tcl_HashEntry **hPtrPtr)
921 {
922 Ns_DbHandle *handle;
923 Tcl_HashEntry *hPtr;
924
925 hPtr = Tcl_FindHashEntry(&idataPtr->dbs, id);
926 if (hPtr == NULL) {
927 Tcl_AppendResult(idataPtr->interp, "invalid database id: \"", id,
928 "\"", NULL);
929 return TCL_ERROR;
930 }
931 handle = (Ns_DbHandle *) Tcl_GetHashValue(hPtr);
932 if (clear) {
933 <a href="/cvs/aolserver/aolserver/nsd/dstring.c#A_Ns_DStringFree">Ns_DStringFree</a>(&handle->dsExceptionMsg);
934 handle->cExceptionCode[0] = '\0';
935 }
936 if (hPtrPtr != NULL) {
937 *hPtrPtr = hPtr;
938 }
939 if (handlePtr != NULL) {
940 *handlePtr = handle;
941 }
942 return TCL_OK;
943 }
944
945
946 static int
947 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetHandleObj">GetHandleObj</a>(InterpData *idataPtr, Tcl_Obj *obj, Ns_DbHandle **handlePtr,
948 int clear, Tcl_HashEntry **hPtrPtr)
949 {
950 return <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_GetHandle">GetHandle</a>(idataPtr, Tcl_GetString(obj), handlePtr, clear, hPtrPtr);
951 }
952
953
954 /*
955 *----------------------------------------------------------------------
956 * <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_EnterHandle">EnterHandle</a> --
957 *
958 * Enter a database handle and create its handle id.
959 *
960 * Results:
961 * The database handle id is returned as a Tcl result.
962 *
963 * Side effects:
964 * None.
965 *
966 *----------------------------------------------------------------------
967 */
968
969 static void
970 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_EnterHandle">EnterHandle</a>(InterpData *idataPtr, Tcl_Interp *interp, Ns_DbHandle *handle)
971 {
972 Tcl_HashEntry *hPtr;
973 int new, next;
974 char buf[100];
975
976 if (!idataPtr->cleanup) {
977 <a href="/cvs/aolserver/aolserver/nsd/tclinit.c#A_Ns_TclRegisterDeferred">Ns_TclRegisterDeferred</a>(interp, <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_ReleaseDbs">ReleaseDbs</a>, idataPtr);
978 idataPtr->cleanup = 1;
979 }
980 next = idataPtr->dbs.numEntries;
981 do {
982 sprintf(buf, "nsdb%x", next++);
983 hPtr = Tcl_CreateHashEntry(&idataPtr->dbs, buf, &new);
984 } while (!new);
985 Tcl_AppendElement(interp, buf);
986 Tcl_SetHashValue(hPtr, handle);
987 }
988
989
990 /*
991 *----------------------------------------------------------------------
992 * <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_FreeData">FreeData</a> --
993 *
994 * Free per-interp data at interp delete time.
995 *
996 * Results:
997 * None.
998 *
999 * Side effects:
1000 * None.
1001 *
1002 *----------------------------------------------------------------------
1003 */
1004
1005 static void
1006 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_FreeData">FreeData</a>(ClientData arg, Tcl_Interp *interp)
1007 {
1008 InterpData *idataPtr = arg;
1009
1010 Tcl_DeleteHashTable(&idataPtr->dbs);
1011 ns_free(idataPtr);
1012 }
1013
1014
1015 /*
1016 *----------------------------------------------------------------------
1017 * <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_ReleaseDbs">ReleaseDbs</a> --
1018 *
1019 * Release any database handles still held.
1020 *
1021 * Results:
1022 * None.
1023 *
1024 * Side effects:
1025 * None.
1026 *
1027 *----------------------------------------------------------------------
1028 */
1029
1030 static void
1031 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_ReleaseDbs">ReleaseDbs</a>(Tcl_Interp *interp, void *arg)
1032 {
1033 Ns_DbHandle *handle;
1034 Tcl_HashEntry *hPtr;
1035 Tcl_HashSearch search;
1036 InterpData *idataPtr = arg;
1037
1038 hPtr = Tcl_FirstHashEntry(&idataPtr->dbs, &search);
1039 while (hPtr != NULL) {
1040 handle = Tcl_GetHashValue(hPtr);
1041 <a href="/cvs/aolserver/aolserver/nsdb/dbinit.c#A_Ns_DbPoolPutHandle">Ns_DbPoolPutHandle</a>(handle);
1042 hPtr = Tcl_NextHashEntry(&search);
1043 }
1044 Tcl_DeleteHashTable(&idataPtr->dbs);
1045 Tcl_InitHashTable(&idataPtr->dbs, TCL_STRING_KEYS);
1046 idataPtr->cleanup = 0;
1047 }
1048
1049
1050 /*
1051 *----------------------------------------------------------------------
1052 * <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_EnterRow">EnterRow</a> --
1053 *
1054 * Enter a db row set into interp.
1055 *
1056 * Results:
1057 * None.
1058 *
1059 * Side effects:
1060 * Will set *statusPtr to NS_ERROR if row is null.
1061 *
1062 *----------------------------------------------------------------------
1063 */
1064
1065 static void
1066 <a href="/cvs/aolserver/aolserver/nsdb/dbtcl.c#A_EnterRow">EnterRow</a>(Tcl_Interp *interp, Ns_Set *row, int flags, int *statusPtr)
1067 {
1068 if (row == NULL) {
1069 *statusPtr = NS_ERROR;
1070 } else {
1071 <a href="/cvs/aolserver/aolserver/nsd/tclset.c#A_Ns_TclEnterSet">Ns_TclEnterSet</a>(interp, row, flags);
1072 *statusPtr = NS_OK;
1073 }
1074 }