home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 0 / 0987 / tcl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-28  |  4.4 KB  |  165 lines

  1. /*
  2.  * tcl.h --
  3.  *
  4.  *    This header file describes the externally-visible facilities
  5.  *    of the Tcl interpreter.
  6.  *
  7.  * Copyright 1987 Regents of the University of California
  8.  * Permission to use, copy, modify, and distribute this
  9.  * software and its documentation for any purpose and without
  10.  * fee is hereby granted, provided that the above copyright
  11.  * notice appear in all copies.  The University of California
  12.  * makes no representations about the suitability of this
  13.  * software for any purpose.  It is provided "as is" without
  14.  * express or implied warranty.
  15.  *
  16.  * $Header: /sprite/src/lib/tcl/RCS/tcl.h,v 1.33 90/01/15 14:06:02 ouster Exp $ SPRITE (Berkeley)
  17.  */
  18.  
  19. #ifndef _TCL
  20. #define _TCL
  21.  
  22. /*
  23.  * Data structures defined opaquely in this module.  The definitions
  24.  * below just provide dummy types.  A few fields are made visible in
  25.  * Tcl_Interp structures, namely those for returning string values.
  26.  * Note:  any change to the Tcl_Interp definition below must be mirrored
  27.  * in the "real" definition in tclInt.h.
  28.  */
  29.  
  30. typedef struct {
  31.     char *result;        /* Points to result string returned by last
  32.                  * command. */
  33.     int dynamic;        /* Non-zero means result is dynamically-
  34.                  * allocated and must be freed by Tcl_Eval
  35.                  * before executing the next command. */
  36.     int errorLine;        /* When TCL_ERROR is returned, this gives
  37.                  * the line number within the command where
  38.                  * the error occurred (1 means first line). */
  39. } Tcl_Interp;
  40. typedef int *Tcl_Trace;
  41.  
  42. /*
  43.  * When a TCL command returns, the string pointer interp->result points to
  44.  * a string containing return information from the command.  In addition,
  45.  * the command procedure returns an integer value, which is one of the
  46.  * following:
  47.  *
  48.  * TCL_OK        Command completed normally;  interp->result contains
  49.  *            the command's result.
  50.  * TCL_ERROR        The command couldn't be completed successfully;
  51.  *            interp->result describes what went wrong.
  52.  * TCL_RETURN        The command requests that the current procedure
  53.  *            return;  interp->result contains the procedure's
  54.  *            return value.
  55.  * TCL_BREAK        The command requests that the innermost loop
  56.  *            be exited;  interp->result is meaningless.
  57.  * TCL_CONTINUE        Go on to the next iteration of the current loop;
  58.  *            interp->result is meaninless.
  59.  */
  60.  
  61. #define TCL_OK        0
  62. #define TCL_ERROR    1
  63. #define TCL_RETURN    2
  64. #define TCL_BREAK    3
  65. #define TCL_CONTINUE    4
  66.  
  67. #define TCL_RESULT_SIZE 199
  68.  
  69. /*
  70.  * Flag values passed to Tcl_Eval (see the man page for details):
  71.  */
  72.  
  73. #define TCL_BRACKET_TERM    1
  74.  
  75. /*
  76.  * Flag values passed to Tcl_Return (see the man page for details):
  77.  */
  78.  
  79. #define TCL_STATIC    0
  80. #define TCL_DYNAMIC    1
  81. #define TCL_VOLATILE    2
  82.  
  83. /*
  84.  * Exported Tcl procedures:
  85.  */
  86.  
  87. extern void        Tcl_AddErrorInfo();
  88. extern char        Tcl_Backslash();
  89. extern char *        Tcl_Concat();
  90. extern void        Tcl_CreateCommand();
  91. extern Tcl_Interp *    Tcl_CreateInterp();
  92. extern Tcl_Trace    Tcl_CreateTrace();
  93. extern void        Tcl_DeleteCommand();
  94. extern void        Tcl_DeleteInterp();
  95. extern void        Tcl_DeleteTrace();
  96. extern int        Tcl_Eval();
  97. extern int        Tcl_Expr();
  98. extern char *        Tcl_GetVar();
  99. extern char *        Tcl_Merge();
  100. extern char *        Tcl_ParseVar();
  101. extern void        Tcl_Return();
  102. extern void        Tcl_SetVar();
  103. extern int        Tcl_SplitList();
  104. extern int        Tcl_StringMatch();
  105. extern void        Tcl_WatchInterp();
  106.  
  107. /*
  108.  * Built-in Tcl command procedures:
  109.  */
  110.  
  111. extern int        Tcl_BreakCmd();
  112. extern int        Tcl_CaseCmd();
  113. extern int        Tcl_CatchCmd();
  114. extern int        Tcl_ConcatCmd();
  115. extern int        Tcl_ContinueCmd();
  116. extern int        Tcl_ErrorCmd();
  117. extern int        Tcl_EvalCmd();
  118. extern int        Tcl_ExecCmd();
  119. extern int        Tcl_ExprCmd();
  120. extern int        Tcl_FileCmd();
  121. extern int        Tcl_ForCmd();
  122. extern int        Tcl_ForeachCmd();
  123. extern int        Tcl_FormatCmd();
  124. extern int        Tcl_GlobCmd();
  125. extern int        Tcl_GlobalCmd();
  126. extern int        Tcl_IfCmd();
  127. extern int        Tcl_InfoCmd();
  128. extern int        Tcl_IndexCmd();
  129. extern int        Tcl_LengthCmd();
  130. extern int        Tcl_ListCmd();
  131. extern int        Tcl_PrintCmd();
  132. extern int        Tcl_ProcCmd();
  133. extern int        Tcl_RangeCmd();
  134. extern int        Tcl_RenameCmd();
  135. extern int        Tcl_ReturnCmd();
  136. extern int        Tcl_ScanCmd();
  137. extern int        Tcl_SetCmd();
  138. extern int        Tcl_SourceCmd();
  139. extern int        Tcl_StringCmd();
  140. extern int        Tcl_TimeCmd();
  141. extern int        Tcl_UplevelCmd();
  142.  
  143. /*
  144.  * Miscellaneous declarations (to allow Tcl to be used stand-alone,
  145.  * without the rest of Sprite).
  146.  */
  147.  
  148. #ifndef NULL
  149. #define NULL 0
  150. #endif
  151.  
  152. #ifndef _CLIENTDATA
  153. typedef int *ClientData;
  154. #define _CLIENTDATA
  155. #endif
  156.  
  157. #include "ckalloc.h"
  158.  
  159. /* Portability stuff */
  160. #ifndef BSD
  161. #define bcopy(f,t,l) memcpy(t,f,l)
  162. #endif
  163.  
  164. #endif /* _TCL */
  165.