Index: Makefile.in =================================================================== diff -u -rb34996b24ea334963e83aadda66384680a6f8ce5 -rd29a51c38be834fe558f1c85069d8bc500d201d9 --- Makefile.in (.../Makefile.in) (revision b34996b24ea334963e83aadda66384680a6f8ce5) +++ Makefile.in (.../Makefile.in) (revision d29a51c38be834fe558f1c85069d8bc500d201d9) @@ -676,6 +676,7 @@ nsfObj.$(OBJEXT): $(src_generic_dir)/nsfObj.c $(PKG_HEADERS) nsfObjectData.$(OBJEXT): $(src_generic_dir)/nsfObjectData.c $(PKG_HEADERS) nsfPointer.$(OBJEXT): $(src_generic_dir)/nsfPointer.c $(PKG_HEADERS) +nsfEnumerationType.$(OBJEXT): $(src_generic_dir)/nsfEnumerationType.c $(PKG_HEADERS) nsfProfile.$(OBJEXT): $(src_generic_dir)/nsfProfile.c $(PKG_HEADERS) nsfShadow.$(OBJEXT): $(src_generic_dir)/nsfShadow.c $(PKG_HEADERS) nsfStubInit.$(OBJEXT): $(PKG_HEADERS) Index: TODO =================================================================== diff -u -rb34996b24ea334963e83aadda66384680a6f8ce5 -rd29a51c38be834fe558f1c85069d8bc500d201d9 --- TODO (.../TODO) (revision b34996b24ea334963e83aadda66384680a6f8ce5) +++ TODO (.../TODO) (revision d29a51c38be834fe558f1c85069d8bc500d201d9) @@ -4969,15 +4969,21 @@ * Does not load binary files (problem for cross compiling) * Requires package provide with constant in one line. +small introspection reform: +- Introspection for commands and arguments did not work for + cmds defined in subpackages (such as mongodb). We keep + now this information in hashtables and maintain a slim + interface for this. +- fix generation of pkgIndex.tcl for mongodb ======================================================================== TODO: +- test cases switch now to global dir. maybe due to new tcl.m4. See e.g.: + notice: Running test cases: /usr/local/ns/lib/nsf2.0b6/lib/nx-test.tcl - remove / rephrase "//"-comments -- ParamGetDomain(Nsf_Param CONST *paramPtr) does not work - for enumeration types defined in derived packages, having - their own constants + - check deactivated tests in tests/serialize.test C(One), C(IgnoreAll), C(None2) and xlloc fix Index: configure =================================================================== diff -u -re5837b2b6a65987c826cba577fc4cab810881375 -rd29a51c38be834fe558f1c85069d8bc500d201d9 --- configure (.../configure) (revision e5837b2b6a65987c826cba577fc4cab810881375) +++ configure (.../configure) (revision d29a51c38be834fe558f1c85069d8bc500d201d9) @@ -5551,8 +5551,8 @@ vars="nsf.c nsfError.c nsfObjectData.c nsfProfile.c \ - nsfDebug.c nsfUtil.c nsfObj.c nsfPointer.c \ - nsfShadow.c nsfCompile.c aolstub.c nsfStubInit.c" + nsfDebug.c nsfUtil.c nsfObj.c nsfPointer.c nsfEnumerationType.c \ + nsfCmdDefinitions.c nsfShadow.c nsfCompile.c aolstub.c nsfStubInit.c" for i in $vars; do case $i in \$*) Index: configure.ac =================================================================== diff -u -re5837b2b6a65987c826cba577fc4cab810881375 -rd29a51c38be834fe558f1c85069d8bc500d201d9 --- configure.ac (.../configure.ac) (revision e5837b2b6a65987c826cba577fc4cab810881375) +++ configure.ac (.../configure.ac) (revision d29a51c38be834fe558f1c85069d8bc500d201d9) @@ -220,8 +220,8 @@ #----------------------------------------------------------------------- TEA_ADD_SOURCES([nsf.c nsfError.c nsfObjectData.c nsfProfile.c \ - nsfDebug.c nsfUtil.c nsfObj.c nsfPointer.c \ - nsfShadow.c nsfCompile.c aolstub.c nsfStubInit.c]) + nsfDebug.c nsfUtil.c nsfObj.c nsfPointer.c nsfEnumerationType.c \ + nsfCmdDefinitions.c nsfShadow.c nsfCompile.c aolstub.c nsfStubInit.c]) TEA_ADD_HEADERS([generic/nsf.h generic/nsfInt.h generic/nsfDecls.h generic/nsfIntDecls.h]) TEA_ADD_INCLUDES([]) TEA_ADD_LIBS([]) Index: generic/nsf.c =================================================================== diff -u -ra6e6626742e484bf5d7d8052689760bb713c8693 -rd29a51c38be834fe558f1c85069d8bc500d201d9 --- generic/nsf.c (.../nsf.c) (revision a6e6626742e484bf5d7d8052689760bb713c8693) +++ generic/nsf.c (.../nsf.c) (revision d29a51c38be834fe558f1c85069d8bc500d201d9) @@ -9611,13 +9611,7 @@ assert(paramPtr); if ((paramPtr->flags & NSF_ARG_IS_ENUMERATION)) { - Nsf_EnumeratorConverterEntry *ePtr; - for (ePtr = &enumeratorConverterEntries[0]; ePtr->converter; ePtr++) { - if (ePtr->converter == paramPtr->converter) { - result = ePtr->domain; - break; - } - } + return Nsf_EnumerationTypeGetDomain(paramPtr->converter); } else { result = ParamGetType(paramPtr); } @@ -18133,24 +18127,17 @@ { /* - * If a command is found for the object|class, check whether we + * If a command is not found for the object|class, check whether we * find the parameter definitions for the C-defined method. */ - Nsf_methodDefinition *mdPtr = &method_definitions[0]; - - for (; mdPtr->methodName; mdPtr ++) { - - /*fprintf(stderr, "... comparing %p with %p => %s\n", ((Command *)cmd)->objProc, mdPtr->proc, - mdPtr->methodName);*/ - - if (((Command *)cmd)->objProc == mdPtr->proc) { + Nsf_methodDefinition *mdPtr = Nsf_CmdDefinitionGet(((Command *)cmd)->objProc); + if (mdPtr != NULL) { NsfParamDefs paramDefs = {mdPtr->paramDefs, mdPtr->nrParameters, 1, 0, NULL, NULL}; Tcl_Obj *list = ListParamDefs(interp, paramDefs.paramsPtr, printStyle); Tcl_SetObjResult(interp, list); DECR_REF_COUNT2("paramDefsObj", list); return TCL_OK; - } } } @@ -25900,9 +25887,18 @@ /* - * Initialize the pointer converter. + * Initialize the pointer converter, the enumeration types and cmd + * definitions tables and load it with the generated information for + * introspection. */ Nsf_PointerInit(interp); + + Nsf_EnumerationTypeInit(interp); + Nsf_EnumerationTypeRegister(interp, enumeratorConverterEntries); + + Nsf_CmdDefinitionInit(interp); + Nsf_CmdDefinitionRegister(interp, method_definitions); + /* fprintf(stderr, "SIZES: obj=%d, tcl_obj=%d, DString=%d, class=%d, namespace=%d, command=%d, HashTable=%d\n", sizeof(NsfObject), sizeof(Tcl_Obj), sizeof(Tcl_DString), sizeof(NsfClass), @@ -26027,15 +26023,16 @@ rst->colonCmd = Tcl_FindCommand(interp, "::nsf::colon", NULL, TCL_GLOBAL_ONLY); /* - * SS: Tcl occasionally resolves a proc's cmd structure (e.g., in + * Tcl occasionally resolves a proc's cmd structure (e.g., in * [info frame /number/] or TclInfoFrame()) without * verification. However, NSF non-proc frames, in particular * initcmd blocks, point to the fakeProc structure which does not - * come with an initialized Command pointer. For now, we default to - * an internal command. However, we need to revisit this decision + * contain a initialized Command pointer. For now, we default to + * an internal command. However, we might have to revisit this decision * as non-proc frames (e.g., initcmds) report a "proc" entry - * indicating "::nsf::colon" (which is sufficiently misleading and - * reveals internals not to be revealed ...). + * for c-based functions with a proc scope, such as "::nsf::colon"), + * which can lead to confusions. "proc" does not mean "tcp proc", + * but an entry with a proc frame for local vars. */ rst->fakeProc.cmdPtr = (Command *)RUNTIME_STATE(interp)->colonCmd; Index: generic/nsf.decls =================================================================== diff -u -r68b3924a7a90d28e2e11f9b9b8244a85da708073 -rd29a51c38be834fe558f1c85069d8bc500d201d9 --- generic/nsf.decls (.../nsf.decls) (revision 68b3924a7a90d28e2e11f9b9b8244a85da708073) +++ generic/nsf.decls (.../nsf.decls) (revision d29a51c38be834fe558f1c85069d8bc500d201d9) @@ -161,4 +161,10 @@ declare 37 generic { int Nsf_ConvertToTclobj(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) -} \ No newline at end of file +} +declare 38 generic { + int Nsf_EnumerationTypeRegister(Tcl_Interp *interp, Nsf_EnumeratorConverterEntry *typeRecords) +} +declare 39 generic { + int Nsf_CmdDefinitionRegister(Tcl_Interp *interp, Nsf_methodDefinition *definitionRecords) +} Index: generic/nsf.h =================================================================== diff -u -r4bc60e16c10fdbbb640b3019d4bdebdc469fdf55 -rd29a51c38be834fe558f1c85069d8bc500d201d9 --- generic/nsf.h (.../nsf.h) (revision 4bc60e16c10fdbbb640b3019d4bdebdc469fdf55) +++ generic/nsf.h (.../nsf.h) (revision d29a51c38be834fe558f1c85069d8bc500d201d9) @@ -403,8 +403,18 @@ Nsf_Param paramDefs[12]; } Nsf_methodDefinition; +/* + * Nsf Enumeration type interface + */ +EXTERN int Nsf_EnumerationTypeRegister(Tcl_Interp *interp, Nsf_EnumeratorConverterEntry *typeRecords); /* + * Nsf Cmd definition interface + */ +EXTERN int Nsf_CmdDefinitionRegister(Tcl_Interp *interp, Nsf_methodDefinition *definitionRecords); + + +/* * Include the public function declarations that are accessible via * the stubs table. */ Index: generic/nsfCmdDefinitions.c =================================================================== diff -u --- generic/nsfCmdDefinitions.c (revision 0) +++ generic/nsfCmdDefinitions.c (revision d29a51c38be834fe558f1c85069d8bc500d201d9) @@ -0,0 +1,155 @@ +/* + * nsfCmdDefinitions.c -- + * + * Provide API for registering method definitions + * and obtaining this data for introspection + * + * Copyright (C) 2014 Gustaf Neumann + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "nsfInt.h" + +static Tcl_HashTable cmdDefinitonHashTable, *cmdDefinitonHashTablePtr = &cmdDefinitonHashTable; +static int cmdDefinitonRefCount = 0; +static NsfMutex cmdDefinitonMutex = 0; + +static int Register(Tcl_Interp *interp, Nsf_methodDefinition *methodDefinition); + +/* + *---------------------------------------------------------------------- + * Nsf_CmdDefinitionInit -- + * + * Initialize cmd definition structures + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ +void +Nsf_CmdDefinitionInit(Tcl_Interp *interp) { + + NsfMutexLock(&cmdDefinitonMutex); + + if (cmdDefinitonRefCount == 0) { + Tcl_InitHashTable(cmdDefinitonHashTablePtr, TCL_ONE_WORD_KEYS); + } + cmdDefinitonRefCount++; + + NsfMutexUnlock(&cmdDefinitonMutex); +} + +/* + *---------------------------------------------------------------------- + * Nsf_CmdDefinitionRegister -- + * + * Register an array of cmd definitons + * + * Results: + * TCL_OK + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ +int +Nsf_CmdDefinitionRegister(Tcl_Interp *interp, Nsf_methodDefinition *definitionRecords) { + Nsf_methodDefinition *ePtr; + + for (ePtr = definitionRecords; ePtr->methodName; ePtr++) { + Register(interp, ePtr); + } + + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * Nsf_CmdDefinitionGet -- + * + * Obtain the definiton for a registered proc + * + * Results: + * method definition or NULL + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ +Nsf_methodDefinition * +Nsf_CmdDefinitionGet(Tcl_ObjCmdProc *proc) { + Tcl_HashEntry *hPtr; + + NsfMutexLock(&cmdDefinitonMutex); + hPtr = Tcl_FindHashEntry(cmdDefinitonHashTablePtr, (char *)proc); + NsfMutexUnlock(&cmdDefinitonMutex); + + if (hPtr != NULL) { + return Tcl_GetHashValue(hPtr); + } + + return NULL; +} + +/* + *---------------------------------------------------------------------- + * Register -- + * + * Register a method Definition + * + * Results: + * Tcl result code. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ +static int +Register(Tcl_Interp *interp, Nsf_methodDefinition *methodDefinition) { + Tcl_HashEntry *hPtr; + int isNew; + + NsfMutexLock(&cmdDefinitonMutex); + hPtr = Tcl_CreateHashEntry(cmdDefinitonHashTablePtr, (char *)methodDefinition->proc, &isNew); + NsfMutexUnlock(&cmdDefinitonMutex); + + if (isNew) { + Tcl_SetHashValue(hPtr, methodDefinition); + return TCL_OK; + } else { + return NsfPrintError(interp, "proc %s is already registered", methodDefinition->methodName); + } +} + + +/* + * Local Variables: + * mode: c + * c-basic-offset: 2 + * fill-column: 72 + * End: + */ Index: generic/nsfDecls.h =================================================================== diff -u -r3b729f5cc12d1a497d53e71629c305034745274b -rd29a51c38be834fe558f1c85069d8bc500d201d9 --- generic/nsfDecls.h (.../nsfDecls.h) (revision 3b729f5cc12d1a497d53e71629c305034745274b) +++ generic/nsfDecls.h (.../nsfDecls.h) (revision d29a51c38be834fe558f1c85069d8bc500d201d9) @@ -268,6 +268,18 @@ Tcl_Obj *objPtr, Nsf_Param CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr); #endif +#ifndef Nsf_EnumerationTypeRegister_TCL_DECLARED +#define Nsf_EnumerationTypeRegister_TCL_DECLARED +/* 38 */ +EXTERN int Nsf_EnumerationTypeRegister(Tcl_Interp *interp, + Nsf_EnumeratorConverterEntry *typeRecords); +#endif +#ifndef Nsf_CmdDefinitionRegister_TCL_DECLARED +#define Nsf_CmdDefinitionRegister_TCL_DECLARED +/* 39 */ +EXTERN int Nsf_CmdDefinitionRegister(Tcl_Interp *interp, + Nsf_methodDefinition *definitionRecords); +#endif typedef struct NsfStubHooks { struct NsfIntStubs *nsfIntStubs; @@ -315,6 +327,8 @@ int (*nsf_ConvertToPointer) (Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr); /* 35 */ int (*nsf_ConvertToString) (Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr); /* 36 */ int (*nsf_ConvertToTclobj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr); /* 37 */ + int (*nsf_EnumerationTypeRegister) (Tcl_Interp *interp, Nsf_EnumeratorConverterEntry *typeRecords); /* 38 */ + int (*nsf_CmdDefinitionRegister) (Tcl_Interp *interp, Nsf_methodDefinition *definitionRecords); /* 39 */ } NsfStubs; #ifdef __cplusplus @@ -480,6 +494,14 @@ #define Nsf_ConvertToTclobj \ (nsfStubsPtr->nsf_ConvertToTclobj) /* 37 */ #endif +#ifndef Nsf_EnumerationTypeRegister +#define Nsf_EnumerationTypeRegister \ + (nsfStubsPtr->nsf_EnumerationTypeRegister) /* 38 */ +#endif +#ifndef Nsf_CmdDefinitionRegister +#define Nsf_CmdDefinitionRegister \ + (nsfStubsPtr->nsf_CmdDefinitionRegister) /* 39 */ +#endif #endif /* defined(USE_NSF_STUBS) && !defined(USE_NSF_STUB_PROCS) */ Index: generic/nsfEnumerationType.c =================================================================== diff -u --- generic/nsfEnumerationType.c (revision 0) +++ generic/nsfEnumerationType.c (revision d29a51c38be834fe558f1c85069d8bc500d201d9) @@ -0,0 +1,161 @@ +/* + * nsfEnumerationType.c -- + * + * Provide API for registering enumeration types + * and obtaining their domain. + * + * Copyright (C) 2014 Gustaf Neumann + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "nsfInt.h" + +static Tcl_HashTable enumerationHashTable, *enumerationHashTablePtr = &enumerationHashTable; +static int enumerationTypeRefCount = 0; +static NsfMutex enumerationMutex = 0; + +static int Register(Tcl_Interp *interp, CONST char* domain, Nsf_TypeConverter *converter); + +/* + *---------------------------------------------------------------------- + * Nsf_EnumerationTypeInit -- + * + * Initialize enumeration type converters + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ +void +Nsf_EnumerationTypeInit(Tcl_Interp *interp) { + + NsfMutexLock(&enumerationMutex); + + if (enumerationTypeRefCount == 0) { + Tcl_InitHashTable(enumerationHashTablePtr, TCL_STRING_KEYS); + } + enumerationTypeRefCount++; + + NsfMutexUnlock(&enumerationMutex); +} + +/* + *---------------------------------------------------------------------- + * Nsf_EnumerationTypeRegister -- + * + * Register an array of enumeration types + * + * Results: + * TCL_OK + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ +int +Nsf_EnumerationTypeRegister(Tcl_Interp *interp, Nsf_EnumeratorConverterEntry *typeRecords) { + Nsf_EnumeratorConverterEntry *ePtr; + + for (ePtr = typeRecords; ePtr->converter; ePtr++) { + Register(interp, ePtr->domain, ePtr->converter); + } + + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * Nsf_EnumerationTypeGetDomain -- + * + * Obtain the domain from an enumeration type converter + * + * Results: + * domain as a string or NULL, if not successful + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ +CONST char * +Nsf_EnumerationTypeGetDomain(Nsf_TypeConverter *converter) { + Tcl_HashEntry *hPtr; + Tcl_HashSearch hSrch; + CONST char* domain = NULL; + + NsfMutexLock(&enumerationMutex); + + for (hPtr = Tcl_FirstHashEntry(enumerationHashTablePtr, &hSrch); hPtr != NULL; + hPtr = Tcl_NextHashEntry(&hSrch)) { + void *ptr = Tcl_GetHashValue(hPtr); + if (ptr == converter) { + domain = Tcl_GetHashKey(enumerationHashTablePtr, hPtr); + break; + } + } + NsfMutexUnlock(&enumerationMutex); + + return domain; +} + +/* + *---------------------------------------------------------------------- + * Register -- + * + * Register a enumeration type converter and its domain. + * + * Results: + * Tcl result code. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ +static int +Register(Tcl_Interp *interp, CONST char* domain, Nsf_TypeConverter *converter) { + Tcl_HashEntry *hPtr; + int isNew; + + NsfMutexLock(&enumerationMutex); + hPtr = Tcl_CreateHashEntry(enumerationHashTablePtr, domain, &isNew); + NsfMutexUnlock(&enumerationMutex); + + if (isNew) { + Tcl_SetHashValue(hPtr, converter); + return TCL_OK; + } else { + return NsfPrintError(interp, "type converter %s is already registered", domain); + } +} + + +/* + * Local Variables: + * mode: c + * c-basic-offset: 2 + * fill-column: 72 + * End: + */ Index: generic/nsfInt.h =================================================================== diff -u -ra6e6626742e484bf5d7d8052689760bb713c8693 -rd29a51c38be834fe558f1c85069d8bc500d201d9 --- generic/nsfInt.h (.../nsfInt.h) (revision a6e6626742e484bf5d7d8052689760bb713c8693) +++ generic/nsfInt.h (.../nsfInt.h) (revision d29a51c38be834fe558f1c85069d8bc500d201d9) @@ -1026,6 +1026,19 @@ void NsfStringIncrInit(NsfStringIncrStruct *iss); void NsfStringIncrFree(NsfStringIncrStruct *iss); +/* + * Nsf Enumeration type interface + */ +EXTERN void Nsf_EnumerationTypeInit(Tcl_Interp *interp); +EXTERN CONST char *Nsf_EnumerationTypeGetDomain(Nsf_TypeConverter *converter); + +/* + * Nsf Cmd definition interface + */ +EXTERN void Nsf_CmdDefinitionInit(Tcl_Interp *interp); +EXTERN Nsf_methodDefinition *Nsf_CmdDefinitionGet(Tcl_ObjCmdProc *proc); + + #ifndef HAVE_STRNSTR char *strnstr(const char *buffer, const char *needle, size_t buffer_len); #endif Index: generic/nsfStubInit.c =================================================================== diff -u -rbb72efa672030199bfaecff1cc829dfd802a28d8 -rd29a51c38be834fe558f1c85069d8bc500d201d9 --- generic/nsfStubInit.c (.../nsfStubInit.c) (revision bb72efa672030199bfaecff1cc829dfd802a28d8) +++ generic/nsfStubInit.c (.../nsfStubInit.c) (revision d29a51c38be834fe558f1c85069d8bc500d201d9) @@ -84,6 +84,8 @@ Nsf_ConvertToPointer, /* 35 */ Nsf_ConvertToString, /* 36 */ Nsf_ConvertToTclobj, /* 37 */ + Nsf_EnumerationTypeRegister, /* 38 */ + Nsf_CmdDefinitionRegister, /* 39 */ }; /* !END!: Do not edit above this line. */ Index: library/mongodb/nsfmongo.c =================================================================== diff -u -reeaf88c46b41702c991aa51c008ffee74e318758 -rd29a51c38be834fe558f1c85069d8bc500d201d9 --- library/mongodb/nsfmongo.c (.../nsfmongo.c) (revision eeaf88c46b41702c991aa51c008ffee74e318758) +++ library/mongodb/nsfmongo.c (.../nsfmongo.c) (revision d29a51c38be834fe558f1c85069d8bc500d201d9) @@ -1671,6 +1671,9 @@ } NsfMutexUnlock(&initMutex); + Nsf_EnumerationTypeRegister(interp, enumeratorConverterEntries); + Nsf_CmdDefinitionRegister(interp, method_definitions); + /* * register the pointer converter */ Index: library/mongodb/pkgIndex.add.in =================================================================== diff -u -rb34996b24ea334963e83aadda66384680a6f8ce5 -rd29a51c38be834fe558f1c85069d8bc500d201d9 --- library/mongodb/pkgIndex.add.in (.../pkgIndex.add.in) (revision b34996b24ea334963e83aadda66384680a6f8ce5) +++ library/mongodb/pkgIndex.add.in (.../pkgIndex.add.in) (revision d29a51c38be834fe558f1c85069d8bc500d201d9) @@ -1 +1 @@ -package ifneeded nsf @PACKAGE_VERSION@ [list load [file join $dir @PKG_LIB_FILE@] nsf] +package ifneeded nsf::mongo @PACKAGE_VERSION@ [list load [file join $dir @PKG_LIB_FILE@]]