]> git.zerfleddert.de Git - micropolis/blame - src/tclx/src/tclxint.h
let bundled tcl compile with recent tools
[micropolis] / src / tclx / src / tclxint.h
CommitLineData
6a5fa4e0
MG
1/*
2 * tclExtdInt.h
3 *
4 * Standard internal include file for Extended Tcl library..
5 *-----------------------------------------------------------------------------
6 * Copyright 1992 Karl Lehenbauer and Mark Diekhans.
7 *
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
13 * implied warranty.
14 *-----------------------------------------------------------------------------
15 * $Id: tclExtdInt.h,v 2.0 1992/10/16 04:51:27 markd Rel $
16 *-----------------------------------------------------------------------------
17 */
18
19#ifndef TCLEXTDINT_H
20#define TCLEXTDINT_H
21
22#include "tclxtend.h"
23#include "tclint.h"
24#include "tclunix.h"
25#include <sys/param.h>
26#include <unistd.h>
27
28
29#ifdef TCL_NEED_SYS_SELECT_H
30# include "sys/select.h"
31#endif
32
33/*
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
37 * redefinition.
38 */
39#ifdef TCL_NEED_TIME_H
40# if TCL_SYS_TIME_H
41# ifdef TCL_DUP_CLK_TCK
42# undef CLK_TCK
43# endif
44# include <time.h>
45# endif
46#endif
47
48/*
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
51 * defined.
52 */
53#ifndef CLK_TCK
54# ifdef HZ
55# define CLK_TCK HZ
56# else
57# define CLK_TCK 60
58# endif
59#endif
60
61#define MS_PER_TICK ((1000 + CLK_TCK/2) / CLK_TCK)
62
63/*
64 * If tclUnix.h did not bring times.h, bring it in here.
65 */
66#if TCL_GETTOD
67# include <sys/times.h>
68#endif
69
f764718e
MG
70//#include "values.h"
71#include <limits.h>
72#include <float.h>
73#define MAXDOUBLE DBL_MAX
6a5fa4e0
MG
74#include <grp.h>
75/*
76 * On some systems this is not included by tclUnix.h.
77 */
78
79/*
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.
82 */
83struct tm *gmtime ();
84struct tm *localtime ();
85
86#ifndef MAXINT
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))
91#endif
92
93#ifndef MININT
94# define MININT (-MAXINT)-1
95#endif
96
97#ifndef TRUE
98# define TRUE (1)
99# define FALSE (0)
100#endif
101
102/*
103 * Structure to hold a regular expression, plus a Boyer-Moore compiled
104 * pattern.
105 */
106
107typedef struct regexp_t {
108 regexp *progPtr;
109 char *boyerMoorePtr;
110 int noCase;
111 } regexp_t;
112typedef regexp_t *regexp_pt;
113/*
114 * Flags used by RegExpCompile:
115 */
116#define REXP_NO_CASE 1 /* Do matching regardless of case */
117#define REXP_BOTH_ALGORITHMS 2 /* Use boyer-moore along with regexp */
118
119/*
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.
124 */
125
126#define INIT_DYN_BUFFER_SIZE 256
127
128typedef 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') */
133 } dynamicBuf_t;
134
135/*
136 * Used to return argument messages by most commands.
137 */
138extern char *tclXWrongArgs;
139
140/*
141 * Macros to do string compares. They pre-check the first character before
142 * checking of the strings are equal.
143 */
144
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))
149
150/*
151 * Prototypes for utility procedures.
152 */
153void
154Tcl_DynBufInit _ANSI_ARGS_((dynamicBuf_t *dynBufPtr));
155
156void
157Tcl_DynBufFree _ANSI_ARGS_((dynamicBuf_t *dynBufPtr));
158
159void
160Tcl_DynBufReturn _ANSI_ARGS_((Tcl_Interp *interp,
161 dynamicBuf_t *dynBufPtr));
162
163void
164Tcl_DynBufAppend _ANSI_ARGS_((dynamicBuf_t *dynBufPtr,
165 char *newStr));
166
167void
168Tcl_ExpandDynBuf _ANSI_ARGS_((dynamicBuf_t *dynBufPtr,
169 int appendSize));
170
171int
172Tcl_DynamicFgets _ANSI_ARGS_((dynamicBuf_t *dynBufPtr,
173 FILE *filePtr,
174 int append));
175
176int
177Tcl_ConvertFileHandle _ANSI_ARGS_((Tcl_Interp *interp,
178 char *handle));
179
180time_t
181Tcl_GetDate _ANSI_ARGS_((char *p,
182 time_t now,
183 long zone));
184
185int
186Tcl_ProcessSignal _ANSI_ARGS_((Tcl_Interp *interp,
187 int cmdResultCode));
188
189void
190Tcl_RegExpClean _ANSI_ARGS_((regexp_pt regExpPtr));
191
192int
193Tcl_RegExpCompile _ANSI_ARGS_((Tcl_Interp *interp,
194 regexp_pt regExpPtr,
195 char *expression,
196 int flags));
197
198int
199Tcl_RegExpExecute _ANSI_ARGS_((Tcl_Interp *interp,
200 regexp_pt regExpPtr,
201 char *matchStrIn,
202 char *matchStrLower));
203void
204Tcl_ResetSignals ();
205
206int
207Tcl_ReturnDouble _ANSI_ARGS_((Tcl_Interp *interp,
208 double number));
209
210int
211Tcl_SetupFileEntry _ANSI_ARGS_((Tcl_Interp *interp,
212 int fileNum,
213 int readable,
214 int writable));
215
216/*
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.
225 */
226
227/*
228 * from tclXbsearch.c
229 */
230extern int
231Tcl_BsearchCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
232
233/*
234 * from tclXchmod.c
235 */
236extern int
237Tcl_ChmodCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
238
239extern int
240Tcl_ChownCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
241
242extern int
243Tcl_ChgrpCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
244
245/*
246 * from tclXclock.c
247 */
248extern int
249Tcl_GetclockCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
250
251extern int
252Tcl_FmtclockCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
253
254/*
255 * from tclXcnvclock.c
256 */
257extern int
258Tcl_ConvertclockCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
259
260/*
261 * from tclXcmdloop.c
262 */
263extern int
264Tcl_CommandloopCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
265
266/*
267 * from tclXdebug.c
268 */
269extern void
270Tcl_InitDebug _ANSI_ARGS_((Tcl_Interp *interp));
271
272/*
273 * from tclXdup.c
274 */
275extern int
276Tcl_DupCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
277
278/*
279 * from tclXfcntl.c
280 */
281extern int
282Tcl_FcntlCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
283
284/*
285 * from tclXfilecmds.c
286 */
287extern int
288Tcl_PipeCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
289
290extern int
291Tcl_CopyfileCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
292
293extern int
294Tcl_FstatCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
295
296extern int
297Tcl_LgetsCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
298
299extern int
300Tcl_FlockCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
301
302extern int
303Tcl_FunlockCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
304
305/*
306 * from tclXfilescan.c
307 */
308extern void
309Tcl_InitFilescan _ANSI_ARGS_((Tcl_Interp *interp));
310
311/*
312 * from tclXfmath.c
313 */
314extern int
315Tcl_AcosCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
316
317extern int
318Tcl_AsinCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
319
320extern int
321Tcl_AtanCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
322
323extern int
324Tcl_CosCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
325
326extern int
327Tcl_SinCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
328
329extern int
330Tcl_TanCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
331
332extern int
333Tcl_CoshCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
334
335extern int
336Tcl_SinhCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
337
338extern int
339Tcl_TanhCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
340
341extern int
342Tcl_ExpCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
343
344extern int
345Tcl_LogCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
346
347extern int
348Tcl_Log10Cmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
349
350extern int
351Tcl_SqrtCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
352
353extern int
354Tcl_FabsCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
355
356extern int
357Tcl_FloorCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
358
359extern int
360Tcl_CeilCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
361
362extern int
363Tcl_FmodCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
364
365extern int
366Tcl_PowCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
367
368/*
369 * from tclXgeneral.c
370 */
371
372extern int
373Tcl_EchoCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
374
375extern int
376Tcl_InfoxCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
377
378extern int
379Tcl_LoopCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
380
381/*
382 * from tclXid.c
383 */
384extern int
385Tcl_IdCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
386
387/*
388 * from tclXkeylist.c
389 */
390extern int
391Tcl_KeyldelCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
392
393extern int
394Tcl_KeylgetCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
395
396extern int
397Tcl_KeylkeysCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
398
399extern int
400Tcl_KeylsetCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
401
402/*
403 * from tclXlist.c
404 */
405extern int
406Tcl_LvarpopCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
407
408extern int
409Tcl_LvarcatCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
410
411extern int
412Tcl_LvarpushCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
413
414extern int
415Tcl_LemptyCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
416
417/*
418 * from tclXmath.c
419 */
420extern int
421Tcl_MaxCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
422
423extern int
424Tcl_MinCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
425
426extern int
427Tcl_RandomCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
428
429/*
430 * from tclXmsgcat.c
431 */
432extern void
433Tcl_InitMsgCat _ANSI_ARGS_((Tcl_Interp *interp));
434
435/*
436 * from tclXprocess.c
437 */
438extern int
439Tcl_ExeclCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
440
441extern int
442Tcl_ForkCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
443
444extern int
445Tcl_WaitCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
446
447/*
448 * from tclXprofile.c
449 */
450void
451Tcl_InitProfile _ANSI_ARGS_((Tcl_Interp *interp));
452
453/*
454 * from tclXselect.c
455 */
456extern int
457Tcl_SelectCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
458
459/*
460 * from tclXsignal.c
461 */
462extern void
463Tcl_InitSignalHandling _ANSI_ARGS_((Tcl_Interp *interp));
464
465/*
466 * from tclXstring.c
467 */
468extern int
469Tcl_CindexCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
470
471extern int
472Tcl_ClengthCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
473
474extern int
475Tcl_CrangeCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
476
477extern int
478Tcl_ReplicateCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
479
480extern int
481Tcl_TranslitCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
482
483extern int
484Tcl_CtypeCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
485
486/*
487 * from tclXlib.c
488 */
489extern int
490Tcl_Demand_loadCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
491
492extern int
493Tcl_LoadlibindexCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
494
495/*
496 * from tclXunixcmds.c
497 */
498extern int
499Tcl_AlarmCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
500
501extern int
502Tcl_SleepCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
503
504extern int
505Tcl_SystemCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
506
507extern int
508Tcl_TimesCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
509
510extern int
511Tcl_UmaskCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
512
513extern int
514Tcl_LinkCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
515
516extern int
517Tcl_UnlinkCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
518
519extern int
520Tcl_MkdirCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
521
522extern int
523Tcl_RmdirCmd _ANSI_ARGS_((ClientData, Tcl_Interp*, int, char**));
524
525#endif
Impressum, Datenschutz