]>
git.zerfleddert.de Git - micropolis/blob - src/tclx/src/tclxint.h
5cacb4800be1653fa67e16e1fc0c21089192d595
4 * Standard internal include file for Extended Tcl library..
5 *-----------------------------------------------------------------------------
6 * Copyright 1992 Karl Lehenbauer and Mark Diekhans.
8 * Permission to use, copy, modify, and distribute this software and its
9 * documentation for any purpose and without fee is hereby granted, provided
10 * that the above copyright notice appear in all copies. Karl Lehenbauer and
11 * Mark Diekhans make no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
14 *-----------------------------------------------------------------------------
15 * $Id: tclExtdInt.h,v 2.0 1992/10/16 04:51:27 markd Rel $
16 *-----------------------------------------------------------------------------
25 #include <sys/param.h>
29 #ifdef TCL_NEED_SYS_SELECT_H
30 # include "sys/select.h"
34 * If tclUnix.h has already included time.h, don't include it again, some
35 * systems don't #ifdef inside of the file. On some systems, undef
36 * CLK_TCK (defined in tclUnix.h) to avoid an annoying warning about
39 #ifdef TCL_NEED_TIME_H
41 # ifdef TCL_DUP_CLK_TCK
49 * Precompute milliseconds-per-tick, the " + CLK_TCK / 2" bit gets it to
50 * round off instead of truncate. Take care of defining CLK_TCK if its not
61 #define MS_PER_TICK ((1000 + CLK_TCK/2) / CLK_TCK)
64 * If tclUnix.h did not bring times.h, bring it in here.
67 # include <sys/times.h>
73 #define MAXDOUBLE DBL_MAX
76 * On some systems this is not included by tclUnix.h.
80 * These should be take from an include file, but it got to be such a mess
81 * to get the include files right that they are here for good measure.
84 struct tm
*localtime ();
87 # define BITSPERBYTE 8
88 # define BITS(type) (BITSPERBYTE * (int)sizeof(type))
89 # define HIBITI ((unsigned int)(1 << BITS(int) - 1))
90 # define MAXINT ((int)(~HIBITI))
94 # define MININT (-MAXINT)-1
103 * Structure to hold a regular expression, plus a Boyer-Moore compiled
107 typedef struct regexp_t
{
112 typedef regexp_t
*regexp_pt
;
114 * Flags used by RegExpCompile:
116 #define REXP_NO_CASE 1 /* Do matching regardless of case */
117 #define REXP_BOTH_ALGORITHMS 2 /* Use boyer-moore along with regexp */
120 * Data structure to control a dynamic buffer. These buffers are primarly
121 * used for reading things from files, were the maximum size is not known
122 * in advance, and the buffer must grow. These are used in the case were
123 * the value is not to be returned as the interpreter result.
126 #define INIT_DYN_BUFFER_SIZE 256
128 typedef struct dynamicBuf_t
{
129 char buf
[INIT_DYN_BUFFER_SIZE
]; /* Initial buffer area. */
130 char *ptr
; /* Pointer to buffer area. */
131 int size
; /* Current size of buffer. */
132 int len
; /* Current string length (less '\0') */
136 * Used to return argument messages by most commands.
138 extern char *tclXWrongArgs
;
141 * Macros to do string compares. They pre-check the first character before
142 * checking of the strings are equal.
145 #define STREQU(str1, str2) \
146 (((str1) [0] == (str2) [0]) && (strcmp (str1, str2) == 0))
147 #define STRNEQU(str1, str2, cnt) \
148 (((str1) [0] == (str2) [0]) && (strncmp (str1, str2, cnt) == 0))
151 * Prototypes for utility procedures.
154 Tcl_DynBufInit
_ANSI_ARGS_((dynamicBuf_t
*dynBufPtr
));
157 Tcl_DynBufFree
_ANSI_ARGS_((dynamicBuf_t
*dynBufPtr
));
160 Tcl_DynBufReturn
_ANSI_ARGS_((Tcl_Interp
*interp
,
161 dynamicBuf_t
*dynBufPtr
));
164 Tcl_DynBufAppend
_ANSI_ARGS_((dynamicBuf_t
*dynBufPtr
,
168 Tcl_ExpandDynBuf
_ANSI_ARGS_((dynamicBuf_t
*dynBufPtr
,
172 Tcl_DynamicFgets
_ANSI_ARGS_((dynamicBuf_t
*dynBufPtr
,
177 Tcl_ConvertFileHandle
_ANSI_ARGS_((Tcl_Interp
*interp
,
181 Tcl_GetDate
_ANSI_ARGS_((char *p
,
186 Tcl_ProcessSignal
_ANSI_ARGS_((Tcl_Interp
*interp
,
190 Tcl_RegExpClean
_ANSI_ARGS_((regexp_pt regExpPtr
));
193 Tcl_RegExpCompile
_ANSI_ARGS_((Tcl_Interp
*interp
,
199 Tcl_RegExpExecute
_ANSI_ARGS_((Tcl_Interp
*interp
,
202 char *matchStrLower
));
207 Tcl_ReturnDouble
_ANSI_ARGS_((Tcl_Interp
*interp
,
211 Tcl_SetupFileEntry
_ANSI_ARGS_((Tcl_Interp
*interp
,
217 * Definitions required to initialize all extended commands. These are either
218 * the command executors or initialization routines that do the command
219 * initialization. The initialization routines are used when there is more
220 * to initializing the command that just binding the command name to the
221 * executor. Usually, this means initializing some command local data via
222 * the ClientData mechanism. The command executors should be declared to be of
223 * type `Tcl_CmdProc', but this blows up some compilers, so they are declared
224 * with an ANSI prototype.
231 Tcl_BsearchCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
237 Tcl_ChmodCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
240 Tcl_ChownCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
243 Tcl_ChgrpCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
249 Tcl_GetclockCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
252 Tcl_FmtclockCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
255 * from tclXcnvclock.c
258 Tcl_ConvertclockCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
264 Tcl_CommandloopCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
270 Tcl_InitDebug
_ANSI_ARGS_((Tcl_Interp
*interp
));
276 Tcl_DupCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
282 Tcl_FcntlCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
285 * from tclXfilecmds.c
288 Tcl_PipeCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
291 Tcl_CopyfileCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
294 Tcl_FstatCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
297 Tcl_LgetsCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
300 Tcl_FlockCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
303 Tcl_FunlockCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
306 * from tclXfilescan.c
309 Tcl_InitFilescan
_ANSI_ARGS_((Tcl_Interp
*interp
));
315 Tcl_AcosCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
318 Tcl_AsinCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
321 Tcl_AtanCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
324 Tcl_CosCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
327 Tcl_SinCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
330 Tcl_TanCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
333 Tcl_CoshCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
336 Tcl_SinhCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
339 Tcl_TanhCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
342 Tcl_ExpCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
345 Tcl_LogCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
348 Tcl_Log10Cmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
351 Tcl_SqrtCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
354 Tcl_FabsCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
357 Tcl_FloorCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
360 Tcl_CeilCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
363 Tcl_FmodCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
366 Tcl_PowCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
373 Tcl_EchoCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
376 Tcl_InfoxCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
379 Tcl_LoopCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
385 Tcl_IdCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
391 Tcl_KeyldelCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
394 Tcl_KeylgetCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
397 Tcl_KeylkeysCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
400 Tcl_KeylsetCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
406 Tcl_LvarpopCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
409 Tcl_LvarcatCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
412 Tcl_LvarpushCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
415 Tcl_LemptyCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
421 Tcl_MaxCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
424 Tcl_MinCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
427 Tcl_RandomCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
433 Tcl_InitMsgCat
_ANSI_ARGS_((Tcl_Interp
*interp
));
439 Tcl_ExeclCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
442 Tcl_ForkCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
445 Tcl_WaitCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
451 Tcl_InitProfile
_ANSI_ARGS_((Tcl_Interp
*interp
));
457 Tcl_SelectCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
463 Tcl_InitSignalHandling
_ANSI_ARGS_((Tcl_Interp
*interp
));
469 Tcl_CindexCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
472 Tcl_ClengthCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
475 Tcl_CrangeCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
478 Tcl_ReplicateCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
481 Tcl_TranslitCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
484 Tcl_CtypeCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
490 Tcl_Demand_loadCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
493 Tcl_LoadlibindexCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
496 * from tclXunixcmds.c
499 Tcl_AlarmCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
502 Tcl_SleepCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
505 Tcl_SystemCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
508 Tcl_TimesCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
511 Tcl_UmaskCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
514 Tcl_LinkCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
517 Tcl_UnlinkCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
520 Tcl_MkdirCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));
523 Tcl_RmdirCmd
_ANSI_ARGS_((ClientData
, Tcl_Interp
*, int, char**));