diff options
Diffstat (limited to 'generic/tclCompile.h')
-rw-r--r-- | generic/tclCompile.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/generic/tclCompile.h b/generic/tclCompile.h index a50409b..ae4c39c 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCompile.h,v 1.52 2004/12/10 13:09:14 msofer Exp $ + * RCS: @(#) $Id: tclCompile.h,v 1.53 2004/12/24 18:06:58 msofer Exp $ */ #ifndef _TCLCOMPILATION @@ -842,7 +842,7 @@ MODULE_SCOPE void TclPrintSource _ANSI_ARGS_((FILE *outFile, CONST char *string, int maxChars)); MODULE_SCOPE void TclRegisterAuxDataType _ANSI_ARGS_((AuxDataType *typePtr)); MODULE_SCOPE int TclRegisterLiteral _ANSI_ARGS_((CompileEnv *envPtr, - char *bytes, int length, int onHeap)); + char *bytes, int length, int flags)); MODULE_SCOPE void TclReleaseLiteral _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr)); MODULE_SCOPE void TclSetCmdNameObj _ANSI_ARGS_((Tcl_Interp *interp, @@ -860,11 +860,13 @@ MODULE_SCOPE int TclWordKnownAtCompileTime _ANSI_ARGS_(( /* *---------------------------------------------------------------- - * Macros used by Tcl bytecode compilation and execution modules - * inside the Tcl core but not used outside. + * Macros and flag values used by Tcl bytecode compilation and execution + * modules inside the Tcl core but not used outside. *---------------------------------------------------------------- */ +#define LITERAL_ON_HEAP 0x01 +#define LITERAL_NS_SCOPE 0x02 /* * Form of TclRegisterLiteral with onHeap == 0. * In that case, it is safe to cast away CONSTness, and it @@ -872,7 +874,19 @@ MODULE_SCOPE int TclWordKnownAtCompileTime _ANSI_ARGS_(( */ #define TclRegisterNewLiteral(envPtr, bytes, length) \ - TclRegisterLiteral(envPtr, (char *)(bytes), length, /*onHeap*/ 0) + TclRegisterLiteral(envPtr, (char *)(bytes), length, \ + /*flags*/ 0) + +/* + * Form of TclRegisterNSLiteral with onHeap == 0. + * In that case, it is safe to cast away CONSTness, and it + * is cleanest to do that here, all in one place. + */ + +#define TclRegisterNewNSLiteral(envPtr, bytes, length) \ + TclRegisterLiteral(envPtr, (char *)(bytes), length, \ + /*flags*/ LITERAL_NS_SCOPE) + /* * Macro used to manually adjust the stack requirements; used |