diff options
author | stanton <stanton> | 1999-03-06 21:19:56 (GMT) |
---|---|---|
committer | stanton <stanton> | 1999-03-06 21:19:56 (GMT) |
commit | c86147049b676ad5d61899e0ab3462cd6827da7c (patch) | |
tree | 69808205479bb89b8ff8ba7cb5c50d764d4bae55 | |
parent | f3c491e201ddaf803144e2caadf7d605716b8ac2 (diff) | |
download | tcl-c86147049b676ad5d61899e0ab3462cd6827da7c.zip tcl-c86147049b676ad5d61899e0ab3462cd6827da7c.tar.gz tcl-c86147049b676ad5d61899e0ab3462cd6827da7c.tar.bz2 |
* unix/Makefile.in:
* generic/tcl.decls:
* generic/tclCompile.h:
* generic/tclCompileDecls.h:
* generic/tclCompileStubs.c:
* generic/tclDecls.h:
* generic/tclInt.decls:
* generic/tclInt.h:
* generic/tclStubInit.c: Removed tclCompile.h functions. Moved
TclGetAuxDataType to tclInt.h so it is available for use by
the TclPro Byte Compiler loader.
-rw-r--r-- | generic/tcl.decls | 5 | ||||
-rw-r--r-- | generic/tclCompile.h | 107 | ||||
-rw-r--r-- | generic/tclCompileDecls.h | 265 | ||||
-rw-r--r-- | generic/tclCompileStubs.c | 278 | ||||
-rw-r--r-- | generic/tclDecls.h | 3 | ||||
-rw-r--r-- | generic/tclInt.decls | 101 | ||||
-rw-r--r-- | generic/tclInt.h | 67 | ||||
-rw-r--r-- | generic/tclStubInit.c | 39 | ||||
-rw-r--r-- | unix/Makefile.in | 16 |
9 files changed, 126 insertions, 755 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls index 95edda0..0af3204 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: tcl.decls,v 1.2.2.1 1999/03/05 20:18:02 stanton Exp $ +# RCS: @(#) $Id: tcl.decls,v 1.2.2.2 1999/03/06 21:19:56 stanton Exp $ library tcl @@ -18,10 +18,9 @@ library tcl # tclPlat - platform specific public # tclInt - generic private # tclPlatInt - platform specific private -# tclCompile - private compiler/execution module fucntions interface tcl -hooks {tclPlat tclInt tclIntPlat tclCompile} +hooks {tclPlat tclInt tclIntPlat} # Declare each of the functions in the public Tcl interface. Note that # the an index should never be reused for a different function in order diff --git a/generic/tclCompile.h b/generic/tclCompile.h index 23eb072..74409b0 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -6,7 +6,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.8.4.1 1999/03/05 20:18:03 stanton Exp $ + * RCS: @(#) $Id: tclCompile.h,v 1.8.4.2 1999/03/06 21:19:56 stanton Exp $ */ #ifndef _TCLCOMPILATION @@ -152,58 +152,6 @@ typedef struct CmdLocation { } CmdLocation; /* - * CompileProcs need the ability to record information during compilation - * that can be used by bytecode instructions during execution. The AuxData - * structure provides this "auxiliary data" mechanism. An arbitrary number - * of these structures can be stored in the ByteCode record (during - * compilation they are stored in a CompileEnv structure). Each AuxData - * record holds one word of client-specified data (often a pointer) and is - * given an index that instructions can later use to look up the structure - * and its data. - * - * The following definitions declare the types of procedures that are called - * to duplicate or free this auxiliary data when the containing ByteCode - * objects are duplicated and freed. Pointers to these procedures are kept - * in the AuxData structure. - */ - -typedef ClientData (AuxDataDupProc) _ANSI_ARGS_((ClientData clientData)); -typedef void (AuxDataFreeProc) _ANSI_ARGS_((ClientData clientData)); - -/* - * We define a separate AuxDataType struct to hold type-related information - * for the AuxData structure. This separation makes it possible for clients - * outside of the TCL core to manipulate (in a limited fashion!) AuxData; - * for example, it makes it possible to pickle and unpickle AuxData structs. - */ - -typedef struct AuxDataType { - char *name; /* the name of the type. Types can be - * registered and found by name */ - AuxDataDupProc *dupProc; /* Callback procedure to invoke when the - * aux data is duplicated (e.g., when the - * ByteCode structure containing the aux - * data is duplicated). NULL means just - * copy the source clientData bits; no - * proc need be called. */ - AuxDataFreeProc *freeProc; /* Callback procedure to invoke when the - * aux data is freed. NULL means no - * proc need be called. */ -} AuxDataType; - -/* - * The definition of the AuxData structure that holds information created - * during compilation by CompileProcs and used by instructions during - * execution. - */ - -typedef struct AuxData { - AuxDataType *type; /* pointer to the AuxData type associated with - * this ClientData. */ - ClientData clientData; /* The compilation data itself. */ -} AuxData; - -/* * Structure defining the compilation environment. After compilation, fields * describing bytecode instructions are copied out into the more compact * ByteCode structure defined below. @@ -771,11 +719,60 @@ typedef struct ResolvedCmdName { *---------------------------------------------------------------- */ +EXTERN void TclCleanupByteCode _ANSI_ARGS_((ByteCode *codePtr)); +EXTERN int TclCompileExpr _ANSI_ARGS_((Tcl_Interp *interp, + char *string, char *lastChar, int flags, + CompileEnv *envPtr)); +EXTERN int TclCompileQuotes _ANSI_ARGS_((Tcl_Interp *interp, + char *string, char *lastChar, int termChar, + int flags, CompileEnv *envPtr)); +EXTERN int TclCompileString _ANSI_ARGS_((Tcl_Interp *interp, + char *string, char *lastChar, int flags, + CompileEnv *envPtr)); +EXTERN int TclCompileDollarVar _ANSI_ARGS_((Tcl_Interp *interp, + char *string, char *lastChar, int flags, + CompileEnv *envPtr)); +EXTERN int TclCreateAuxData _ANSI_ARGS_((ClientData clientData, + AuxDataType *typePtr, CompileEnv *envPtr)); +EXTERN ExecEnv * TclCreateExecEnv _ANSI_ARGS_((Tcl_Interp *interp)); +EXTERN void TclDeleteExecEnv _ANSI_ARGS_((ExecEnv *eePtr)); +EXTERN void TclEmitForwardJump _ANSI_ARGS_((CompileEnv *envPtr, + TclJumpType jumpType, JumpFixup *jumpFixupPtr)); +EXTERN ExceptionRange * TclGetExceptionRangeForPc _ANSI_ARGS_(( + unsigned char *pc, int catchOnly, + ByteCode* codePtr)); +EXTERN InstructionDesc * TclGetInstructionTable _ANSI_ARGS_(()); +EXTERN int TclExecuteByteCode _ANSI_ARGS_((Tcl_Interp *interp, + ByteCode *codePtr)); +EXTERN void TclExpandCodeArray _ANSI_ARGS_(( + CompileEnv *envPtr)); +EXTERN void TclExpandJumpFixupArray _ANSI_ARGS_(( + JumpFixupArray *fixupArrayPtr)); +EXTERN void TclFinalizeAuxDataTypeTable _ANSI_ARGS_((void)); +EXTERN int TclFixupForwardJump _ANSI_ARGS_(( + CompileEnv *envPtr, JumpFixup *jumpFixupPtr, + int jumpDist, int distThreshold)); +EXTERN void TclFreeCompileEnv _ANSI_ARGS_((CompileEnv *envPtr)); +EXTERN void TclFreeJumpFixupArray _ANSI_ARGS_(( + JumpFixupArray *fixupArrayPtr)); +EXTERN void TclInitAuxDataTypeTable _ANSI_ARGS_((void)); +EXTERN void TclInitByteCodeObj _ANSI_ARGS_((Tcl_Obj *objPtr, + CompileEnv *envPtr)); +EXTERN void TclInitCompileEnv _ANSI_ARGS_((Tcl_Interp *interp, + CompileEnv *envPtr, char *string)); +EXTERN void TclInitJumpFixupArray _ANSI_ARGS_(( + JumpFixupArray *fixupArrayPtr)); #ifdef TCL_COMPILE_STATS EXTERN int TclLog2 _ANSI_ARGS_((int value)); #endif /*TCL_COMPILE_STATS*/ - -#include "tclCompileDecls.h" +EXTERN int TclObjIndexForString _ANSI_ARGS_((char *start, + int length, int allocStrRep, int inHeap, + CompileEnv *envPtr)); +EXTERN int TclPrintInstruction _ANSI_ARGS_((ByteCode* codePtr, + unsigned char *pc)); +EXTERN void TclPrintSource _ANSI_ARGS_((FILE *outFile, + char *string, int maxChars)); +EXTERN void TclRegisterAuxDataType _ANSI_ARGS_((AuxDataType *typePtr)); /* *---------------------------------------------------------------- diff --git a/generic/tclCompileDecls.h b/generic/tclCompileDecls.h deleted file mode 100644 index b8e5378..0000000 --- a/generic/tclCompileDecls.h +++ /dev/null @@ -1,265 +0,0 @@ -/* - * tclCompileDecls.h -- - * - * This file contains the declarations for functions that are used - * by the bytecode compiler and execution modules inside the Tcl - * core.. These interfaces are not guaranteed to remain the same between - * versions. Use at your own risk. - * - * Copyright (c) 1998-1999 by Scriptics Corporation. - * All rights reserved. - * - * RCS: @(#) $Id: tclCompileDecls.h,v 1.1.2.1 1999/03/05 20:18:04 stanton Exp $ - */ - -#ifndef _TCLCOMPILEDECLS -#define _TCLCOMPILEDECLS - -/* - * WARNING: This file is automatically generated by the tools/genStubs.tcl - * script. Any modifications to the function declarations below should be made - * in the generic/tclInt.decls script. - */ - -/* !BEGIN!: Do not edit below this line. */ - -/* - * Exported function declarations: - */ - -/* 0 */ -EXTERN void TclCleanupByteCode _ANSI_ARGS_((ByteCode * codePtr)); -/* 1 */ -EXTERN int TclCompileExpr _ANSI_ARGS_((Tcl_Interp * interp, - char * string, char * lastChar, int flags, - CompileEnv * envPtr)); -/* 2 */ -EXTERN int TclCompileQuotes _ANSI_ARGS_((Tcl_Interp * interp, - char * string, char * lastChar, int termChar, - int flags, CompileEnv * envPtr)); -/* 3 */ -EXTERN int TclCompileString _ANSI_ARGS_((Tcl_Interp * interp, - char * string, char * lastChar, int flags, - CompileEnv * envPtr)); -/* 4 */ -EXTERN int TclCompileDollarVar _ANSI_ARGS_((Tcl_Interp * interp, - char * string, char * lastChar, int flags, - CompileEnv * envPtr)); -/* 5 */ -EXTERN int TclCreateAuxData _ANSI_ARGS_((ClientData clientData, - AuxDataType * typePtr, CompileEnv * envPtr)); -/* 6 */ -EXTERN ExecEnv * TclCreateExecEnv _ANSI_ARGS_((Tcl_Interp * interp)); -/* 7 */ -EXTERN void TclDeleteExecEnv _ANSI_ARGS_((ExecEnv * eePtr)); -/* 8 */ -EXTERN void TclEmitForwardJump _ANSI_ARGS_((CompileEnv * envPtr, - TclJumpType jumpType, - JumpFixup * jumpFixupPtr)); -/* 9 */ -EXTERN AuxDataType * TclGetAuxDataType _ANSI_ARGS_((char * typeName)); -/* 10 */ -EXTERN ExceptionRange * TclGetExceptionRangeForPc _ANSI_ARGS_(( - unsigned char * pc, int catchOnly, - ByteCode* codePtr)); -/* 11 */ -EXTERN InstructionDesc * TclGetInstructionTable _ANSI_ARGS_((void)); -/* 12 */ -EXTERN int TclExecuteByteCode _ANSI_ARGS_((Tcl_Interp * interp, - ByteCode * codePtr)); -/* 13 */ -EXTERN void TclExpandCodeArray _ANSI_ARGS_((CompileEnv * envPtr)); -/* 14 */ -EXTERN void TclExpandJumpFixupArray _ANSI_ARGS_(( - JumpFixupArray * fixupArrayPtr)); -/* 15 */ -EXTERN void TclFinalizeAuxDataTypeTable _ANSI_ARGS_((void)); -/* 16 */ -EXTERN int TclFixupForwardJump _ANSI_ARGS_((CompileEnv * envPtr, - JumpFixup * jumpFixupPtr, int jumpDist, - int distThreshold)); -/* 17 */ -EXTERN void TclFreeCompileEnv _ANSI_ARGS_((CompileEnv * envPtr)); -/* 18 */ -EXTERN void TclFreeJumpFixupArray _ANSI_ARGS_(( - JumpFixupArray * fixupArrayPtr)); -/* 19 */ -EXTERN void TclInitAuxDataTypeTable _ANSI_ARGS_((void)); -/* 20 */ -EXTERN void TclInitByteCodeObj _ANSI_ARGS_((Tcl_Obj * objPtr, - CompileEnv * envPtr)); -/* 21 */ -EXTERN void TclInitCompileEnv _ANSI_ARGS_((Tcl_Interp * interp, - CompileEnv * envPtr, char * string)); -/* 22 */ -EXTERN void TclInitJumpFixupArray _ANSI_ARGS_(( - JumpFixupArray * fixupArrayPtr)); -/* 23 */ -EXTERN int TclObjIndexForString _ANSI_ARGS_((char * start, - int length, int allocStrRep, int inHeap, - CompileEnv * envPtr)); -/* 24 */ -EXTERN int TclPrintInstruction _ANSI_ARGS_((ByteCode* codePtr, - unsigned char * pc)); -/* 25 */ -EXTERN void TclPrintSource _ANSI_ARGS_((FILE * outFile, - char * string, int maxChars)); -/* 26 */ -EXTERN void TclRegisterAuxDataType _ANSI_ARGS_(( - AuxDataType * typePtr)); - -typedef struct TclCompileStubs { - int magic; - struct TclCompileStubHooks *hooks; - - void (*tclCleanupByteCode) _ANSI_ARGS_((ByteCode * codePtr)); /* 0 */ - int (*tclCompileExpr) _ANSI_ARGS_((Tcl_Interp * interp, char * string, char * lastChar, int flags, CompileEnv * envPtr)); /* 1 */ - int (*tclCompileQuotes) _ANSI_ARGS_((Tcl_Interp * interp, char * string, char * lastChar, int termChar, int flags, CompileEnv * envPtr)); /* 2 */ - int (*tclCompileString) _ANSI_ARGS_((Tcl_Interp * interp, char * string, char * lastChar, int flags, CompileEnv * envPtr)); /* 3 */ - int (*tclCompileDollarVar) _ANSI_ARGS_((Tcl_Interp * interp, char * string, char * lastChar, int flags, CompileEnv * envPtr)); /* 4 */ - int (*tclCreateAuxData) _ANSI_ARGS_((ClientData clientData, AuxDataType * typePtr, CompileEnv * envPtr)); /* 5 */ - ExecEnv * (*tclCreateExecEnv) _ANSI_ARGS_((Tcl_Interp * interp)); /* 6 */ - void (*tclDeleteExecEnv) _ANSI_ARGS_((ExecEnv * eePtr)); /* 7 */ - void (*tclEmitForwardJump) _ANSI_ARGS_((CompileEnv * envPtr, TclJumpType jumpType, JumpFixup * jumpFixupPtr)); /* 8 */ - AuxDataType * (*tclGetAuxDataType) _ANSI_ARGS_((char * typeName)); /* 9 */ - ExceptionRange * (*tclGetExceptionRangeForPc) _ANSI_ARGS_((unsigned char * pc, int catchOnly, ByteCode* codePtr)); /* 10 */ - InstructionDesc * (*tclGetInstructionTable) _ANSI_ARGS_((void)); /* 11 */ - int (*tclExecuteByteCode) _ANSI_ARGS_((Tcl_Interp * interp, ByteCode * codePtr)); /* 12 */ - void (*tclExpandCodeArray) _ANSI_ARGS_((CompileEnv * envPtr)); /* 13 */ - void (*tclExpandJumpFixupArray) _ANSI_ARGS_((JumpFixupArray * fixupArrayPtr)); /* 14 */ - void (*tclFinalizeAuxDataTypeTable) _ANSI_ARGS_((void)); /* 15 */ - int (*tclFixupForwardJump) _ANSI_ARGS_((CompileEnv * envPtr, JumpFixup * jumpFixupPtr, int jumpDist, int distThreshold)); /* 16 */ - void (*tclFreeCompileEnv) _ANSI_ARGS_((CompileEnv * envPtr)); /* 17 */ - void (*tclFreeJumpFixupArray) _ANSI_ARGS_((JumpFixupArray * fixupArrayPtr)); /* 18 */ - void (*tclInitAuxDataTypeTable) _ANSI_ARGS_((void)); /* 19 */ - void (*tclInitByteCodeObj) _ANSI_ARGS_((Tcl_Obj * objPtr, CompileEnv * envPtr)); /* 20 */ - void (*tclInitCompileEnv) _ANSI_ARGS_((Tcl_Interp * interp, CompileEnv * envPtr, char * string)); /* 21 */ - void (*tclInitJumpFixupArray) _ANSI_ARGS_((JumpFixupArray * fixupArrayPtr)); /* 22 */ - int (*tclObjIndexForString) _ANSI_ARGS_((char * start, int length, int allocStrRep, int inHeap, CompileEnv * envPtr)); /* 23 */ - int (*tclPrintInstruction) _ANSI_ARGS_((ByteCode* codePtr, unsigned char * pc)); /* 24 */ - void (*tclPrintSource) _ANSI_ARGS_((FILE * outFile, char * string, int maxChars)); /* 25 */ - void (*tclRegisterAuxDataType) _ANSI_ARGS_((AuxDataType * typePtr)); /* 26 */ -} TclCompileStubs; - -extern TclCompileStubs *tclCompileStubsPtr; - -#if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) - -/* - * Inline function declarations: - */ - -#ifndef TclCleanupByteCode -#define TclCleanupByteCode(codePtr) \ - (tclCompileStubsPtr->tclCleanupByteCode)(codePtr) /* 0 */ -#endif -#ifndef TclCompileExpr -#define TclCompileExpr(interp, string, lastChar, flags, envPtr) \ - (tclCompileStubsPtr->tclCompileExpr)(interp, string, lastChar, flags, envPtr) /* 1 */ -#endif -#ifndef TclCompileQuotes -#define TclCompileQuotes(interp, string, lastChar, termChar, flags, envPtr) \ - (tclCompileStubsPtr->tclCompileQuotes)(interp, string, lastChar, termChar, flags, envPtr) /* 2 */ -#endif -#ifndef TclCompileString -#define TclCompileString(interp, string, lastChar, flags, envPtr) \ - (tclCompileStubsPtr->tclCompileString)(interp, string, lastChar, flags, envPtr) /* 3 */ -#endif -#ifndef TclCompileDollarVar -#define TclCompileDollarVar(interp, string, lastChar, flags, envPtr) \ - (tclCompileStubsPtr->tclCompileDollarVar)(interp, string, lastChar, flags, envPtr) /* 4 */ -#endif -#ifndef TclCreateAuxData -#define TclCreateAuxData(clientData, typePtr, envPtr) \ - (tclCompileStubsPtr->tclCreateAuxData)(clientData, typePtr, envPtr) /* 5 */ -#endif -#ifndef TclCreateExecEnv -#define TclCreateExecEnv(interp) \ - (tclCompileStubsPtr->tclCreateExecEnv)(interp) /* 6 */ -#endif -#ifndef TclDeleteExecEnv -#define TclDeleteExecEnv(eePtr) \ - (tclCompileStubsPtr->tclDeleteExecEnv)(eePtr) /* 7 */ -#endif -#ifndef TclEmitForwardJump -#define TclEmitForwardJump(envPtr, jumpType, jumpFixupPtr) \ - (tclCompileStubsPtr->tclEmitForwardJump)(envPtr, jumpType, jumpFixupPtr) /* 8 */ -#endif -#ifndef TclGetAuxDataType -#define TclGetAuxDataType(typeName) \ - (tclCompileStubsPtr->tclGetAuxDataType)(typeName) /* 9 */ -#endif -#ifndef TclGetExceptionRangeForPc -#define TclGetExceptionRangeForPc(pc, catchOnly, codePtr) \ - (tclCompileStubsPtr->tclGetExceptionRangeForPc)(pc, catchOnly, codePtr) /* 10 */ -#endif -#ifndef TclGetInstructionTable -#define TclGetInstructionTable() \ - (tclCompileStubsPtr->tclGetInstructionTable)() /* 11 */ -#endif -#ifndef TclExecuteByteCode -#define TclExecuteByteCode(interp, codePtr) \ - (tclCompileStubsPtr->tclExecuteByteCode)(interp, codePtr) /* 12 */ -#endif -#ifndef TclExpandCodeArray -#define TclExpandCodeArray(envPtr) \ - (tclCompileStubsPtr->tclExpandCodeArray)(envPtr) /* 13 */ -#endif -#ifndef TclExpandJumpFixupArray -#define TclExpandJumpFixupArray(fixupArrayPtr) \ - (tclCompileStubsPtr->tclExpandJumpFixupArray)(fixupArrayPtr) /* 14 */ -#endif -#ifndef TclFinalizeAuxDataTypeTable -#define TclFinalizeAuxDataTypeTable() \ - (tclCompileStubsPtr->tclFinalizeAuxDataTypeTable)() /* 15 */ -#endif -#ifndef TclFixupForwardJump -#define TclFixupForwardJump(envPtr, jumpFixupPtr, jumpDist, distThreshold) \ - (tclCompileStubsPtr->tclFixupForwardJump)(envPtr, jumpFixupPtr, jumpDist, distThreshold) /* 16 */ -#endif -#ifndef TclFreeCompileEnv -#define TclFreeCompileEnv(envPtr) \ - (tclCompileStubsPtr->tclFreeCompileEnv)(envPtr) /* 17 */ -#endif -#ifndef TclFreeJumpFixupArray -#define TclFreeJumpFixupArray(fixupArrayPtr) \ - (tclCompileStubsPtr->tclFreeJumpFixupArray)(fixupArrayPtr) /* 18 */ -#endif -#ifndef TclInitAuxDataTypeTable -#define TclInitAuxDataTypeTable() \ - (tclCompileStubsPtr->tclInitAuxDataTypeTable)() /* 19 */ -#endif -#ifndef TclInitByteCodeObj -#define TclInitByteCodeObj(objPtr, envPtr) \ - (tclCompileStubsPtr->tclInitByteCodeObj)(objPtr, envPtr) /* 20 */ -#endif -#ifndef TclInitCompileEnv -#define TclInitCompileEnv(interp, envPtr, string) \ - (tclCompileStubsPtr->tclInitCompileEnv)(interp, envPtr, string) /* 21 */ -#endif -#ifndef TclInitJumpFixupArray -#define TclInitJumpFixupArray(fixupArrayPtr) \ - (tclCompileStubsPtr->tclInitJumpFixupArray)(fixupArrayPtr) /* 22 */ -#endif -#ifndef TclObjIndexForString -#define TclObjIndexForString(start, length, allocStrRep, inHeap, envPtr) \ - (tclCompileStubsPtr->tclObjIndexForString)(start, length, allocStrRep, inHeap, envPtr) /* 23 */ -#endif -#ifndef TclPrintInstruction -#define TclPrintInstruction(codePtr, pc) \ - (tclCompileStubsPtr->tclPrintInstruction)(codePtr, pc) /* 24 */ -#endif -#ifndef TclPrintSource -#define TclPrintSource(outFile, string, maxChars) \ - (tclCompileStubsPtr->tclPrintSource)(outFile, string, maxChars) /* 25 */ -#endif -#ifndef TclRegisterAuxDataType -#define TclRegisterAuxDataType(typePtr) \ - (tclCompileStubsPtr->tclRegisterAuxDataType)(typePtr) /* 26 */ -#endif - -#endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */ - -/* !END!: Do not edit above this line. */ - -#endif /* _TCLCOMPILEDECLS */ diff --git a/generic/tclCompileStubs.c b/generic/tclCompileStubs.c deleted file mode 100644 index 624d1c7..0000000 --- a/generic/tclCompileStubs.c +++ /dev/null @@ -1,278 +0,0 @@ -/* - * tclCompileStubs.c -- - * - * This file contains the wrapper functions for the unsupported - * tclCompile functions. - * - * Copyright (c) 1998-1999 by Scriptics Corporation. - * All rights reserved. - * - * RCS: @(#) $Id: tclCompileStubs.c,v 1.1.2.1 1999/03/05 20:18:04 stanton Exp $ - */ - -#include "tclCompile.h" - -/* - * WARNING: This file is automatically generated by the tools/genStubs.tcl - * script. Any modifications to the function declarations below should be made - * in the generic/tclInt.decls script. - */ - -/* !BEGIN!: Do not edit below this line. */ - -/* - * Exported stub functions: - */ - -/* Slot 0 */ -void -TclCleanupByteCode(codePtr) - ByteCode * codePtr; -{ - (tclCompileStubsPtr->tclCleanupByteCode)(codePtr); -} - -/* Slot 1 */ -int -TclCompileExpr(interp, string, lastChar, flags, envPtr) - Tcl_Interp * interp; - char * string; - char * lastChar; - int flags; - CompileEnv * envPtr; -{ - return (tclCompileStubsPtr->tclCompileExpr)(interp, string, lastChar, flags, envPtr); -} - -/* Slot 2 */ -int -TclCompileQuotes(interp, string, lastChar, termChar, flags, envPtr) - Tcl_Interp * interp; - char * string; - char * lastChar; - int termChar; - int flags; - CompileEnv * envPtr; -{ - return (tclCompileStubsPtr->tclCompileQuotes)(interp, string, lastChar, termChar, flags, envPtr); -} - -/* Slot 3 */ -int -TclCompileString(interp, string, lastChar, flags, envPtr) - Tcl_Interp * interp; - char * string; - char * lastChar; - int flags; - CompileEnv * envPtr; -{ - return (tclCompileStubsPtr->tclCompileString)(interp, string, lastChar, flags, envPtr); -} - -/* Slot 4 */ -int -TclCompileDollarVar(interp, string, lastChar, flags, envPtr) - Tcl_Interp * interp; - char * string; - char * lastChar; - int flags; - CompileEnv * envPtr; -{ - return (tclCompileStubsPtr->tclCompileDollarVar)(interp, string, lastChar, flags, envPtr); -} - -/* Slot 5 */ -int -TclCreateAuxData(clientData, typePtr, envPtr) - ClientData clientData; - AuxDataType * typePtr; - CompileEnv * envPtr; -{ - return (tclCompileStubsPtr->tclCreateAuxData)(clientData, typePtr, envPtr); -} - -/* Slot 6 */ -ExecEnv * -TclCreateExecEnv(interp) - Tcl_Interp * interp; -{ - return (tclCompileStubsPtr->tclCreateExecEnv)(interp); -} - -/* Slot 7 */ -void -TclDeleteExecEnv(eePtr) - ExecEnv * eePtr; -{ - (tclCompileStubsPtr->tclDeleteExecEnv)(eePtr); -} - -/* Slot 8 */ -void -TclEmitForwardJump(envPtr, jumpType, jumpFixupPtr) - CompileEnv * envPtr; - TclJumpType jumpType; - JumpFixup * jumpFixupPtr; -{ - (tclCompileStubsPtr->tclEmitForwardJump)(envPtr, jumpType, jumpFixupPtr); -} - -/* Slot 9 */ -AuxDataType * -TclGetAuxDataType(typeName) - char * typeName; -{ - return (tclCompileStubsPtr->tclGetAuxDataType)(typeName); -} - -/* Slot 10 */ -ExceptionRange * -TclGetExceptionRangeForPc(pc, catchOnly, codePtr) - unsigned char * pc; - int catchOnly; - ByteCode* codePtr; -{ - return (tclCompileStubsPtr->tclGetExceptionRangeForPc)(pc, catchOnly, codePtr); -} - -/* Slot 11 */ -InstructionDesc * -TclGetInstructionTable() -{ - return (tclCompileStubsPtr->tclGetInstructionTable)(); -} - -/* Slot 12 */ -int -TclExecuteByteCode(interp, codePtr) - Tcl_Interp * interp; - ByteCode * codePtr; -{ - return (tclCompileStubsPtr->tclExecuteByteCode)(interp, codePtr); -} - -/* Slot 13 */ -void -TclExpandCodeArray(envPtr) - CompileEnv * envPtr; -{ - (tclCompileStubsPtr->tclExpandCodeArray)(envPtr); -} - -/* Slot 14 */ -void -TclExpandJumpFixupArray(fixupArrayPtr) - JumpFixupArray * fixupArrayPtr; -{ - (tclCompileStubsPtr->tclExpandJumpFixupArray)(fixupArrayPtr); -} - -/* Slot 15 */ -void -TclFinalizeAuxDataTypeTable() -{ - (tclCompileStubsPtr->tclFinalizeAuxDataTypeTable)(); -} - -/* Slot 16 */ -int -TclFixupForwardJump(envPtr, jumpFixupPtr, jumpDist, distThreshold) - CompileEnv * envPtr; - JumpFixup * jumpFixupPtr; - int jumpDist; - int distThreshold; -{ - return (tclCompileStubsPtr->tclFixupForwardJump)(envPtr, jumpFixupPtr, jumpDist, distThreshold); -} - -/* Slot 17 */ -void -TclFreeCompileEnv(envPtr) - CompileEnv * envPtr; -{ - (tclCompileStubsPtr->tclFreeCompileEnv)(envPtr); -} - -/* Slot 18 */ -void -TclFreeJumpFixupArray(fixupArrayPtr) - JumpFixupArray * fixupArrayPtr; -{ - (tclCompileStubsPtr->tclFreeJumpFixupArray)(fixupArrayPtr); -} - -/* Slot 19 */ -void -TclInitAuxDataTypeTable() -{ - (tclCompileStubsPtr->tclInitAuxDataTypeTable)(); -} - -/* Slot 20 */ -void -TclInitByteCodeObj(objPtr, envPtr) - Tcl_Obj * objPtr; - CompileEnv * envPtr; -{ - (tclCompileStubsPtr->tclInitByteCodeObj)(objPtr, envPtr); -} - -/* Slot 21 */ -void -TclInitCompileEnv(interp, envPtr, string) - Tcl_Interp * interp; - CompileEnv * envPtr; - char * string; -{ - (tclCompileStubsPtr->tclInitCompileEnv)(interp, envPtr, string); -} - -/* Slot 22 */ -void -TclInitJumpFixupArray(fixupArrayPtr) - JumpFixupArray * fixupArrayPtr; -{ - (tclCompileStubsPtr->tclInitJumpFixupArray)(fixupArrayPtr); -} - -/* Slot 23 */ -int -TclObjIndexForString(start, length, allocStrRep, inHeap, envPtr) - char * start; - int length; - int allocStrRep; - int inHeap; - CompileEnv * envPtr; -{ - return (tclCompileStubsPtr->tclObjIndexForString)(start, length, allocStrRep, inHeap, envPtr); -} - -/* Slot 24 */ -int -TclPrintInstruction(codePtr, pc) - ByteCode* codePtr; - unsigned char * pc; -{ - return (tclCompileStubsPtr->tclPrintInstruction)(codePtr, pc); -} - -/* Slot 25 */ -void -TclPrintSource(outFile, string, maxChars) - FILE * outFile; - char * string; - int maxChars; -{ - (tclCompileStubsPtr->tclPrintSource)(outFile, string, maxChars); -} - -/* Slot 26 */ -void -TclRegisterAuxDataType(typePtr) - AuxDataType * typePtr; -{ - (tclCompileStubsPtr->tclRegisterAuxDataType)(typePtr); -} - - -/* !END!: Do not edit above this line. */ diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 58779a3..dc6cedd 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.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: tclDecls.h,v 1.2.2.1 1999/03/05 20:18:04 stanton Exp $ + * RCS: @(#) $Id: tclDecls.h,v 1.2.2.2 1999/03/06 21:19:57 stanton Exp $ */ #ifndef _TCLDECLS @@ -860,7 +860,6 @@ typedef struct TclStubHooks { struct TclPlatStubs *tclPlatStubs; struct TclIntStubs *tclIntStubs; struct TclIntPlatStubs *tclIntPlatStubs; - struct TclCompileStubs *tclCompileStubs; } TclStubHooks; typedef struct TclStubs { diff --git a/generic/tclInt.decls b/generic/tclInt.decls index 0fa31d0..3b12a84 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: tclInt.decls,v 1.2.2.1 1999/03/05 20:18:05 stanton Exp $ +# RCS: @(#) $Id: tclInt.decls,v 1.2.2.2 1999/03/06 21:19:57 stanton Exp $ library tcl @@ -780,102 +780,3 @@ declare 7 unix { declare 8 unix { int TclUnixWaitForFile(int fd, int mask, int timeout) } - -############################################################################## - -# Declare the functions used by tclCompile.h. This is an internal API and -# is subject to change. Use at your own risk. - -interface tclCompile - -declare 0 generic { - void TclCleanupByteCode(ByteCode *codePtr) -} -declare 1 generic { - int TclCompileExpr(Tcl_Interp *interp, char *string, char *lastChar, \ - int flags, CompileEnv *envPtr) -} -declare 2 generic { - int TclCompileQuotes(Tcl_Interp *interp, char *string, char *lastChar, \ - int termChar, int flags, CompileEnv *envPtr) -} -declare 3 generic { - int TclCompileString(Tcl_Interp *interp, char *string, char *lastChar, \ - int flags, CompileEnv *envPtr) -} -declare 4 generic { - int TclCompileDollarVar(Tcl_Interp *interp, char *string, \ - char *lastChar, int flags, CompileEnv *envPtr) -} -declare 5 generic { - int TclCreateAuxData(ClientData clientData, AuxDataType *typePtr, \ - CompileEnv *envPtr) -} -declare 6 generic { - ExecEnv * TclCreateExecEnv(Tcl_Interp *interp) -} -declare 7 generic { - void TclDeleteExecEnv(ExecEnv *eePtr) -} -declare 8 generic { - void TclEmitForwardJump(CompileEnv *envPtr, TclJumpType jumpType, \ - JumpFixup *jumpFixupPtr) -} -declare 9 generic { - AuxDataType *TclGetAuxDataType(char *typeName) -} -declare 10 generic { - ExceptionRange * TclGetExceptionRangeForPc(unsigned char *pc, \ - int catchOnly, ByteCode* codePtr) -} -declare 11 generic { - InstructionDesc * TclGetInstructionTable(void) -} -declare 12 generic { - int TclExecuteByteCode(Tcl_Interp *interp, ByteCode *codePtr) -} -declare 13 generic { - void TclExpandCodeArray(CompileEnv *envPtr) -} -declare 14 generic { - void TclExpandJumpFixupArray(JumpFixupArray *fixupArrayPtr) -} -declare 15 generic { - void TclFinalizeAuxDataTypeTable(void) -} -declare 16 generic { - int TclFixupForwardJump(CompileEnv *envPtr, JumpFixup *jumpFixupPtr, \ - int jumpDist, int distThreshold) -} -declare 17 generic { - void TclFreeCompileEnv(CompileEnv *envPtr) -} -declare 18 generic { - void TclFreeJumpFixupArray(JumpFixupArray *fixupArrayPtr) -} -declare 19 generic { - void TclInitAuxDataTypeTable(void) -} -declare 20 generic { - void TclInitByteCodeObj(Tcl_Obj *objPtr, CompileEnv *envPtr) -} -declare 21 generic { - void TclInitCompileEnv(Tcl_Interp *interp, CompileEnv *envPtr, \ - char *string) -} -declare 22 generic { - void TclInitJumpFixupArray(JumpFixupArray *fixupArrayPtr) -} -declare 23 generic { - int TclObjIndexForString(char *start, int length, int allocStrRep, \ - int inHeap, CompileEnv *envPtr) -} -declare 24 generic { - int TclPrintInstruction(ByteCode* codePtr, unsigned char *pc) -} -declare 25 generic { - void TclPrintSource(FILE *outFile, char *string, int maxChars) -} -declare 26 generic { - void TclRegisterAuxDataType(AuxDataType *typePtr) -} diff --git a/generic/tclInt.h b/generic/tclInt.h index 1ab5aea..c00dc0b 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInt.h,v 1.23.4.2 1999/03/04 01:01:58 stanton Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.23.4.3 1999/03/06 21:19:58 stanton Exp $ */ #ifndef _TCLINT @@ -53,13 +53,14 @@ #include <string.h> #endif -#ifdef ACCESS_TCL_THROUGH_STUB -# undef TCL_STORAGE_CLASS -# define TCL_STORAGE_CLASS +#undef TCL_STORAGE_CLASS +#ifdef BUILD_tcl +# define TCL_STORAGE_CLASS DLLEXPORT #else -# ifdef BUILD_tcl -# undef TCL_STORAGE_CLASS -# define TCL_STORAGE_CLASS DLLEXPORT +# ifdef USE_TCL_STUBS +# define TCL_STORAGE_CLASS +# else +# define TCL_STORAGE_CLASS DLLIMPORT # endif #endif @@ -825,6 +826,58 @@ typedef struct ExecEnv { } ExecEnv; /* + * CompileProcs need the ability to record information during compilation + * that can be used by bytecode instructions during execution. The AuxData + * structure provides this "auxiliary data" mechanism. An arbitrary number + * of these structures can be stored in the ByteCode record (during + * compilation they are stored in a CompileEnv structure). Each AuxData + * record holds one word of client-specified data (often a pointer) and is + * given an index that instructions can later use to look up the structure + * and its data. + * + * The following definitions declare the types of procedures that are called + * to duplicate or free this auxiliary data when the containing ByteCode + * objects are duplicated and freed. Pointers to these procedures are kept + * in the AuxData structure. + */ + +typedef ClientData (AuxDataDupProc) _ANSI_ARGS_((ClientData clientData)); +typedef void (AuxDataFreeProc) _ANSI_ARGS_((ClientData clientData)); + +/* + * We define a separate AuxDataType struct to hold type-related information + * for the AuxData structure. This separation makes it possible for clients + * outside of the TCL core to manipulate (in a limited fashion!) AuxData; + * for example, it makes it possible to pickle and unpickle AuxData structs. + */ + +typedef struct AuxDataType { + char *name; /* the name of the type. Types can be + * registered and found by name */ + AuxDataDupProc *dupProc; /* Callback procedure to invoke when the + * aux data is duplicated (e.g., when the + * ByteCode structure containing the aux + * data is duplicated). NULL means just + * copy the source clientData bits; no + * proc need be called. */ + AuxDataFreeProc *freeProc; /* Callback procedure to invoke when the + * aux data is freed. NULL means no + * proc need be called. */ +} AuxDataType; + +/* + * The definition of the AuxData structure that holds information created + * during compilation by CompileProcs and used by instructions during + * execution. + */ + +typedef struct AuxData { + AuxDataType *type; /* pointer to the AuxData type associated with + * this ClientData. */ + ClientData clientData; /* The compilation data itself. */ +} AuxData; + +/* *---------------------------------------------------------------- * Data structures related to commands. *---------------------------------------------------------------- diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 7b773f6..01d18f4 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -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: tclStubInit.c,v 1.2.2.1 1999/03/05 20:18:06 stanton Exp $ + * RCS: @(#) $Id: tclStubInit.c,v 1.2.2.2 1999/03/06 21:19:58 stanton Exp $ */ #include "tclInt.h" @@ -326,40 +326,6 @@ TclStubs tclStubs = { TclStubs *tclStubsPtr = &tclStubs; -TclCompileStubs tclCompileStubs = { - TCL_STUB_MAGIC, - NULL, - TclCleanupByteCode, /* 0 */ - TclCompileExpr, /* 1 */ - TclCompileQuotes, /* 2 */ - TclCompileString, /* 3 */ - TclCompileDollarVar, /* 4 */ - TclCreateAuxData, /* 5 */ - TclCreateExecEnv, /* 6 */ - TclDeleteExecEnv, /* 7 */ - TclEmitForwardJump, /* 8 */ - TclGetAuxDataType, /* 9 */ - TclGetExceptionRangeForPc, /* 10 */ - TclGetInstructionTable, /* 11 */ - TclExecuteByteCode, /* 12 */ - TclExpandCodeArray, /* 13 */ - TclExpandJumpFixupArray, /* 14 */ - TclFinalizeAuxDataTypeTable, /* 15 */ - TclFixupForwardJump, /* 16 */ - TclFreeCompileEnv, /* 17 */ - TclFreeJumpFixupArray, /* 18 */ - TclInitAuxDataTypeTable, /* 19 */ - TclInitByteCodeObj, /* 20 */ - TclInitCompileEnv, /* 21 */ - TclInitJumpFixupArray, /* 22 */ - TclObjIndexForString, /* 23 */ - TclPrintInstruction, /* 24 */ - TclPrintSource, /* 25 */ - TclRegisterAuxDataType, /* 26 */ -}; - -TclCompileStubs *tclCompileStubsPtr = &tclCompileStubs; - TclIntStubs tclIntStubs = { TCL_STUB_MAGIC, NULL, @@ -613,8 +579,7 @@ TclPlatStubs *tclPlatStubsPtr = &tclPlatStubs; static TclStubHooks tclStubHooks = { &tclPlatStubs, &tclIntStubs, - &tclIntPlatStubs, - &tclCompileStubs + &tclIntPlatStubs }; diff --git a/unix/Makefile.in b/unix/Makefile.in index cd348cc..a673fe1 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -5,7 +5,7 @@ # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. # -# RCS: @(#) $Id: Makefile.in,v 1.17.4.4 1999/03/05 23:24:52 stanton Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.17.4.5 1999/03/06 21:19:58 stanton Exp $ # Current Tcl version; used in various names. @@ -270,11 +270,15 @@ TCL_DECLS = \ $(GENERIC_DIR)/tclInt.decls GENERIC_HDRS = \ - $(GENERIC_DIR)/tclRegexp.h \ $(GENERIC_DIR)/tcl.h \ + $(GENERIC_DIR)/tclDecls.h \ $(GENERIC_DIR)/tclInt.h \ + $(GENERIC_DIR)/tclIntDecls.h \ + $(GENERIC_DIR)/tclIntPlatDecls.h \ + $(GENERIC_DIR)/tclPatch.h \ + $(GENERIC_DIR)/tclPlatDecls.h \ $(GENERIC_DIR)/tclPort.h \ - $(GENERIC_DIR)/tclPatch.h + $(GENERIC_DIR)/tclRegexp.h GENERIC_SRCS = \ $(GENERIC_DIR)/regexp.c \ @@ -328,7 +332,6 @@ GENERIC_SRCS = \ $(GENERIC_DIR)/tclVar.c STUB_SRCS = \ - $(GENERIC_DIR)/tclCompileStubs.c \ $(GENERIC_DIR)/tclIntPlatStubs.c \ $(GENERIC_DIR)/tclIntStubs.c \ $(GENERIC_DIR)/tclPlatStubs.c \ @@ -445,7 +448,7 @@ topDirName: gendate: yacc -l $(GENERIC_DIR)/tclGetDate.y sed -e 's/yy/TclDate/g' -e '/^#include <values.h>/d' \ - -e 's/SCCSID/RCS: @(#) $Id: Makefile.in,v 1.17.4.4 1999/03/05 23:24:52 stanton Exp $' + -e 's/SCCSID/RCS: @(#) \$Id\$' -e '/#ifdef __STDC__/,/#endif/d' -e '/TclDateerrlab:/d' \ -e '/TclDatenewstate:/d' -e '/#pragma/d' \ <y.tab.c >$(GENERIC_DIR)/tclDate.c @@ -884,9 +887,6 @@ waitpid.o: $(COMPAT_DIR)/waitpid.c # Stub library binaries, these must be compiled for use in a shared library # even though they will be placed in a static archive -tclCompileStubs.o: $(GENERIC_DIR)/tclCompileStubs.c - $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclCompileStubs.c - tclIntPlatStubs.o: $(GENERIC_DIR)/tclIntPlatStubs.c $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclIntPlatStubs.c |