Index: generic/tcl.h ================================================================== --- generic/tcl.h +++ generic/tcl.h @@ -2398,10 +2398,16 @@ const char *version, int exact); EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr); #ifndef _WIN32 EXTERN int TclZipfs_AppHook(int *argc, char ***argv); #endif + +/* + * Public function Tcl_CreateInterpWithStubs (TIP #531), not accessed via stubs table. + */ +Tcl_Interp * Tcl_CreateInterpWithStubs(const char *version, int exact); + /* *---------------------------------------------------------------------------- * Include the public function declarations that are accessible via the stubs * table. ADDED generic/tclCreateInterpWithStubs.c Index: generic/tclCreateInterpWithStubs.c ================================================================== --- /dev/null +++ generic/tclCreateInterpWithStubs.c @@ -0,0 +1,15 @@ +/* must be compiled without stubs */ +#undef USE_TCL_STUBS +#include + +Tcl_Interp * Tcl_CreateInterpWithStubs(const char *version, int exact) +{ + Tcl_Interp *interp = Tcl_CreateInterp(); + + if (Tcl_Init(interp) == TCL_ERROR + || Tcl_InitStubs(interp, version, exact) == NULL + || Tcl_PkgRequire(interp, "Tcl", version, exact) == NULL) { + return NULL; + } + return interp; +} Index: unix/Makefile.in ================================================================== --- unix/Makefile.in +++ unix/Makefile.in @@ -344,10 +344,11 @@ bn_s_mp_mul_digs.o bn_s_mp_sqr.o bn_s_mp_sub.o STUB_LIB_OBJS = tclStubLib.o \ tclTomMathStubLib.o \ tclOOStubLib.o \ + tclCreateInterpWithStubs.o \ ${COMPAT_OBJS} UNIX_OBJS = tclUnixChan.o tclUnixEvent.o tclUnixFCmd.o \ tclUnixFile.o tclUnixPipe.o tclUnixSock.o \ tclUnixTime.o tclUnixInit.o tclUnixThrd.o \ @@ -484,10 +485,11 @@ $(GENERIC_DIR)/tclOOMethod.c \ $(GENERIC_DIR)/tclOOStubInit.c STUB_SRCS = \ $(GENERIC_DIR)/tclStubLib.c \ + $(GENERIC_DIR)/tclCreateInterpWithStubs.c \ $(GENERIC_DIR)/tclTomMathStubLib.c \ $(GENERIC_DIR)/tclOOStubLib.c TOMMATH_SRCS = \ $(TOMMATH_DIR)/bn_reverse.c \ @@ -1830,10 +1832,13 @@ #-------------------------------------------------------------------------- tclStubLib.o: $(GENERIC_DIR)/tclStubLib.c $(CC) -c $(STUB_CC_SWITCHES) -DSTATIC_BUILD $(GENERIC_DIR)/tclStubLib.c +tclCreateInterpWithStubs.o: $(GENERIC_DIR)/tclCreateInterpWithStubs.c + $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclCreateInterpWithStubs.c + tclTomMathStubLib.o: $(GENERIC_DIR)/tclTomMathStubLib.c $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclTomMathStubLib.c tclOOStubLib.o: $(GENERIC_DIR)/tclOOStubLib.c $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclOOStubLib.c