Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | use of new Tcl core functions as suggested by dkf. Thanks to dkf for providing them. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | itcl-ng |
Files: | files | file ages | folders |
SHA1: |
70eb412e5adc42ecb2c66a7235772c2b |
User & Date: | wiede 2009-10-22 15:09:50 |
Context
2009-10-22
| ||
15:12 | use of new Tcl core functions as suggested from dkf. check-in: 57bc872b08 user: wiede tags: itcl-ng | |
15:09 | use of new Tcl core functions as suggested by dkf. Thanks to dkf for providing them. check-in: 70eb412e5a user: wiede tags: itcl-ng | |
14:33 | fix for SF bug #2495261 check-in: f6d40ccd8a user: wiede tags: itcl-ng | |
Changes
Changes to generic/itclCmd.c.
︙ | ︙ | |||
19 20 21 22 23 24 25 | * AUTHOR: Michael J. McLennan * Bell Labs Innovations for Lucent Technologies * [email protected] * http://www.tcltk.com/itcl * * overhauled version author: Arnulf Wiedemann * | | | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | * AUTHOR: Michael J. McLennan * Bell Labs Innovations for Lucent Technologies * [email protected] * http://www.tcltk.com/itcl * * overhauled version author: Arnulf Wiedemann * * RCS: $Id: itclCmd.c,v 1.1.2.52 2009/10/22 15:09:50 wiede Exp $ * ======================================================================== * Copyright (c) 1993-1998 Lucent Technologies, Inc. * ------------------------------------------------------------------------ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "itclInt.h" |
︙ | ︙ | |||
220 221 222 223 224 225 226 | handledActiveNs = 0; while (Itcl_GetStackSize(&search) > 0) { nsPtr = Itcl_PopStack(&search); if (nsPtr == activeNs && handledActiveNs) { continue; } | | | 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | handledActiveNs = 0; while (Itcl_GetStackSize(&search) > 0) { nsPtr = Itcl_PopStack(&search); if (nsPtr == activeNs && handledActiveNs) { continue; } hPtr = Tcl_FirstHashEntry(Itcl_GetNamespaceCommandTable(nsPtr), &place); while (hPtr) { cmd = (Tcl_Command)Tcl_GetHashValue(hPtr); if (Itcl_IsClass(cmd)) { originalCmd = Tcl_GetOriginalCommand(cmd); /* |
︙ | ︙ | |||
271 272 273 274 275 276 277 | } handledActiveNs = 1; /* don't process the active namespace twice */ /* * Push any child namespaces onto the stack and continue * the search in those namespaces. */ | | | 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | } handledActiveNs = 1; /* don't process the active namespace twice */ /* * Push any child namespaces onto the stack and continue * the search in those namespaces. */ hPtr = Tcl_FirstHashEntry(Itcl_GetNamespaceChildTable(nsPtr), &place); while (hPtr != NULL) { Itcl_PushStack(Tcl_GetHashValue(hPtr), &search); hPtr = Tcl_NextHashEntry(&place); } } Tcl_DeleteHashTable(&unique); Itcl_DeleteStack(&search); |
︙ | ︙ | |||
402 403 404 405 406 407 408 | handledActiveNs = 0; while (Itcl_GetStackSize(&search) > 0) { nsPtr = Itcl_PopStack(&search); if (nsPtr == activeNs && handledActiveNs) { continue; } | | | 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 | handledActiveNs = 0; while (Itcl_GetStackSize(&search) > 0) { nsPtr = Itcl_PopStack(&search); if (nsPtr == activeNs && handledActiveNs) { continue; } entry = Tcl_FirstHashEntry(Itcl_GetNamespaceCommandTable(nsPtr), &place); while (entry) { cmd = (Tcl_Command)Tcl_GetHashValue(entry); if (Itcl_IsObject(cmd)) { originalCmd = Tcl_GetOriginalCommand(cmd); if (originalCmd) { cmd = originalCmd; } |
︙ | ︙ | |||
470 471 472 473 474 475 476 | } handledActiveNs = 1; /* don't process the active namespace twice */ /* * Push any child namespaces onto the stack and continue * the search in those namespaces. */ | | | 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 | } handledActiveNs = 1; /* don't process the active namespace twice */ /* * Push any child namespaces onto the stack and continue * the search in those namespaces. */ entry = Tcl_FirstHashEntry(Itcl_GetNamespaceChildTable(nsPtr), &place); while (entry != NULL) { Itcl_PushStack(Tcl_GetHashValue(entry), &search); entry = Tcl_NextHashEntry(&place); } } Tcl_DeleteHashTable(&unique); Itcl_DeleteStack(&search); |
︙ | ︙ |
Changes to generic/itclHelpers.c.
1 2 3 4 5 6 7 8 9 10 11 | /* * itclHelpers.c -- * * This file contains the C-implemeted part of * Itcl * * Copyright (c) 2007 by Arnulf P. Wiedemann * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | /* * itclHelpers.c -- * * This file contains the C-implemeted part of * Itcl * * Copyright (c) 2007 by Arnulf P. Wiedemann * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * * RCS: @(#) $Id: itclHelpers.c,v 1.1.2.16 2009/10/22 15:09:50 wiede Exp $ */ #include "itclInt.h" void ItclDeleteArgList(ItclArgList *arglistPtr); #ifdef ITCL_DEBUG int _itcl_debug_level = 0; |
︙ | ︙ | |||
359 360 361 362 363 364 365 | { int result; Tcl_Obj **newObjv; int isRootEnsemble; ItclShowArgs(2, functionName, objc, objv); newObjv = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj *)*(objc+1)); | | | | 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | { int result; Tcl_Obj **newObjv; int isRootEnsemble; ItclShowArgs(2, functionName, objc, objv); newObjv = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj *)*(objc+1)); isRootEnsemble = Itcl_InitRewriteEnsemble(interp, 1, 2, objc, objv); newObjv[0] = Tcl_NewStringObj("::info", -1); Tcl_IncrRefCount(newObjv[0]); newObjv[1] = Tcl_NewStringObj("itclinfo", -1); Tcl_IncrRefCount(newObjv[1]); if (objc > 1) { memcpy(newObjv+2, objv+1, sizeof(Tcl_Obj *) * (objc-1)); } result = Tcl_EvalObjv(interp, objc+1, newObjv, TCL_EVAL_INVOKE); Tcl_DecrRefCount(newObjv[0]); Tcl_DecrRefCount(newObjv[1]); ckfree((char *)newObjv); Itcl_ResetRewriteEnsemble(interp, isRootEnsemble); return result; } /* * ------------------------------------------------------------------------ * ItclTraceUnsetVar() |
︙ | ︙ |
Changes to generic/itclMigrate2TclCore.c.
1 2 3 4 5 6 7 8 9 10 11 | /* * ------------------------------------------------------------------------ * PACKAGE: [incr Tcl] * DESCRIPTION: Object-Oriented Extensions to Tcl * * This file contains procedures that belong in the Tcl/Tk core. * Hopefully, they'll migrate there soon. * * ======================================================================== * AUTHOR: Arnulf Wiedemann * | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | /* * ------------------------------------------------------------------------ * PACKAGE: [incr Tcl] * DESCRIPTION: Object-Oriented Extensions to Tcl * * This file contains procedures that belong in the Tcl/Tk core. * Hopefully, they'll migrate there soon. * * ======================================================================== * AUTHOR: Arnulf Wiedemann * * RCS: $Id: itclMigrate2TclCore.c,v 1.1.2.11 2009/10/22 15:09:50 wiede Exp $ * ======================================================================== * Copyright (c) 1993-1998 Lucent Technologies, Inc. * ------------------------------------------------------------------------ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include <tcl.h> |
︙ | ︙ | |||
32 33 34 35 36 37 38 | framePtr->resolvePtr = resolvePtr; #endif return TCL_OK; } return TCL_ERROR; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | framePtr->resolvePtr = resolvePtr; #endif return TCL_OK; } return TCL_ERROR; } int _Tcl_SetNamespaceResolver( Tcl_Namespace *nsPtr, Tcl_Resolve *resolvePtr) { if (nsPtr == NULL) { return TCL_ERROR; |
︙ | ︙ |
Changes to generic/itclMigrate2TclCore.h.
︙ | ︙ | |||
70 71 72 73 74 75 76 | #ifndef _TCL_PROC_DEFINED typedef struct Tcl_Proc_ *Tcl_Proc; #define _TCL_PROC_DEFINED 1 #endif typedef void (*Tcl_ProcErrorProc)(Tcl_Interp *interp, Tcl_Obj *procNameObj); | < < < < < < < < < < < < | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | #ifndef _TCL_PROC_DEFINED typedef struct Tcl_Proc_ *Tcl_Proc; #define _TCL_PROC_DEFINED 1 #endif typedef void (*Tcl_ProcErrorProc)(Tcl_Interp *interp, Tcl_Obj *procNameObj); #define Tcl_SetProcCmd _Tcl_SetProcCmd #define Tcl_InvokeNamespaceProc _Tcl_InvokeNamespaceProc extern int _Tcl_InvokeNamespaceProc(Tcl_Interp *interp, Tcl_Proc proc, Tcl_Namespace *nsPtr, Tcl_Obj *namePtr, int objc, Tcl_Obj *const *objv); extern Tcl_Var Tcl_NewNamespaceVar(Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *varName); extern int Itcl_IsCallFrameArgument(Tcl_Interp *interp, const char *name); |
Changes to generic/itclTclIntStubsFcn.c.
1 2 3 4 5 6 7 8 9 10 11 | /* * ------------------------------------------------------------------------ * PACKAGE: [incr Tcl] * DESCRIPTION: Object-Oriented Extensions to Tcl * * This file contains procedures that use the internal Tcl core stubs * entries. * * ======================================================================== * AUTHOR: Arnulf Wiedemann * | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | /* * ------------------------------------------------------------------------ * PACKAGE: [incr Tcl] * DESCRIPTION: Object-Oriented Extensions to Tcl * * This file contains procedures that use the internal Tcl core stubs * entries. * * ======================================================================== * AUTHOR: Arnulf Wiedemann * * RCS: $Id: itclTclIntStubsFcn.c,v 1.1.2.4 2009/10/22 15:09:51 wiede Exp $ * ------------------------------------------------------------------------ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include <tcl.h> #include <tclInt.h> #include "itclInt.h" |
︙ | ︙ | |||
102 103 104 105 106 107 108 109 | Tcl_Namespace * namespacePtr, Tcl_ResolveCmdProc * cmdProc, Tcl_ResolveVarProc * varProc, Tcl_ResolveCompiledVarProc * compiledVarProc) { Tcl_SetNamespaceResolvers(namespacePtr, cmdProc, varProc, compiledVarProc); } | > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | Tcl_Namespace * namespacePtr, Tcl_ResolveCmdProc * cmdProc, Tcl_ResolveVarProc * varProc, Tcl_ResolveCompiledVarProc * compiledVarProc) { Tcl_SetNamespaceResolvers(namespacePtr, cmdProc, varProc, compiledVarProc); } Tcl_HashTable * Itcl_GetNamespaceCommandTable( Tcl_Namespace *nsPtr) { return TclGetNamespaceCommandTable(nsPtr); } Tcl_HashTable * Itcl_GetNamespaceChildTable( Tcl_Namespace *nsPtr) { return TclGetNamespaceChildTable(nsPtr); } int Itcl_InitRewriteEnsemble( Tcl_Interp *interp, int numRemoved, int numInserted, int objc, Tcl_Obj *const *objv) { return TclInitRewriteEnsemble(interp, numRemoved, numInserted, objv); } void Itcl_ResetRewriteEnsemble( Tcl_Interp *interp, int isRootEnsemble) { return TclResetRewriteEnsemble(interp, isRootEnsemble); } |
Changes to generic/itclTclIntStubsFcn.h.
︙ | ︙ | |||
27 28 29 30 31 32 33 34 35 | Tcl_Proc *procPtrPtr); extern void _Tcl_ProcDeleteProc(ClientData clientData); extern void *_Tcl_GetObjInterpProc(void); extern int _Tcl_SetNamespaceResolver(Tcl_Namespace *nsPtr, struct Tcl_Resolve *resolvePtr); extern int Tcl_RenameCommand(Tcl_Interp *interp, const char *oldName, const char *newName); | > > > > > > | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | Tcl_Proc *procPtrPtr); extern void _Tcl_ProcDeleteProc(ClientData clientData); extern void *_Tcl_GetObjInterpProc(void); extern int _Tcl_SetNamespaceResolver(Tcl_Namespace *nsPtr, struct Tcl_Resolve *resolvePtr); extern int Tcl_RenameCommand(Tcl_Interp *interp, const char *oldName, const char *newName); extern Tcl_HashTable *Itcl_GetNamespaceChildTable(Tcl_Namespace *nsPtr); extern Tcl_HashTable *Itcl_GetNamespaceCommandTable(Tcl_Namespace *nsPtr); extern int Itcl_InitRewriteEnsemble(Tcl_Interp *interp, int numRemoved, int numInserted, int objc, Tcl_Obj *const *objv); extern void Itcl_ResetRewriteEnsemble(Tcl_Interp *interp, int isRootEnsemble); |