home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tkisrc04.zip / tcl / os2 / tclInt.h < prev    next >
C/C++ Source or Header  |  1998-08-07  |  45KB  |  1,078 lines

  1. /*
  2.  * tclInt.h --
  3.  *
  4.  *    Declarations of things used internally by the Tcl interpreter.
  5.  *
  6.  * Copyright (c) 1987-1993 The Regents of the University of California.
  7.  * Copyright (c) 1994-1996 Sun Microsystems, Inc.
  8.  *
  9.  * See the file "license.terms" for information on usage and redistribution
  10.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  11.  *
  12.  * SCCS: @(#) tclInt.h 1.200 96/04/11 17:24:12
  13.  */
  14.  
  15. #ifndef _TCLINT
  16. #define _TCLINT
  17.  
  18. /*
  19.  * Common include files needed by most of the Tcl source files are
  20.  * included here, so that system-dependent personalizations for the
  21.  * include files only have to be made in once place.  This results
  22.  * in a few extra includes, but greater modularity.  The order of
  23.  * the three groups of #includes is important.  For example, stdio.h
  24.  * is needed by tcl.h, and the _ANSI_ARGS_ declaration in tcl.h is
  25.  * needed by stdlib.h in some configurations.
  26.  */
  27.  
  28. #include <stdio.h>
  29.  
  30. #ifndef _TCL
  31. #include "tcl.h"
  32. #endif
  33. #ifndef _REGEXP
  34. #include "../generic/tclRegexp.h" /* *MM* added ../generic/ */
  35. #endif
  36.  
  37. #include <ctype.h>
  38. #ifdef NO_LIMITS_H
  39. #   include "../compat/limits.h"
  40. #else
  41. #   include <limits.h>
  42. #endif
  43. #ifdef NO_STDLIB_H
  44. #   include "../compat/stdlib.h"
  45. #else
  46. #   include <stdlib.h>
  47. #endif
  48. #ifdef NO_STRING_H
  49. #include "../compat/string.h"
  50. #else
  51. #include <string.h>
  52. #endif
  53. /* *MM* added third clause */
  54. #if defined(__STDC__) || defined(HAS_STDARG) || defined(__IBMC__)
  55. #   include <stdarg.h>
  56. #else
  57. #   include <varargs.h>
  58. #endif
  59.  
  60. /*
  61.  *----------------------------------------------------------------
  62.  * Data structures related to variables.   These are used primarily
  63.  * in tclVar.c
  64.  *----------------------------------------------------------------
  65.  */
  66.  
  67. /*
  68.  * The following structure defines a variable trace, which is used to
  69.  * invoke a specific C procedure whenever certain operations are performed
  70.  * on a variable.
  71.  */
  72.  
  73. typedef struct VarTrace {
  74.     Tcl_VarTraceProc *traceProc;/* Procedure to call when operations given
  75.                  * by flags are performed on variable. */
  76.     ClientData clientData;    /* Argument to pass to proc. */
  77.     int flags;            /* What events the trace procedure is
  78.                  * interested in:  OR-ed combination of
  79.                  * TCL_TRACE_READS, TCL_TRACE_WRITES, and
  80.                  * TCL_TRACE_UNSETS. */
  81.     struct VarTrace *nextPtr;    /* Next in list of traces associated with
  82.                  * a particular variable. */
  83. } VarTrace;
  84.  
  85. /*
  86.  * When a variable trace is active (i.e. its associated procedure is
  87.  * executing), one of the following structures is linked into a list
  88.  * associated with the variable's interpreter.  The information in
  89.  * the structure is needed in order for Tcl to behave reasonably
  90.  * if traces are deleted while traces are active.
  91.  */
  92.  
  93. typedef struct ActiveVarTrace {
  94.     struct Var *varPtr;        /* Variable that's being traced. */
  95.     struct ActiveVarTrace *nextPtr;
  96.                 /* Next in list of all active variable
  97.                  * traces for the interpreter, or NULL
  98.                  * if no more. */
  99.     VarTrace *nextTracePtr;    /* Next trace to check after current
  100.                  * trace procedure returns;  if this
  101.                  * trace gets deleted, must update pointer
  102.                  * to avoid using free'd memory. */
  103. } ActiveVarTrace;
  104.  
  105. /*
  106.  * The following structure describes an enumerative search in progress on
  107.  * an array variable;  this are invoked with options to the "array"
  108.  * command.
  109.  */
  110.  
  111. typedef struct ArraySearch {
  112.     int id;            /* Integer id used to distinguish among
  113.                  * multiple concurrent searches for the
  114.                  * same array. */
  115.     struct Var *varPtr;        /* Pointer to array variable that's being
  116.                  * searched. */
  117.     Tcl_HashSearch search;    /* Info kept by the hash module about
  118.                  * progress through the array. */
  119.     Tcl_HashEntry *nextEntry;    /* Non-null means this is the next element
  120.                  * to be enumerated (it's leftover from
  121.                  * the Tcl_FirstHashEntry call or from
  122.                  * an "array anymore" command).  NULL
  123.                  * means must call Tcl_NextHashEntry
  124.                  * to get value to return. */
  125.     struct ArraySearch *nextPtr;/* Next in list of all active searches
  126.                  * for this variable, or NULL if this is
  127.                  * the last one. */
  128. } ArraySearch;
  129.  
  130. /*
  131.  * The structure below defines a variable, which associates a string name
  132.  * with a string value.  Pointers to these structures are kept as the
  133.  * values of hash table entries, and the name of each variable is stored
  134.  * in the hash entry.
  135.  */
  136.  
  137. typedef struct Var {
  138.     int valueLength;        /* Holds the number of non-null bytes
  139.                  * actually occupied by the variable's
  140.                  * current value in value.string (extra
  141.                  * space is sometimes left for expansion).
  142.                  * For array and global variables this is
  143.                  * meaningless. */
  144.     int valueSpace;        /* Total number of bytes of space allocated
  145.                  * at value.string.  0 means there is no
  146.                  * space allocated. */
  147.     union {
  148.     char *string;        /* String value of variable, used for scalar
  149.                  * variables and array elements.  Malloc-ed. */
  150.     Tcl_HashTable *tablePtr;/* For array variables, this points to
  151.                  * information about the hash table used
  152.                  * to implement the associative array. 
  153.                  * Points to malloc-ed data. */
  154.     struct Var *upvarPtr;    /* If this is a global variable being
  155.                  * referred to in a procedure, or a variable
  156.                  * created by "upvar", this field points to
  157.                  * the record for the higher-level variable. */
  158.     } value;
  159.     Tcl_HashEntry *hPtr;    /* Hash table entry that refers to this
  160.                  * variable, or NULL if the variable has
  161.                  * been detached from its hash table (e.g.
  162.                  * an array is deleted, but some of its
  163.                  * elements are still referred to in upvars). */
  164.     int refCount;        /* Counts number of active uses of this
  165.                  * variable, not including its main hash
  166.                  * table entry: 1 for each additional variable
  167.                  * whose upVarPtr points here, 1 for each
  168.                  * nested trace active on variable.  This
  169.                  * record can't be deleted until refCount
  170.                  * becomes 0. */
  171.     VarTrace *tracePtr;        /* First in list of all traces set for this
  172.                  * variable. */
  173.     ArraySearch *searchPtr;    /* First in list of all searches active
  174.                  * for this variable, or NULL if none. */
  175.     int flags;            /* Miscellaneous bits of information about
  176.                  * variable.  See below for definitions. */
  177. } Var;
  178.  
  179. /*
  180.  * Flag bits for variables:
  181.  *
  182.  * VAR_ARRAY    -        1 means this is an array variable rather
  183.  *                than a scalar variable.
  184.  * VAR_UPVAR -             1 means this variable just contains a
  185.  *                pointer to another variable that has the
  186.  *                real value.  Variables like this come
  187.  *                about through the "upvar" and "global"
  188.  *                commands.
  189.  * VAR_UNDEFINED -        1 means that the variable is currently
  190.  *                undefined.  Undefined variables usually
  191.  *                go away completely, but if an undefined
  192.  *                variable has a trace on it, or if it is
  193.  *                a global variable being used by a procedure,
  194.  *                then it stays around even when undefined.
  195.  * VAR_TRACE_ACTIVE -        1 means that trace processing is currently
  196.  *                underway for a read or write access, so
  197.  *                new read or write accesses should not cause
  198.  *                trace procedures to be called and the
  199.  *                variable can't be deleted.
  200.  */
  201.  
  202. #define VAR_ARRAY        1
  203. #define VAR_UPVAR        2
  204. #define VAR_UNDEFINED        4
  205. #define VAR_TRACE_ACTIVE    0x10
  206.  
  207. /*
  208.  *----------------------------------------------------------------
  209.  * Data structures related to procedures.   These are used primarily
  210.  * in tclProc.c
  211.  *----------------------------------------------------------------
  212.  */
  213.  
  214. /*
  215.  * The structure below defines an argument to a procedure, which
  216.  * consists of a name and an (optional) default value.
  217.  */
  218.  
  219. typedef struct Arg {
  220.     struct Arg *nextPtr;    /* Next argument for this procedure,
  221.                  * or NULL if this is the last argument. */
  222.     char *defValue;        /* Pointer to arg's default value, or NULL
  223.                  * if no default value. */
  224.     char name[4];        /* Name of argument starts here.  The name
  225.                  * is followed by space for the default,
  226.                  * if there is one.  The actual size of this
  227.                  * field will be as large as necessary to
  228.                  * hold both name and default value.  THIS
  229.                  * MUST BE THE LAST FIELD IN THE STRUCTURE!! */
  230. } Arg;
  231.  
  232. /*
  233.  * The structure below defines a command procedure, which consists of
  234.  * a collection of Tcl commands plus information about arguments and
  235.  * variables.
  236.  */
  237.  
  238. typedef struct Proc {
  239.     struct Interp *iPtr;    /* Interpreter for which this command
  240.                  * is defined. */
  241.     int refCount;        /* Reference count:  1 if still present
  242.                  * in command table plus 1 for each call
  243.                  * to the procedure that is currently
  244.                  * active.  This structure can be freed
  245.                  * when refCount becomes zero. */
  246.     char *command;        /* Command that constitutes the body of
  247.                  * the procedure (dynamically allocated). */
  248.     Arg *argPtr;        /* Pointer to first of procedure's formal
  249.                  * arguments, or NULL if none. */
  250. } Proc;
  251.  
  252. /*
  253.  * The structure below defines a command trace.  This is used to allow Tcl
  254.  * clients to find out whenever a command is about to be executed.
  255.  */
  256.  
  257. typedef struct Trace {
  258.     int level;            /* Only trace commands at nesting level
  259.                  * less than or equal to this. */
  260.     Tcl_CmdTraceProc *proc;    /* Procedure to call to trace command. */
  261.     ClientData clientData;    /* Arbitrary value to pass to proc. */
  262.     struct Trace *nextPtr;    /* Next in list of traces for this interp. */
  263. } Trace;
  264.  
  265. /*
  266.  * The structure below defines an entry in the assocData hash table which
  267.  * is associated with an interpreter. The entry contains a pointer to a
  268.  * function to call when the interpreter is deleted, and a pointer to
  269.  * a user-defined piece of data.
  270.  */
  271.  
  272. typedef struct AssocData {
  273.     Tcl_InterpDeleteProc *proc;    /* Proc to call when deleting. */
  274.     ClientData clientData;    /* Value to pass to proc. */
  275. } AssocData;    
  276.  
  277. /*
  278.  * The structure below defines a frame, which is a procedure invocation.
  279.  * These structures exist only while procedures are being executed, and
  280.  * provide a sort of call stack.
  281.  */
  282.  
  283. typedef struct CallFrame {
  284.     Tcl_HashTable varTable;    /* Hash table containing all of procedure's
  285.                  * local variables. */
  286.     int level;            /* Level of this procedure, for "uplevel"
  287.                  * purposes (i.e. corresponds to nesting of
  288.                  * callerVarPtr's, not callerPtr's).  1 means
  289.                  * outer-most procedure, 0 means top-level. */
  290.     int argc;            /* This and argv below describe name and
  291.                  * arguments for this procedure invocation. */
  292.     char **argv;        /* Array of arguments. */
  293.     struct CallFrame *callerPtr;
  294.                 /* Value of interp->framePtr when this
  295.                  * procedure was invoked (i.e. next in
  296.                  * stack of all active procedures). */
  297.     struct CallFrame *callerVarPtr;
  298.                 /* Value of interp->varFramePtr when this
  299.                  * procedure was invoked (i.e. determines
  300.                  * variable scoping within caller;  same
  301.                  * as callerPtr unless an "uplevel" command
  302.                  * or something equivalent was active in
  303.                  * the caller). */
  304. } CallFrame;
  305.  
  306. /*
  307.  * The structure below defines one history event (a previously-executed
  308.  * command that can be re-executed in whole or in part).
  309.  */
  310.  
  311. typedef struct {
  312.     char *command;        /* String containing previously-executed
  313.                  * command. */
  314.     int bytesAvl;        /* Total # of bytes available at *event (not
  315.                  * all are necessarily in use now). */
  316. } HistoryEvent;
  317.  
  318. /*
  319.  *----------------------------------------------------------------
  320.  * Data structures related to history.   These are used primarily
  321.  * in tclHistory.c
  322.  *----------------------------------------------------------------
  323.  */
  324.  
  325. /*
  326.  * The structure below defines a pending revision to the most recent
  327.  * history event.  Changes are linked together into a list and applied
  328.  * during the next call to Tcl_RecordHistory.  See the comments at the
  329.  * beginning of tclHistory.c for information on revisions.
  330.  */
  331.  
  332. typedef struct HistoryRev {
  333.     int firstIndex;        /* Index of the first byte to replace in
  334.                  * current history event. */
  335.     int lastIndex;        /* Index of last byte to replace in
  336.                  * current history event. */
  337.     int newSize;        /* Number of bytes in newBytes. */
  338.     char *newBytes;        /* Replacement for the range given by
  339.                  * firstIndex and lastIndex (malloced). */
  340.     struct HistoryRev *nextPtr;    /* Next in chain of revisions to apply, or
  341.                  * NULL for end of list. */
  342. } HistoryRev;
  343.  
  344. /*
  345.  *----------------------------------------------------------------
  346.  * Data structures related to expressions.  These are used only in
  347.  * tclExpr.c.
  348.  *----------------------------------------------------------------
  349.  */
  350.  
  351. /*
  352.  * The data structure below defines a math function (e.g. sin or hypot)
  353.  * for use in Tcl expressions.
  354.  */
  355.  
  356. #define MAX_MATH_ARGS 5
  357. typedef struct MathFunc {
  358.     int numArgs;        /* Number of arguments for function. */
  359.     Tcl_ValueType argTypes[MAX_MATH_ARGS];
  360.                 /* Acceptable types for each argument. */
  361.     Tcl_MathProc *proc;        /* Procedure that implements this function. */
  362.     ClientData clientData;    /* Additional argument to pass to the function
  363.                  * when invoking it. */
  364. } MathFunc;
  365.  
  366. /*
  367.  *----------------------------------------------------------------
  368.  * One of the following structures exists for each command in
  369.  * an interpreter.  The Tcl_Command opaque type actually refers
  370.  * to these structures.
  371.  *----------------------------------------------------------------
  372.  */
  373.  
  374. typedef struct Command {
  375.     Tcl_HashEntry *hPtr;    /* Pointer to the hash table entry in
  376.                  * interp->commandTable that refers to
  377.                  * this command.  Used to get a command's
  378.                  * name from its Tcl_Command handle.  NULL
  379.                  * means that the hash table entry has
  380.                  * been removed already (this can happen
  381.                  * if deleteProc causes the command to be
  382.                  * deleted or recreated). */
  383.     Tcl_CmdProc *proc;        /* Procedure to process command. */
  384.     ClientData clientData;    /* Arbitrary value to pass to proc. */
  385.     Tcl_CmdDeleteProc *deleteProc;
  386.                 /* Procedure to invoke when deleting
  387.                  * command. */
  388.     ClientData deleteData;    /* Arbitrary value to pass to deleteProc
  389.                  * (usually the same as clientData). */
  390.     int deleted;        /* Means that the command is in the process
  391.                  * of being deleted (its deleteProc is
  392.                  * currently executing).  Any other attempts
  393.                  * to delete the command should be ignored. */
  394. } Command;
  395.  
  396. /*
  397.  *----------------------------------------------------------------
  398.  * This structure defines an interpreter, which is a collection of
  399.  * commands plus other state information related to interpreting
  400.  * commands, such as variable storage.  Primary responsibility for
  401.  * this data structure is in tclBasic.c, but almost every Tcl
  402.  * source file uses something in here.
  403.  *----------------------------------------------------------------
  404.  */
  405.  
  406. typedef struct Interp {
  407.  
  408.     /*
  409.      * Note:  the first three fields must match exactly the fields in
  410.      * a Tcl_Interp struct (see tcl.h).  If you change one, be sure to
  411.      * change the other.
  412.      */
  413.  
  414.     char *result;        /* Points to result returned by last
  415.                  * command. */
  416.     Tcl_FreeProc *freeProc;    /* Zero means result is statically allocated.
  417.                  * TCL_DYNAMIC means result was allocated with
  418.                  * ckalloc and should be freed with ckfree.
  419.                  * Other values give address of procedure
  420.                  * to invoke to free the result.  Must be
  421.                  * freed by Tcl_Eval before executing next
  422.                  * command. */
  423.     int errorLine;        /* When TCL_ERROR is returned, this gives
  424.                  * the line number within the command where
  425.                  * the error occurred (1 means first line). */
  426.     Tcl_HashTable commandTable;    /* Contains all of the commands currently
  427.                  * registered in this interpreter.  Indexed
  428.                  * by strings; values have type (Command *). */
  429.     Tcl_HashTable mathFuncTable;/* Contains all of the math functions currently
  430.                  * defined for the interpreter.  Indexed by
  431.                  * strings (function names);  values have
  432.                  * type (MathFunc *). */
  433.  
  434.     /*
  435.      * Information related to procedures and variables.  See tclProc.c
  436.      * and tclvar.c for usage.
  437.      */
  438.  
  439.     Tcl_HashTable globalTable;    /* Contains all global variables for
  440.                  * interpreter. */
  441.     int numLevels;        /* Keeps track of how many nested calls to
  442.                  * Tcl_Eval are in progress for this
  443.                  * interpreter.  It's used to delay deletion
  444.                  * of the table until all Tcl_Eval invocations
  445.                  * are completed. */
  446.     int maxNestingDepth;    /* If numLevels exceeds this value then Tcl
  447.                  * assumes that infinite recursion has
  448.                  * occurred and it generates an error. */
  449.     CallFrame *framePtr;    /* Points to top-most in stack of all nested
  450.                  * procedure invocations.  NULL means there
  451.                  * are no active procedures. */
  452.     CallFrame *varFramePtr;    /* Points to the call frame whose variables
  453.                  * are currently in use (same as framePtr
  454.                  * unless an "uplevel" command is being
  455.                  * executed).  NULL means no procedure is
  456.                  * active or "uplevel 0" is being exec'ed. */
  457.     ActiveVarTrace *activeTracePtr;
  458.                 /* First in list of active traces for interp,
  459.                  * or NULL if no active traces. */
  460.     int returnCode;        /* Completion code to return if current
  461.                  * procedure exits with a TCL_RETURN code. */
  462.     char *errorInfo;        /* Value to store in errorInfo if returnCode
  463.                  * is TCL_ERROR.  Malloc'ed, may be NULL */
  464.     char *errorCode;        /* Value to store in errorCode if returnCode
  465.                  * is TCL_ERROR.  Malloc'ed, may be NULL */
  466.  
  467.     /*
  468.      * Information related to history:
  469.      */
  470.  
  471.     int numEvents;        /* Number of previously-executed commands
  472.                  * to retain. */
  473.     HistoryEvent *events;    /* Array containing numEvents entries
  474.                  * (dynamically allocated). */
  475.     int curEvent;        /* Index into events of place where current
  476.                  * (or most recent) command is recorded. */
  477.     int curEventNum;        /* Event number associated with the slot
  478.                  * given by curEvent. */
  479.     HistoryRev *revPtr;        /* First in list of pending revisions. */
  480.     char *historyFirst;        /* First char. of current command executed
  481.                  * from history module or NULL if none. */
  482.     int revDisables;        /* 0 means history revision OK;  > 0 gives
  483.                  * a count of number of times revision has
  484.                  * been disabled. */
  485.     char *evalFirst;        /* If TCL_RECORD_BOUNDS flag set, Tcl_Eval
  486.                  * sets this field to point to the first
  487.                  * char. of text from which the current
  488.                  * command came.  Otherwise Tcl_Eval sets
  489.                  * this to NULL. */
  490.     char *evalLast;        /* Similar to evalFirst, except points to
  491.                  * last character of current command. */
  492.  
  493.     /*
  494.      * Information used by Tcl_AppendResult to keep track of partial
  495.      * results.  See Tcl_AppendResult code for details.
  496.      */
  497.  
  498.     char *appendResult;        /* Storage space for results generated
  499.                  * by Tcl_AppendResult.  Malloc-ed.  NULL
  500.                  * means not yet allocated. */
  501.     int appendAvl;        /* Total amount of space available at
  502.                  * partialResult. */
  503.     int appendUsed;        /* Number of non-null bytes currently
  504.                  * stored at partialResult. */
  505.  
  506.     /*
  507.      * A cache of compiled regular expressions.  See Tcl_RegExpCompile
  508.      * in tclUtil.c for details.
  509.      */
  510.  
  511. #define NUM_REGEXPS 5
  512.     char *patterns[NUM_REGEXPS];/* Strings corresponding to compiled
  513.                  * regular expression patterns.  NULL
  514.                  * means that this slot isn't used.
  515.                  * Malloc-ed. */
  516.     int patLengths[NUM_REGEXPS];/* Number of non-null characters in
  517.                  * corresponding entry in patterns.
  518.                  * -1 means entry isn't used. */
  519.     regexp *regexps[NUM_REGEXPS];
  520.                 /* Compiled forms of above strings.  Also
  521.                  * malloc-ed, or NULL if not in use yet. */
  522.  
  523.     /*
  524.      * Information about packages.  Used only in tclPkg.c.
  525.      */
  526.  
  527.     Tcl_HashTable packageTable;    /* Describes all of the packages loaded
  528.                  * in or available to this interpreter.
  529.                  * Keys are package names, values are
  530.                  * (Package *) pointers. */
  531.     char *packageUnknown;    /* Command to invoke during "package
  532.                  * require" commands for packages that
  533.                  * aren't described in packageTable. 
  534.                  * Malloc'ed, may be NULL. */
  535.  
  536.     /*
  537.      * Information used by Tcl_PrintDouble:
  538.      */
  539.  
  540.     char pdFormat[10];        /* Format string used by Tcl_PrintDouble. */
  541.     int pdPrec;            /* Current precision (used to restore the
  542.                  * the tcl_precision variable after a bogus
  543.                  * value has been put into it). */
  544.  
  545.     /*
  546.      * Miscellaneous information:
  547.      */
  548.  
  549.     int cmdCount;        /* Total number of times a command procedure
  550.                  * has been called for this interpreter. */
  551.     int noEval;            /* Non-zero means no commands should actually
  552.                  * be executed:  just parse only.  Used in
  553.                  * expressions when the result is already
  554.                  * determined. */
  555.     int evalFlags;        /* Flags to control next call to Tcl_Eval.
  556.                  * Normally zero, but may be set before
  557.                  * calling Tcl_Eval.  See below for valid
  558.                  * values. */
  559.     char *termPtr;        /* Character just after the last one in
  560.                  * a command.  Set by Tcl_Eval before
  561.                  * returning. */
  562.     char *scriptFile;        /* NULL means there is no nested source
  563.                  * command active;  otherwise this points to
  564.                  * the name of the file being sourced (it's
  565.                  * not malloc-ed:  it points to an argument
  566.                  * to Tcl_EvalFile. */
  567.     int flags;            /* Various flag bits.  See below. */
  568.     Trace *tracePtr;        /* List of traces for this interpreter. */
  569.     Tcl_HashTable *assocData;    /* Hash table for associating data with
  570.                                  * this interpreter. Cleaned up when
  571.                                  * this interpreter is deleted. */
  572.     char resultSpace[TCL_RESULT_SIZE+1];
  573.                 /* Static space for storing small results. */
  574. } Interp;
  575.  
  576. /*
  577.  * EvalFlag bits for Interp structures:
  578.  *
  579.  * TCL_BRACKET_TERM    1 means that the current script is terminated by
  580.  *            a close bracket rather than the end of the string.
  581.  * TCL_RECORD_BOUNDS    Tells Tcl_Eval to record information in the
  582.  *            evalFirst and evalLast fields for each command
  583.  *            executed directly from the string (top-level
  584.  *            commands and those from command substitution).
  585.  * TCL_ALLOW_EXCEPTIONS    1 means it's OK for the script to terminate with
  586.  *            a code other than TCL_OK or TCL_ERROR;  0 means
  587.  *            codes other than these should be turned into errors.
  588.  */
  589.  
  590. #define TCL_BRACKET_TERM    1
  591. #define TCL_RECORD_BOUNDS    2
  592. #define TCL_ALLOW_EXCEPTIONS    4
  593.  
  594. /*
  595.  * Flag bits for Interp structures:
  596.  *
  597.  * DELETED:        Non-zero means the interpreter has been deleted:
  598.  *            don't process any more commands for it, and destroy
  599.  *            the structure as soon as all nested invocations of
  600.  *            Tcl_Eval are done.
  601.  * ERR_IN_PROGRESS:    Non-zero means an error unwind is already in progress.
  602.  *            Zero means a command proc has been invoked since last
  603.  *            error occured.
  604.  * ERR_ALREADY_LOGGED:    Non-zero means information has already been logged
  605.  *            in $errorInfo for the current Tcl_Eval instance,
  606.  *            so Tcl_Eval needn't log it (used to implement the
  607.  *            "error message log" command).
  608.  * ERROR_CODE_SET:    Non-zero means that Tcl_SetErrorCode has been
  609.  *            called to record information for the current
  610.  *            error.  Zero means Tcl_Eval must clear the
  611.  *            errorCode variable if an error is returned.
  612.  * EXPR_INITIALIZED:    1 means initialization specific to expressions has
  613.  *            been carried out.
  614.  */
  615.  
  616. #define DELETED            1
  617. #define ERR_IN_PROGRESS        2
  618. #define ERR_ALREADY_LOGGED    4
  619. #define ERROR_CODE_SET        8
  620. #define EXPR_INITIALIZED    0x10
  621.  
  622. /*
  623.  * Default value for the pdPrec and pdFormat fields of interpreters:
  624.  */
  625.  
  626. #define DEFAULT_PD_PREC 6
  627. #define DEFAULT_PD_FORMAT "%g"
  628.  
  629. /*
  630.  *----------------------------------------------------------------
  631.  * Data structures related to command parsing.   These are used in
  632.  * tclParse.c and its clients.
  633.  *----------------------------------------------------------------
  634.  */
  635.  
  636. /*
  637.  * The following data structure is used by various parsing procedures
  638.  * to hold information about where to store the results of parsing
  639.  * (e.g. the substituted contents of a quoted argument, or the result
  640.  * of a nested command).  At any given time, the space available
  641.  * for output is fixed, but a procedure may be called to expand the
  642.  * space available if the current space runs out.
  643.  */
  644.  
  645. typedef struct ParseValue {
  646.     char *buffer;        /* Address of first character in
  647.                  * output buffer. */
  648.     char *next;            /* Place to store next character in
  649.                  * output buffer. */
  650.     char *end;            /* Address of the last usable character
  651.                  * in the buffer. */
  652.     void (*expandProc) _ANSI_ARGS_((struct ParseValue *pvPtr, int needed));
  653.                 /* Procedure to call when space runs out;
  654.                  * it will make more space. */
  655.     ClientData clientData;    /* Arbitrary information for use of
  656.                  * expandProc. */
  657. } ParseValue;
  658.  
  659. /*
  660.  * A table used to classify input characters to assist in parsing
  661.  * Tcl commands.  The table should be indexed with a signed character
  662.  * using the CHAR_TYPE macro.  The character may have a negative
  663.  * value.
  664.  */
  665.  
  666. extern char tclTypeTable[];
  667. #define CHAR_TYPE(c) (tclTypeTable+128)[c]
  668.  
  669. /*
  670.  * Possible values returned by CHAR_TYPE:
  671.  *
  672.  * TCL_NORMAL -        All characters that don't have special significance
  673.  *            to the Tcl language.
  674.  * TCL_SPACE -        Character is space, tab, or return.
  675.  * TCL_COMMAND_END -    Character is newline or null or semicolon or
  676.  *            close-bracket.
  677.  * TCL_QUOTE -        Character is a double-quote.
  678.  * TCL_OPEN_BRACKET -    Character is a "[".
  679.  * TCL_OPEN_BRACE -    Character is a "{".
  680.  * TCL_CLOSE_BRACE -    Character is a "}".
  681.  * TCL_BACKSLASH -    Character is a "\".
  682.  * TCL_DOLLAR -        Character is a "$".
  683.  */
  684.  
  685. #define TCL_NORMAL        0
  686. #define TCL_SPACE        1
  687. #define TCL_COMMAND_END        2
  688. #define TCL_QUOTE        3
  689. #define TCL_OPEN_BRACKET    4
  690. #define TCL_OPEN_BRACE        5
  691. #define TCL_CLOSE_BRACE        6
  692. #define TCL_BACKSLASH        7
  693. #define TCL_DOLLAR        8
  694.  
  695. /*
  696.  * Maximum number of levels of nesting permitted in Tcl commands (used
  697.  * to catch infinite recursion).
  698.  */
  699.  
  700. #define MAX_NESTING_DEPTH    1000
  701.  
  702. /*
  703.  * The macro below is used to modify a "char" value (e.g. by casting
  704.  * it to an unsigned character) so that it can be used safely with
  705.  * macros such as isspace.
  706.  */
  707.  
  708. #define UCHAR(c) ((unsigned char) (c))
  709.  
  710. /*
  711.  * Given a size or address, the macro below "aligns" it to the machine's
  712.  * memory unit size (e.g. an 8-byte boundary) so that anything can be
  713.  * placed at the aligned address without fear of an alignment error.
  714.  */
  715.  
  716. #define TCL_ALIGN(x) ((x + 7) & ~7)
  717.  
  718. /*
  719.  * For each event source (created with Tcl_CreateEventSource) there
  720.  * is a structure of the following type:
  721.  */
  722.  
  723. typedef struct TclEventSource {
  724.     Tcl_EventSetupProc *setupProc;    /* This procedure is called by
  725.                      * Tcl_DoOneEvent to set up information
  726.                      * for the wait operation, such as
  727.                      * files to wait for or maximum
  728.                      * timeout. */
  729.     Tcl_EventCheckProc *checkProc;    /* This procedure is called by
  730.                      * Tcl_DoOneEvent after its wait
  731.                      * operation to see what events
  732.                      * are ready and queue them. */
  733.     ClientData clientData;        /* Arbitrary one-word argument to pass
  734.                      * to setupProc and checkProc. */
  735.     struct TclEventSource *nextPtr;    /* Next in list of all event sources
  736.                      * defined for applicaton. */
  737. } TclEventSource;
  738.  
  739. /*
  740.  * The following macros are used to specify the runtime platform
  741.  * setting of the tclPlatform variable.
  742.  */
  743.  
  744. typedef enum {
  745.     TCL_PLATFORM_UNIX,        /* Any Unix-like OS. */
  746.     TCL_PLATFORM_MAC,        /* MacOS. */
  747.     TCL_PLATFORM_WINDOWS,    /* Any Microsoft Windows OS. */
  748.     TCL_PLATFORM_OS2        /* Any OS/2 version. */
  749. } TclPlatformType;
  750.  
  751. /*
  752.  *----------------------------------------------------------------
  753.  * Variables shared among Tcl modules but not used by the outside
  754.  * world:
  755.  *----------------------------------------------------------------
  756.  */
  757.  
  758. extern Tcl_Time            tclBlockTime;
  759. extern int            tclBlockTimeSet;
  760. extern char *            tclExecutableName;
  761. extern TclEventSource *        tclFirstEventSourcePtr;
  762. extern Tcl_ChannelType         tclFileChannelType;
  763. extern char *            tclMemDumpFileName;
  764. extern TclPlatformType        tclPlatform;
  765.  
  766. /*
  767.  *----------------------------------------------------------------
  768.  * Procedures shared among Tcl modules but not used by the outside
  769.  * world:
  770.  *----------------------------------------------------------------
  771.  */
  772.  
  773. EXTERN void        panic();
  774. EXTERN int        TclCleanupChildren _ANSI_ARGS_((Tcl_Interp *interp,
  775.                     int numPids, int *pidPtr, Tcl_Channel errorChan));
  776. EXTERN int        TclCloseFile _ANSI_ARGS_((Tcl_File file));
  777. EXTERN char *        TclConvertToNative _ANSI_ARGS_((Tcl_Interp *interp,
  778.                 char *name, Tcl_DString *bufferPtr));
  779. EXTERN char *        TclConvertToNetwork _ANSI_ARGS_((Tcl_Interp *interp,
  780.                 char *name, Tcl_DString *bufferPtr));
  781. EXTERN void        TclCopyAndCollapse _ANSI_ARGS_((int count, char *src,
  782.                 char *dst));
  783. EXTERN int        TclChdir _ANSI_ARGS_((Tcl_Interp *interp,
  784.                 char *dirName));
  785. EXTERN void        TclClosePipeFile _ANSI_ARGS_((Tcl_File file));
  786. EXTERN Tcl_Channel    TclCreateCommandChannel _ANSI_ARGS_((
  787.                     Tcl_File readFile, Tcl_File writeFile,
  788.                 Tcl_File errorFile, int numPids, int *pidPtr));
  789. EXTERN int              TclCreatePipe _ANSI_ARGS_((Tcl_File *readPipe,
  790.                 Tcl_File *writePipe));
  791. EXTERN int        TclCreatePipeline _ANSI_ARGS_((Tcl_Interp *interp,
  792.                 int argc, char **argv, int **pidArrayPtr,
  793.                 Tcl_File *inPipePtr,
  794.                 Tcl_File *outPipePtr,
  795.                 Tcl_File *errFilePtr));
  796. EXTERN Tcl_File        TclCreateTempFile _ANSI_ARGS_((char *contents));
  797. EXTERN void        TclDeleteVars _ANSI_ARGS_((Interp *iPtr,
  798.                 Tcl_HashTable *tablePtr));
  799. EXTERN int        TclDoGlob _ANSI_ARGS_((Tcl_Interp *interp,
  800.                 char *separators, Tcl_DString *headPtr,
  801.                 char *tail));
  802. EXTERN void        TclExpandParseValue _ANSI_ARGS_((ParseValue *pvPtr,
  803.                 int needed));
  804. EXTERN void        TclExprFloatError _ANSI_ARGS_((Tcl_Interp *interp,
  805.                 double value));
  806. EXTERN int        TclFindElement _ANSI_ARGS_((Tcl_Interp *interp,
  807.                 char *list, char **elementPtr, char **nextPtr,
  808.                 int *sizePtr, int *bracePtr));
  809. EXTERN Proc *        TclFindProc _ANSI_ARGS_((Interp *iPtr,
  810.                 char *procName));
  811. EXTERN void        TclFreePackageInfo _ANSI_ARGS_((Interp *iPtr));
  812. EXTERN char *        TclGetCwd _ANSI_ARGS_((Tcl_Interp *interp));
  813. EXTERN unsigned long    TclGetClicks _ANSI_ARGS_((void));
  814. EXTERN char *        TclGetExtension _ANSI_ARGS_((char *name));
  815. EXTERN void        TclGetAndDetachPids _ANSI_ARGS_((Tcl_Interp *interp,
  816.                     Tcl_Channel chan));
  817. EXTERN int        TclGetDate _ANSI_ARGS_((char *p,
  818.                 unsigned long now, long zone,
  819.                 unsigned long *timePtr));
  820. EXTERN Tcl_Channel    TclGetDefaultStdChannel _ANSI_ARGS_((int type));
  821. EXTERN char *        TclGetEnv _ANSI_ARGS_((char *name));
  822. EXTERN int        TclGetFrame _ANSI_ARGS_((Tcl_Interp *interp,
  823.                 char *string, CallFrame **framePtrPtr));
  824. EXTERN int        TclGetOpenMode _ANSI_ARGS_((Tcl_Interp *interp,
  825.                     char *string, int *seekFlagPtr));
  826. EXTERN unsigned long    TclGetSeconds _ANSI_ARGS_((void));
  827. EXTERN void        TclGetTime _ANSI_ARGS_((Tcl_Time *time));
  828. EXTERN int        TclGetTimeZone _ANSI_ARGS_((unsigned long time));
  829. EXTERN char *        TclGetUserHome _ANSI_ARGS_((char *name,
  830.                 Tcl_DString *bufferPtr));
  831. EXTERN int        TclGetListIndex _ANSI_ARGS_((Tcl_Interp *interp,
  832.                 char *string, int *indexPtr));
  833. EXTERN int        TclGetLoadedPackages _ANSI_ARGS_((Tcl_Interp *interp,
  834.                 char *targetName));
  835. EXTERN char *        TclGetUserHome _ANSI_ARGS_((char *name,
  836.                 Tcl_DString *bufferPtr));
  837. EXTERN int        TclGuessPackageName _ANSI_ARGS_((char *fileName,
  838.                 Tcl_DString *bufPtr));
  839. EXTERN int              TclHasPipes _ANSI_ARGS_((void));
  840. EXTERN int        TclHasSockets _ANSI_ARGS_((Tcl_Interp *interp));
  841. EXTERN int        TclIdlePending _ANSI_ARGS_((void));
  842. EXTERN int        TclInterpInit _ANSI_ARGS_((Tcl_Interp *interp));
  843. EXTERN Proc *        TclIsProc _ANSI_ARGS_((Command *cmdPtr));
  844. EXTERN int        TclLoadFile _ANSI_ARGS_((Tcl_Interp *interp,
  845.                 char *fileName, char *sym1, char *sym2,
  846.                 Tcl_PackageInitProc **proc1Ptr,
  847.                 Tcl_PackageInitProc **proc2Ptr));
  848. EXTERN int        TclMakeFileTable _ANSI_ARGS_((Tcl_Interp *interp,
  849.                             int noStdio));
  850. EXTERN int        TclMatchFiles _ANSI_ARGS_((Tcl_Interp *interp,
  851.                 char *separators, Tcl_DString *dirPtr,
  852.                 char *pattern, char *tail));
  853. EXTERN int        TclNeedSpace _ANSI_ARGS_((char *start, char *end));
  854. EXTERN Tcl_File        TclOpenFile _ANSI_ARGS_((char *fname, int mode));
  855. EXTERN int        TclParseBraces _ANSI_ARGS_((Tcl_Interp *interp,
  856.                 char *string, char **termPtr, ParseValue *pvPtr));
  857. EXTERN int        TclParseNestedCmd _ANSI_ARGS_((Tcl_Interp *interp,
  858.                 char *string, int flags, char **termPtr,
  859.                 ParseValue *pvPtr));
  860. EXTERN int        TclParseQuotes _ANSI_ARGS_((Tcl_Interp *interp,
  861.                 char *string, int termChar, int flags,
  862.                 char **termPtr, ParseValue *pvPtr));
  863. EXTERN int        TclParseWords _ANSI_ARGS_((Tcl_Interp *interp,
  864.                 char *string, int flags, int maxWords,
  865.                 char **termPtr, int *argcPtr, char **argv,
  866.                 ParseValue *pvPtr));
  867. EXTERN void        TclPlatformExit _ANSI_ARGS_((int status));
  868. EXTERN void        TclPlatformInit _ANSI_ARGS_((Tcl_Interp *interp));
  869. EXTERN char *        TclPrecTraceProc _ANSI_ARGS_((ClientData clientData,
  870.                 Tcl_Interp *interp, char *name1, char *name2,
  871.                 int flags));
  872. EXTERN int        TclPreventAliasLoop _ANSI_ARGS_((Tcl_Interp *interp,
  873.                     Tcl_Interp *cmdInterp, char *cmdName,
  874.                             Tcl_CmdProc *proc, ClientData clientData));
  875. EXTERN int        TclReadFile _ANSI_ARGS_((Tcl_File file,
  876.                 int shouldBlock, char *buf, int toRead));
  877. EXTERN int        TclSeekFile _ANSI_ARGS_((Tcl_File file,
  878.                 int offset, int whence));
  879. EXTERN int        TclServiceIdle _ANSI_ARGS_((void));
  880. EXTERN void        TclSetupEnv _ANSI_ARGS_((Tcl_Interp *interp));
  881. EXTERN int        TclSockGetPort _ANSI_ARGS_((Tcl_Interp *interp,
  882.                     char *string, char *proto, int *portPtr));
  883. EXTERN int        TclSockMinimumBuffers _ANSI_ARGS_((int sock,
  884.                     int size));
  885. EXTERN int              TclSpawnPipeline _ANSI_ARGS_((Tcl_Interp *interp,
  886.                         int *pidPtr, int *numPids, int argc, char **argv,
  887.                 Tcl_File inputFile,
  888.                 Tcl_File outputFile,
  889.                         Tcl_File errorFile,
  890.                         char *intIn, char *finalOut));
  891. EXTERN int        TclTestChannelCmd _ANSI_ARGS_((ClientData clientData,
  892.                 Tcl_Interp *interp, int argc, char **argv));
  893. EXTERN int        TclTestChannelEventCmd _ANSI_ARGS_((
  894.                     ClientData clientData, Tcl_Interp *interp,
  895.                             int argc, char **argv));
  896. EXTERN int        TclUpdateReturnInfo _ANSI_ARGS_((Interp *iPtr));
  897. EXTERN int        TclWaitForFile _ANSI_ARGS_((Tcl_File file,
  898.                 int mask, int timeout));
  899. EXTERN char *        TclWordEnd _ANSI_ARGS_((char *start, int nested,
  900.                 int *semiPtr));
  901. EXTERN int        TclWriteFile _ANSI_ARGS_((Tcl_File file,
  902.                 int shouldBlock, char *buf, int toWrite));
  903.  
  904. /*
  905.  *----------------------------------------------------------------
  906.  * Command procedures in the generic core:
  907.  *----------------------------------------------------------------
  908.  */
  909.  
  910. EXTERN int    Tcl_AfterCmd _ANSI_ARGS_((ClientData clientData,
  911.             Tcl_Interp *interp, int argc, char **argv));
  912. EXTERN int    Tcl_AppendCmd _ANSI_ARGS_((ClientData clientData,
  913.             Tcl_Interp *interp, int argc, char **argv));
  914. EXTERN int    Tcl_ArrayCmd _ANSI_ARGS_((ClientData clientData,
  915.             Tcl_Interp *interp, int argc, char **argv));
  916. EXTERN int    Tcl_BreakCmd _ANSI_ARGS_((ClientData clientData,
  917.             Tcl_Interp *interp, int argc, char **argv));
  918. EXTERN int    Tcl_CaseCmd _ANSI_ARGS_((ClientData clientData,
  919.             Tcl_Interp *interp, int argc, char **argv));
  920. EXTERN int    Tcl_CatchCmd _ANSI_ARGS_((ClientData clientData,
  921.             Tcl_Interp *interp, int argc, char **argv));
  922. EXTERN int    Tcl_CdCmd _ANSI_ARGS_((ClientData clientData,
  923.             Tcl_Interp *interp, int argc, char **argv));
  924. EXTERN int    Tcl_ClockCmd _ANSI_ARGS_((ClientData clientData,
  925.             Tcl_Interp *interp, int argc, char **argv));
  926. EXTERN int    Tcl_CloseCmd _ANSI_ARGS_((ClientData clientData,
  927.             Tcl_Interp *interp, int argc, char **argv));
  928. EXTERN int    Tcl_ConcatCmd _ANSI_ARGS_((ClientData clientData,
  929.             Tcl_Interp *interp, int argc, char **argv));
  930. EXTERN int    Tcl_ContinueCmd _ANSI_ARGS_((ClientData clientData,
  931.             Tcl_Interp *interp, int argc, char **argv));
  932. EXTERN int     Tcl_CpCmd _ANSI_ARGS_((ClientData clientData,
  933.             Tcl_Interp *interp, int argc, char **argv));
  934. EXTERN int     Tcl_EchoCmd _ANSI_ARGS_((ClientData clientData,
  935.             Tcl_Interp *interp, int argc, char **argv));
  936. EXTERN int    Tcl_EofCmd _ANSI_ARGS_((ClientData clientData,
  937.             Tcl_Interp *interp, int argc, char **argv));
  938. EXTERN int    Tcl_ErrorCmd _ANSI_ARGS_((ClientData clientData,
  939.             Tcl_Interp *interp, int argc, char **argv));
  940. EXTERN int    Tcl_EvalCmd _ANSI_ARGS_((ClientData clientData,
  941.             Tcl_Interp *interp, int argc, char **argv));
  942. EXTERN int    Tcl_ExecCmd _ANSI_ARGS_((ClientData clientData,
  943.             Tcl_Interp *interp, int argc, char **argv));
  944. EXTERN int    Tcl_ExitCmd _ANSI_ARGS_((ClientData clientData,
  945.             Tcl_Interp *interp, int argc, char **argv));
  946. EXTERN int    Tcl_ExprCmd _ANSI_ARGS_((ClientData clientData,
  947.             Tcl_Interp *interp, int argc, char **argv));
  948. EXTERN int    Tcl_FblockedCmd _ANSI_ARGS_((ClientData clientData,
  949.             Tcl_Interp *interp, int argc, char **argv));
  950. EXTERN int    Tcl_FconfigureCmd _ANSI_ARGS_((ClientData clientData,
  951.             Tcl_Interp *interp, int argc, char **argv));
  952. EXTERN int    Tcl_FileCmd _ANSI_ARGS_((ClientData clientData,
  953.             Tcl_Interp *interp, int argc, char **argv));
  954. EXTERN int    Tcl_FileEventCmd _ANSI_ARGS_((ClientData clientData,
  955.             Tcl_Interp *interp, int argc, char **argv));
  956. EXTERN int    Tcl_FlushCmd _ANSI_ARGS_((ClientData clientData,
  957.             Tcl_Interp *interp, int argc, char **argv));
  958. EXTERN int    Tcl_ForCmd _ANSI_ARGS_((ClientData clientData,
  959.             Tcl_Interp *interp, int argc, char **argv));
  960. EXTERN int    Tcl_ForeachCmd _ANSI_ARGS_((ClientData clientData,
  961.             Tcl_Interp *interp, int argc, char **argv));
  962. EXTERN int    Tcl_FormatCmd _ANSI_ARGS_((ClientData clientData,
  963.             Tcl_Interp *interp, int argc, char **argv));
  964. EXTERN int    Tcl_GetsCmd _ANSI_ARGS_((ClientData clientData,
  965.             Tcl_Interp *interp, int argc, char **argv));
  966. EXTERN int    Tcl_GlobalCmd _ANSI_ARGS_((ClientData clientData,
  967.             Tcl_Interp *interp, int argc, char **argv));
  968. EXTERN int    Tcl_GlobCmd _ANSI_ARGS_((ClientData clientData,
  969.             Tcl_Interp *interp, int argc, char **argv));
  970. EXTERN int    Tcl_HistoryCmd _ANSI_ARGS_((ClientData clientData,
  971.             Tcl_Interp *interp, int argc, char **argv));
  972. EXTERN int    Tcl_IfCmd _ANSI_ARGS_((ClientData clientData,
  973.             Tcl_Interp *interp, int argc, char **argv));
  974. EXTERN int    Tcl_IncrCmd _ANSI_ARGS_((ClientData clientData,
  975.             Tcl_Interp *interp, int argc, char **argv));
  976. EXTERN int    Tcl_InfoCmd _ANSI_ARGS_((ClientData clientData,
  977.             Tcl_Interp *interp, int argc, char **argv));
  978. EXTERN int    Tcl_InterpCmd _ANSI_ARGS_((ClientData clientData,
  979.             Tcl_Interp *interp, int argc, char **argv));
  980. EXTERN int    Tcl_JoinCmd _ANSI_ARGS_((ClientData clientData,
  981.             Tcl_Interp *interp, int argc, char **argv));
  982. EXTERN int    Tcl_LappendCmd _ANSI_ARGS_((ClientData clientData,
  983.             Tcl_Interp *interp, int argc, char **argv));
  984. EXTERN int    Tcl_LindexCmd _ANSI_ARGS_((ClientData clientData,
  985.             Tcl_Interp *interp, int argc, char **argv));
  986. EXTERN int    Tcl_LinsertCmd _ANSI_ARGS_((ClientData clientData,
  987.             Tcl_Interp *interp, int argc, char **argv));
  988. EXTERN int    Tcl_LlengthCmd _ANSI_ARGS_((ClientData clientData,
  989.             Tcl_Interp *interp, int argc, char **argv));
  990. EXTERN int    Tcl_ListCmd _ANSI_ARGS_((ClientData clientData,
  991.             Tcl_Interp *interp, int argc, char **argv));
  992. EXTERN int    Tcl_LoadCmd _ANSI_ARGS_((ClientData clientData,
  993.             Tcl_Interp *interp, int argc, char **argv));
  994. EXTERN int    Tcl_LrangeCmd _ANSI_ARGS_((ClientData clientData,
  995.             Tcl_Interp *interp, int argc, char **argv));
  996. EXTERN int    Tcl_LreplaceCmd _ANSI_ARGS_((ClientData clientData,
  997.             Tcl_Interp *interp, int argc, char **argv));
  998. EXTERN int     Tcl_LsCmd _ANSI_ARGS_((ClientData clientData,
  999.             Tcl_Interp *interp, int argc, char **argv));
  1000. EXTERN int    Tcl_LsearchCmd _ANSI_ARGS_((ClientData clientData,
  1001.             Tcl_Interp *interp, int argc, char **argv));
  1002. EXTERN int    Tcl_LsortCmd _ANSI_ARGS_((ClientData clientData,
  1003.             Tcl_Interp *interp, int argc, char **argv));
  1004. EXTERN int     Tcl_MacBeepCmd _ANSI_ARGS_((ClientData clientData,
  1005.             Tcl_Interp *interp, int argc, char **argv));
  1006. EXTERN int     Tcl_MacSourceCmd _ANSI_ARGS_((ClientData clientData,
  1007.             Tcl_Interp *interp, int argc, char **argv));
  1008. EXTERN int     Tcl_MkdirCmd _ANSI_ARGS_((ClientData clientData,
  1009.             Tcl_Interp *interp, int argc, char **argv));
  1010. EXTERN int     Tcl_MvCmd _ANSI_ARGS_((ClientData clientData,
  1011.             Tcl_Interp *interp, int argc, char **argv));
  1012. EXTERN int    Tcl_OpenCmd _ANSI_ARGS_((ClientData clientData,
  1013.             Tcl_Interp *interp, int argc, char **argv));
  1014. EXTERN int    Tcl_PackageCmd _ANSI_ARGS_((ClientData clientData,
  1015.             Tcl_Interp *interp, int argc, char **argv));
  1016. EXTERN int    Tcl_PidCmd _ANSI_ARGS_((ClientData clientData,
  1017.             Tcl_Interp *interp, int argc, char **argv));
  1018. EXTERN int    Tcl_ProcCmd _ANSI_ARGS_((ClientData clientData,
  1019.             Tcl_Interp *interp, int argc, char **argv));
  1020. EXTERN int    Tcl_PutsCmd _ANSI_ARGS_((ClientData clientData,
  1021.             Tcl_Interp *interp, int argc, char **argv));
  1022. EXTERN int    Tcl_PwdCmd _ANSI_ARGS_((ClientData clientData,
  1023.             Tcl_Interp *interp, int argc, char **argv));
  1024. EXTERN int    Tcl_ReadCmd _ANSI_ARGS_((ClientData clientData,
  1025.             Tcl_Interp *interp, int argc, char **argv));
  1026. EXTERN int    Tcl_RegexpCmd _ANSI_ARGS_((ClientData clientData,
  1027.             Tcl_Interp *interp, int argc, char **argv));
  1028. EXTERN int    Tcl_RegsubCmd _ANSI_ARGS_((ClientData clientData,
  1029.             Tcl_Interp *interp, int argc, char **argv));
  1030. EXTERN int    Tcl_RenameCmd _ANSI_ARGS_((ClientData clientData,
  1031.             Tcl_Interp *interp, int argc, char **argv));
  1032. EXTERN int    Tcl_ReturnCmd _ANSI_ARGS_((ClientData clientData,
  1033.             Tcl_Interp *interp, int argc, char **argv));
  1034. EXTERN int     Tcl_RmCmd _ANSI_ARGS_((ClientData clientData,
  1035.             Tcl_Interp *interp, int argc, char **argv));
  1036. EXTERN int     Tcl_RmdirCmd _ANSI_ARGS_((ClientData clientData,
  1037.             Tcl_Interp *interp, int argc, char **argv));
  1038. EXTERN int    Tcl_ScanCmd _ANSI_ARGS_((ClientData clientData,
  1039.             Tcl_Interp *interp, int argc, char **argv));
  1040. EXTERN int    Tcl_SeekCmd _ANSI_ARGS_((ClientData clientData,
  1041.             Tcl_Interp *interp, int argc, char **argv));
  1042. EXTERN int    Tcl_SetCmd _ANSI_ARGS_((ClientData clientData,
  1043.             Tcl_Interp *interp, int argc, char **argv));
  1044. EXTERN int    Tcl_SplitCmd _ANSI_ARGS_((ClientData clientData,
  1045.             Tcl_Interp *interp, int argc, char **argv));
  1046. EXTERN int    Tcl_SocketCmd _ANSI_ARGS_((ClientData clientData,
  1047.             Tcl_Interp *interp, int argc, char **argv));
  1048. EXTERN int    Tcl_SourceCmd _ANSI_ARGS_((ClientData clientData,
  1049.             Tcl_Interp *interp, int argc, char **argv));
  1050. EXTERN int    Tcl_StringCmd _ANSI_ARGS_((ClientData clientData,
  1051.             Tcl_Interp *interp, int argc, char **argv));
  1052. EXTERN int    Tcl_SubstCmd _ANSI_ARGS_((ClientData clientData,
  1053.             Tcl_Interp *interp, int argc, char **argv));
  1054. EXTERN int    Tcl_SwitchCmd _ANSI_ARGS_((ClientData clientData,
  1055.             Tcl_Interp *interp, int argc, char **argv));
  1056. EXTERN int    Tcl_TellCmd _ANSI_ARGS_((ClientData clientData,
  1057.             Tcl_Interp *interp, int argc, char **argv));
  1058. EXTERN int    Tcl_TimeCmd _ANSI_ARGS_((ClientData clientData,
  1059.             Tcl_Interp *interp, int argc, char **argv));
  1060. EXTERN int    Tcl_TraceCmd _ANSI_ARGS_((ClientData clientData,
  1061.             Tcl_Interp *interp, int argc, char **argv));
  1062. EXTERN int    Tcl_UnsetCmd _ANSI_ARGS_((ClientData clientData,
  1063.             Tcl_Interp *interp, int argc, char **argv));
  1064. EXTERN int    Tcl_UpdateCmd _ANSI_ARGS_((ClientData clientData,
  1065.             Tcl_Interp *interp, int argc, char **argv));
  1066. EXTERN int    Tcl_UplevelCmd _ANSI_ARGS_((ClientData clientData,
  1067.             Tcl_Interp *interp, int argc, char **argv));
  1068. EXTERN int    Tcl_UpvarCmd _ANSI_ARGS_((ClientData clientData,
  1069.             Tcl_Interp *interp, int argc, char **argv));
  1070. EXTERN int    Tcl_VwaitCmd _ANSI_ARGS_((ClientData clientData,
  1071.             Tcl_Interp *interp, int argc, char **argv));
  1072. EXTERN int    Tcl_WhileCmd _ANSI_ARGS_((ClientData clientData,
  1073.             Tcl_Interp *interp, int argc, char **argv));
  1074. EXTERN int    TclUnsupported0Cmd _ANSI_ARGS_((ClientData clientData,
  1075.             Tcl_Interp *interp, int argc, char **argv));
  1076.  
  1077. #endif /* _TCLINT */
  1078.