1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

dtdocbook: Change to ANSI function definitions

This commit is contained in:
Peter Howkins 2018-06-28 04:12:10 +01:00
parent 3baf0744f2
commit 948baafd17
51 changed files with 2295 additions and 1978 deletions

View file

@ -101,7 +101,7 @@ static char *br_help_msg[] = {
/* ______________________________________________________________________ */ /* ______________________________________________________________________ */
void void
Browse() Browse(void)
{ {
char buf[256], *cmd, **av, **sv, *cmapfile, *sdatafile; char buf[256], *cmd, **av, **sv, *cmapfile, *sdatafile;
char *Prompt; char *Prompt;

View file

@ -279,7 +279,7 @@ PrintStats(
*/ */
void void
PrintIDList() PrintIDList(void)
{ {
ID_t *id; ID_t *id;
Element_t *ep; Element_t *ep;

View file

@ -127,7 +127,7 @@ static int TclReadLocaleStrings(ClientData clientData,
char *GetOutFileBaseName(); char *GetOutFileBaseName();
char * char *
GetCLocale() GetCLocale(void)
{ {
_DtXlateDb myDb = NULL; _DtXlateDb myDb = NULL;
char myPlatform[_DtPLATFORM_MAX_LEN+1]; char myPlatform[_DtPLATFORM_MAX_LEN+1];
@ -552,7 +552,7 @@ Initialize1(
/* Initialization stuff done after dealing with args. */ /* Initialization stuff done after dealing with args. */
static void static void
Initialize2() Initialize2(void)
{ {
SetMappingNV(Variables, "transpec", tranfile ? tranfile : "??"); SetMappingNV(Variables, "transpec", tranfile ? tranfile : "??");
@ -582,7 +582,7 @@ Initialize2()
* Arguments: * Arguments:
* *
*/ */
char *GetOutFileBaseName() char *GetOutFileBaseName(void)
{ {
char *prefix, *suffix, *cp; char *prefix, *suffix, *cp;
static char nameBuf[_MAXNAMLEN+1] = ""; static char nameBuf[_MAXNAMLEN+1] = "";
@ -761,7 +761,7 @@ static char *help_msg[] = {
}; };
static void static void
DoHelpMessage() DoHelpMessage(void)
{ {
char **s = help_msg; char **s = help_msg;
printf("usage: %s [option ...] [file]", this_prog); printf("usage: %s [option ...] [file]", this_prog);

View file

@ -601,7 +601,7 @@ if (cp->type == CMD_DATA)
*/ */
void void
GetIDREFnames() GetIDREFnames(void)
{ {
char *cp; char *cp;

View file

@ -608,7 +608,7 @@ OutputString(
/* ______________________________________________________________________ */ /* ______________________________________________________________________ */
/* resets the output buffer /* resets the output buffer
*/ */
void ClearOutputBuffer() void ClearOutputBuffer(void)
{ {
outputBuffer.current = outputBuffer.base; outputBuffer.current = outputBuffer.base;
} }
@ -617,7 +617,7 @@ outputBuffer.current = outputBuffer.base;
/* determines if there is already some text in the output buffer, /* determines if there is already some text in the output buffer,
* returns 1 if so, else 0 * returns 1 if so, else 0
*/ */
int OutputBufferActive() int OutputBufferActive(void)
{ {
return (outputBuffer.current != outputBuffer.base); return (outputBuffer.current != outputBuffer.base);
} }
@ -625,7 +625,7 @@ return (outputBuffer.current != outputBuffer.base);
/* ______________________________________________________________________ */ /* ______________________________________________________________________ */
/* terminates output buffer with a null char and returns the buffer /* terminates output buffer with a null char and returns the buffer
*/ */
char *GetOutputBuffer() char *GetOutputBuffer(void)
{ {
if (CheckOutputBuffer(1)) if (CheckOutputBuffer(1))
*(outputBuffer.current)++ = '\0'; *(outputBuffer.current)++ = '\0';

View file

@ -25,8 +25,7 @@
#include <stdlib.h> #include <stdlib.h>
void void
tpt_regerror(s) tpt_regerror(char *s)
char *s;
{ {
#ifdef ERRAVAIL #ifdef ERRAVAIL
error("tpt_regexp: %s", s); error("tpt_regexp: %s", s);

View file

@ -186,10 +186,10 @@ STATIC char *reg();
STATIC char *regbranch(); STATIC char *regbranch();
STATIC char *regpiece(); STATIC char *regpiece();
STATIC char *regatom(); STATIC char *regatom();
STATIC char *regnode(); STATIC char *regnode(char op);
STATIC char *regnext(); STATIC char *regnext();
STATIC void regc(); STATIC void regc(char b);
STATIC void reginsert(); STATIC void reginsert(char op, char *opnd);
STATIC void regtail(); STATIC void regtail();
STATIC void regoptail(); STATIC void regoptail();
#ifdef STRCSPN #ifdef STRCSPN
@ -212,8 +212,7 @@ STATIC int strcspn();
* of the structure of the compiled regexp. * of the structure of the compiled regexp.
*/ */
regexp * regexp *
tpt_regcomp(exp) tpt_regcomp(char *exp)
char *exp;
{ {
register regexp *r; register regexp *r;
register char *scan; register char *scan;
@ -299,9 +298,10 @@ char *exp;
* follows makes it hard to avoid. * follows makes it hard to avoid.
*/ */
static char * static char *
reg(paren, flagp) reg(
int paren; /* Parenthesized? */ int paren, /* Parenthesized? */
int *flagp; int *flagp
)
{ {
register char *ret; register char *ret;
register char *br; register char *br;
@ -371,8 +371,7 @@ int *flagp;
* Implements the concatenation operator. * Implements the concatenation operator.
*/ */
static char * static char *
regbranch(flagp) regbranch(int *flagp)
int *flagp;
{ {
register char *ret; register char *ret;
register char *chain; register char *chain;
@ -410,8 +409,7 @@ int *flagp;
* endmarker role is not redundant. * endmarker role is not redundant.
*/ */
static char * static char *
regpiece(flagp) regpiece(int *flagp)
int *flagp;
{ {
register char *ret; register char *ret;
register char op; register char op;
@ -474,8 +472,7 @@ int *flagp;
* separate node; the code is simpler that way and it's not worth fixing. * separate node; the code is simpler that way and it's not worth fixing.
*/ */
static char * static char *
regatom(flagp) regatom(int *flagp)
int *flagp;
{ {
register char *ret; register char *ret;
int flags; int flags;
@ -583,8 +580,7 @@ int *flagp;
- regnode - emit a node - regnode - emit a node
*/ */
static char * /* Location. */ static char * /* Location. */
regnode(op) regnode(char op)
char op;
{ {
register char *ret; register char *ret;
register char *ptr; register char *ptr;
@ -608,8 +604,7 @@ char op;
- regc - emit (if appropriate) a byte of code - regc - emit (if appropriate) a byte of code
*/ */
static void static void
regc(b) regc(char b)
char b;
{ {
if (regcode != &regdummy) if (regcode != &regdummy)
*regcode++ = b; *regcode++ = b;
@ -623,9 +618,7 @@ char b;
* Means relocating the operand. * Means relocating the operand.
*/ */
static void static void
reginsert(op, opnd) reginsert(char op, char *opnd)
char op;
char *opnd;
{ {
register char *src; register char *src;
register char *dst; register char *dst;
@ -652,9 +645,7 @@ char *opnd;
- regtail - set the next-pointer at the end of a node chain - regtail - set the next-pointer at the end of a node chain
*/ */
static void static void
regtail(p, val) regtail(char *p, char *val)
char *p;
char *val;
{ {
register char *scan; register char *scan;
register char *temp; register char *temp;
@ -684,9 +675,7 @@ char *val;
- regoptail - regtail on operand of first argument; nop if operandless - regoptail - regtail on operand of first argument; nop if operandless
*/ */
static void static void
regoptail(p, val) regoptail(char *p, char *val)
char *p;
char *val;
{ {
/* "Operandless" and "op != BRANCH" are synonymous in practice. */ /* "Operandless" and "op != BRANCH" are synonymous in practice. */
if (p == NULL || p == &regdummy || OP(p) != BRANCH) if (p == NULL || p == &regdummy || OP(p) != BRANCH)
@ -723,9 +712,7 @@ STATIC char *regprop();
- regexec - match a regexp against a string - regexec - match a regexp against a string
*/ */
int int
tpt_regexec(prog, string) tpt_regexec(register regexp *prog, register char *string)
register regexp *prog;
register char *string;
{ {
register char *s; register char *s;
@ -784,9 +771,7 @@ register char *string;
- regtry - try match at specific point - regtry - try match at specific point
*/ */
static int /* 0 failure, 1 success */ static int /* 0 failure, 1 success */
regtry(prog, string) regtry(regexp *prog, char *string)
regexp *prog;
char *string;
{ {
register int i; register int i;
register char **sp; register char **sp;
@ -821,8 +806,7 @@ char *string;
* by recursion. * by recursion.
*/ */
static int /* 0 failure, 1 success */ static int /* 0 failure, 1 success */
regmatch(prog) regmatch(char *prog)
char *prog;
{ {
register char *scan; /* Current node. */ register char *scan; /* Current node. */
char *next; /* Next node. */ char *next; /* Next node. */
@ -1008,8 +992,7 @@ char *prog;
- regrepeat - repeatedly match something simple, report how many - regrepeat - repeatedly match something simple, report how many
*/ */
static int static int
regrepeat(p) regrepeat(char *p)
char *p;
{ {
register int count = 0; register int count = 0;
register char *scan; register char *scan;
@ -1054,8 +1037,7 @@ char *p;
- regnext - dig the "next" pointer out of a node - regnext - dig the "next" pointer out of a node
*/ */
static char * static char *
regnext(p) regnext(register char *p)
register char *p;
{ {
register int offset; register int offset;
@ -1080,8 +1062,7 @@ STATIC char *regprop();
- regdump - dump a regexp onto stdout in vaguely comprehensible form - regdump - dump a regexp onto stdout in vaguely comprehensible form
*/ */
void void
regdump(r) regdump(regexp *r)
regexp *r;
{ {
register char *s; register char *s;
register char op = EXACTLY; /* Arbitrary non-END op. */ register char op = EXACTLY; /* Arbitrary non-END op. */
@ -1123,8 +1104,7 @@ regexp *r;
- regprop - printable representation of opcode - regprop - printable representation of opcode
*/ */
static char * static char *
regprop(op) regprop(char *op)
char *op;
{ {
register char *p; register char *p;
static char buf[50]; static char buf[50];
@ -1215,9 +1195,7 @@ char *op;
*/ */
static int static int
strcspn(s1, s2) strcspn(char *s1, char *s2)
char *s1;
char *s2;
{ {
register char *scan1; register char *scan1;
register char *scan2; register char *scan2;

View file

@ -55,10 +55,7 @@
- regsub - perform substitutions after a regexp match - regsub - perform substitutions after a regexp match
*/ */
void void
tpt_regsub(prog, source, dest) tpt_regsub(regexp *prog, char *source, char *dest)
regexp *prog;
char *source;
char *dest;
{ {
register char *src; register char *src;
register char *dst; register char *dst;

View file

@ -72,8 +72,7 @@ void (*panicProc) _ANSI_ARGS_(TCL_VARARGS(char *,format)) = NULL;
*/ */
void void
Tcl_SetPanicProc(proc) Tcl_SetPanicProc(void (*proc) _ANSI_ARGS_(TCL_VARARGS(char *,format)))
void (*proc) _ANSI_ARGS_(TCL_VARARGS(char *,format));
{ {
panicProc = proc; panicProc = proc;
} }
@ -96,12 +95,9 @@ Tcl_SetPanicProc(proc)
/* VARARGS ARGSUSED */ /* VARARGS ARGSUSED */
void void
panic(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) panic(char *format /* Format string, suitable for passing to fprintf. */,
char *format; /* Format string, suitable for passing to char *arg1, char *arg2, char *arg3 /* Additional arguments (variable in number) to pass to fprintf. */,
* fprintf. */ char *arg4, char *arg5, char *arg6, char *arg7, char *arg8)
char *arg1, *arg2, *arg3; /* Additional arguments (variable in number)
* to pass to fprintf. */
char *arg4, *arg5, *arg6, *arg7, *arg8;
{ {
if (panicProc != NULL) { if (panicProc != NULL) {
(void) (*panicProc)(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); (void) (*panicProc)(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);

View file

@ -258,8 +258,7 @@ static int strcspn _ANSI_ARGS_((char *s1, char *s2));
* of the structure of the compiled regexp. * of the structure of the compiled regexp.
*/ */
regexp * regexp *
TclRegComp(exp) TclRegComp(char *exp)
char *exp;
{ {
register regexp *r; register regexp *r;
register char *scan; register char *scan;
@ -347,10 +346,7 @@ char *exp;
* follows makes it hard to avoid. * follows makes it hard to avoid.
*/ */
static char * static char *
reg(paren, flagp, rcstate) reg(int paren /* Parenthesized? */, int *flagp, struct regcomp_state *rcstate)
int paren; /* Parenthesized? */
int *flagp;
struct regcomp_state *rcstate;
{ {
register char *ret; register char *ret;
register char *br; register char *br;
@ -420,9 +416,7 @@ struct regcomp_state *rcstate;
* Implements the concatenation operator. * Implements the concatenation operator.
*/ */
static char * static char *
regbranch(flagp, rcstate) regbranch(int *flagp, struct regcomp_state *rcstate)
int *flagp;
struct regcomp_state *rcstate;
{ {
register char *ret; register char *ret;
register char *chain; register char *chain;
@ -461,9 +455,7 @@ struct regcomp_state *rcstate;
* endmarker role is not redundant. * endmarker role is not redundant.
*/ */
static char * static char *
regpiece(flagp, rcstate) regpiece(int *flagp, struct regcomp_state *rcstate)
int *flagp;
struct regcomp_state *rcstate;
{ {
register char *ret; register char *ret;
register char op; register char op;
@ -526,9 +518,7 @@ struct regcomp_state *rcstate;
* separate node; the code is simpler that way and it's not worth fixing. * separate node; the code is simpler that way and it's not worth fixing.
*/ */
static char * static char *
regatom(flagp, rcstate) regatom(int *flagp, struct regcomp_state *rcstate)
int *flagp;
struct regcomp_state *rcstate;
{ {
register char *ret; register char *ret;
int flags; int flags;
@ -638,9 +628,7 @@ struct regcomp_state *rcstate;
- regnode - emit a node - regnode - emit a node
*/ */
static char * /* Location. */ static char * /* Location. */
regnode(op, rcstate) regnode(int op, struct regcomp_state *rcstate)
int op;
struct regcomp_state *rcstate;
{ {
register char *ret; register char *ret;
register char *ptr; register char *ptr;
@ -664,9 +652,7 @@ struct regcomp_state *rcstate;
- regc - emit (if appropriate) a byte of code - regc - emit (if appropriate) a byte of code
*/ */
static void static void
regc(b, rcstate) regc(int b, struct regcomp_state *rcstate)
int b;
struct regcomp_state *rcstate;
{ {
if (rcstate->regcode != &regdummy) if (rcstate->regcode != &regdummy)
*rcstate->regcode++ = (char)b; *rcstate->regcode++ = (char)b;
@ -680,10 +666,7 @@ struct regcomp_state *rcstate;
* Means relocating the operand. * Means relocating the operand.
*/ */
static void static void
reginsert(op, opnd, rcstate) reginsert(int op, char *opnd, struct regcomp_state *rcstate)
int op;
char *opnd;
struct regcomp_state *rcstate;
{ {
register char *src; register char *src;
register char *dst; register char *dst;
@ -710,9 +693,7 @@ struct regcomp_state *rcstate;
- regtail - set the next-pointer at the end of a node chain - regtail - set the next-pointer at the end of a node chain
*/ */
static void static void
regtail(p, val) regtail(char *p, char *val)
char *p;
char *val;
{ {
register char *scan; register char *scan;
register char *temp; register char *temp;
@ -742,9 +723,7 @@ char *val;
- regoptail - regtail on operand of first argument; nop if operandless - regoptail - regtail on operand of first argument; nop if operandless
*/ */
static void static void
regoptail(p, val) regoptail(char *p, char *val)
char *p;
char *val;
{ {
/* "Operandless" and "op != BRANCH" are synonymous in practice. */ /* "Operandless" and "op != BRANCH" are synonymous in practice. */
if (p == NULL || p == &regdummy || OP(p) != BRANCH) if (p == NULL || p == &regdummy || OP(p) != BRANCH)
@ -786,10 +765,7 @@ static char *regprop _ANSI_ARGS_((char *op));
- TclRegExec - match a regexp against a string - TclRegExec - match a regexp against a string
*/ */
int int
TclRegExec(prog, string, start) TclRegExec(register regexp *prog, register char *string, char *start)
register regexp *prog;
register char *string;
char *start;
{ {
register char *s; register char *s;
struct regexec_state state; struct regexec_state state;
@ -851,10 +827,7 @@ char *start;
- regtry - try match at specific point - regtry - try match at specific point
*/ */
static int /* 0 failure, 1 success */ static int /* 0 failure, 1 success */
regtry(prog, string, restate) regtry(regexp *prog, char *string, struct regexec_state *restate)
regexp *prog;
char *string;
struct regexec_state *restate;
{ {
register int i; register int i;
register char **sp; register char **sp;
@ -889,9 +862,7 @@ struct regexec_state *restate;
* by recursion. * by recursion.
*/ */
static int /* 0 failure, 1 success */ static int /* 0 failure, 1 success */
regmatch(prog, restate) regmatch(char *prog, struct regexec_state *restate)
char *prog;
struct regexec_state *restate;
{ {
register char *scan; /* Current node. */ register char *scan; /* Current node. */
char *next; /* Next node. */ char *next; /* Next node. */
@ -1090,9 +1061,7 @@ struct regexec_state *restate;
- regrepeat - repeatedly match something simple, report how many - regrepeat - repeatedly match something simple, report how many
*/ */
static int static int
regrepeat(p, restate) regrepeat(char *p, struct regexec_state *restate)
char *p;
struct regexec_state *restate;
{ {
register int count = 0; register int count = 0;
register char *scan; register char *scan;
@ -1137,8 +1106,7 @@ struct regexec_state *restate;
- regnext - dig the "next" pointer out of a node - regnext - dig the "next" pointer out of a node
*/ */
static char * static char *
regnext(p) regnext(register char *p)
register char *p;
{ {
register int offset; register int offset;
@ -1163,8 +1131,7 @@ static char *regprop();
- regdump - dump a regexp onto stdout in vaguely comprehensible form - regdump - dump a regexp onto stdout in vaguely comprehensible form
*/ */
void void
regdump(r) regdump(regexp *r)
regexp *r;
{ {
register char *s; register char *s;
register char op = EXACTLY; /* Arbitrary non-END op. */ register char op = EXACTLY; /* Arbitrary non-END op. */
@ -1206,8 +1173,7 @@ regexp *r;
- regprop - printable representation of opcode - regprop - printable representation of opcode
*/ */
static char * static char *
regprop(op) regprop(char *op)
char *op;
{ {
register char *p; register char *p;
static char buf[50]; static char buf[50];
@ -1307,9 +1273,7 @@ char *op;
*/ */
static int static int
strcspn(s1, s2) strcspn(char *s1, char *s2)
char *s1;
char *s2;
{ {
register char *scan1; register char *scan1;
register char *scan2; register char *scan2;
@ -1345,14 +1309,13 @@ char *s2;
*/ */
void void
TclRegError(string) TclRegError(char *string /* Error message. */)
char *string; /* Error message. */
{ {
errMsg = string; errMsg = string;
} }
char * char *
TclGetRegError() TclGetRegError(void)
{ {
return errMsg; return errMsg;
} }

View file

@ -102,10 +102,8 @@ static int asyncActive = 0;
*/ */
Tcl_AsyncHandler Tcl_AsyncHandler
Tcl_AsyncCreate(proc, clientData) Tcl_AsyncCreate(Tcl_AsyncProc *proc /* Procedure to call when handler is invoked. */,
Tcl_AsyncProc *proc; /* Procedure to call when handler ClientData clientData /* Argument to pass to handler. */)
* is invoked. */
ClientData clientData; /* Argument to pass to handler. */
{ {
AsyncHandler *asyncPtr; AsyncHandler *asyncPtr;
@ -143,8 +141,7 @@ Tcl_AsyncCreate(proc, clientData)
*/ */
void void
Tcl_AsyncMark(async) Tcl_AsyncMark(Tcl_AsyncHandler async /* Token for handler. */)
Tcl_AsyncHandler async; /* Token for handler. */
{ {
((AsyncHandler *) async)->ready = 1; ((AsyncHandler *) async)->ready = 1;
if (!asyncActive) { if (!asyncActive) {
@ -170,16 +167,13 @@ Tcl_AsyncMark(async)
* *
*---------------------------------------------------------------------- *----------------------------------------------------------------------
*/ */
/* interp, If invoked from Tcl_Eval just after completing a command,
* points to interpreter. Otherwise it is NULL. */
/* code, If interp is non-NULL, this gives completion code from command
* that just completed. */
int int
Tcl_AsyncInvoke(interp, code) Tcl_AsyncInvoke(Tcl_Interp *interp, int code)
Tcl_Interp *interp; /* If invoked from Tcl_Eval just after
* completing a command, points to
* interpreter. Otherwise it is
* NULL. */
int code; /* If interp is non-NULL, this gives
* completion code from command that
* just completed. */
{ {
AsyncHandler *asyncPtr; AsyncHandler *asyncPtr;
@ -238,8 +232,7 @@ Tcl_AsyncInvoke(interp, code)
*/ */
void void
Tcl_AsyncDelete(async) Tcl_AsyncDelete(Tcl_AsyncHandler async /* Token for handler to delete. */)
Tcl_AsyncHandler async; /* Token for handler to delete. */
{ {
AsyncHandler *asyncPtr = (AsyncHandler *) async; AsyncHandler *asyncPtr = (AsyncHandler *) async;
AsyncHandler *prevPtr; AsyncHandler *prevPtr;
@ -282,7 +275,7 @@ Tcl_AsyncDelete(async)
*/ */
int int
Tcl_AsyncReady() Tcl_AsyncReady(void)
{ {
return asyncReady; return asyncReady;
} }

View file

@ -188,7 +188,7 @@ static CmdInfo builtInCmds[] = {
*/ */
Tcl_Interp * Tcl_Interp *
Tcl_CreateInterp() Tcl_CreateInterp(void)
{ {
register Interp *iPtr; register Interp *iPtr;
register Command *cmdPtr; register Command *cmdPtr;
@ -335,13 +335,12 @@ Tcl_CreateInterp()
* *
*-------------------------------------------------------------- *--------------------------------------------------------------
*/ */
/* interp, Interpreter to watch. */
/* proc, Procedure to call when interpreter is about to be deleted. */
/* clientData, One-word value to pass to proc. */
void void
Tcl_CallWhenDeleted(interp, proc, clientData) Tcl_CallWhenDeleted(Tcl_Interp *interp, Tcl_InterpDeleteProc *proc, ClientData clientData)
Tcl_Interp *interp; /* Interpreter to watch. */
Tcl_InterpDeleteProc *proc; /* Procedure to call when interpreter
* is about to be deleted. */
ClientData clientData; /* One-word value to pass to proc. */
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
static int assocDataCounter = 0; static int assocDataCounter = 0;
@ -382,13 +381,12 @@ Tcl_CallWhenDeleted(interp, proc, clientData)
* *
*-------------------------------------------------------------- *--------------------------------------------------------------
*/ */
/* interp, Interpreter to watch. */
/* proc, Procedure to call when interpreter is about to be deleted. */
/* clientData, One-word value to pass to proc. */
void void
Tcl_DontCallWhenDeleted(interp, proc, clientData) Tcl_DontCallWhenDeleted(Tcl_Interp *interp, Tcl_InterpDeleteProc *proc, ClientData clientData)
Tcl_Interp *interp; /* Interpreter to watch. */
Tcl_InterpDeleteProc *proc; /* Procedure to call when interpreter
* is about to be deleted. */
ClientData clientData; /* One-word value to pass to proc. */
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
Tcl_HashTable *hTablePtr; Tcl_HashTable *hTablePtr;
@ -431,12 +429,12 @@ Tcl_DontCallWhenDeleted(interp, proc, clientData)
*/ */
void void
Tcl_SetAssocData(interp, name, proc, clientData) Tcl_SetAssocData(
Tcl_Interp *interp; /* Interpreter to associate with. */ Tcl_Interp *interp /* Interpreter to associate with. */,
char *name; /* Name for association. */ char *name /* Name for association. */,
Tcl_InterpDeleteProc *proc; /* Proc to call when interpreter is Tcl_InterpDeleteProc *proc /* Proc to call when interpreter is about to be deleted. */,
* about to be deleted. */ ClientData clientData /* One-word value to pass to proc. */
ClientData clientData; /* One-word value to pass to proc. */ )
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
AssocData *dPtr; AssocData *dPtr;
@ -477,9 +475,10 @@ Tcl_SetAssocData(interp, name, proc, clientData)
*/ */
void void
Tcl_DeleteAssocData(interp, name) Tcl_DeleteAssocData(
Tcl_Interp *interp; /* Interpreter to associate with. */ Tcl_Interp *interp /* Interpreter to associate with. */,
char *name; /* Name of association. */ char *name /* Name of association. */
)
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
AssocData *dPtr; AssocData *dPtr;
@ -519,11 +518,12 @@ Tcl_DeleteAssocData(interp, name)
*/ */
ClientData ClientData
Tcl_GetAssocData(interp, name, procPtr) Tcl_GetAssocData(
Tcl_Interp *interp; /* Interpreter associated with. */ Tcl_Interp *interp /* Interpreter associated with. */,
char *name; /* Name of association. */ char *name /* Name of association. */,
Tcl_InterpDeleteProc **procPtr; /* Pointer to place to store address Tcl_InterpDeleteProc **procPtr /* Pointer to place to store address
* of current deletion callback. */ * of current deletion callback. */
)
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
AssocData *dPtr; AssocData *dPtr;
@ -565,8 +565,9 @@ Tcl_GetAssocData(interp, name, procPtr)
*/ */
static void static void
DeleteInterpProc(interp) DeleteInterpProc(
Tcl_Interp *interp; /* Interpreter to delete. */ Tcl_Interp *interp /* Interpreter to delete. */
)
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
Tcl_HashEntry *hPtr; Tcl_HashEntry *hPtr;
@ -720,8 +721,7 @@ DeleteInterpProc(interp)
*/ */
int int
Tcl_InterpDeleted(interp) Tcl_InterpDeleted(Tcl_Interp *interp)
Tcl_Interp *interp;
{ {
return (((Interp *) interp)->flags & DELETED) ? 1 : 0; return (((Interp *) interp)->flags & DELETED) ? 1 : 0;
} }
@ -750,9 +750,10 @@ Tcl_InterpDeleted(interp)
*/ */
void void
Tcl_DeleteInterp(interp) Tcl_DeleteInterp(
Tcl_Interp *interp; /* Token for command interpreter (returned Tcl_Interp *interp /* Token for command interpreter (returned
* by a previous call to Tcl_CreateInterp). */ * by a previous call to Tcl_CreateInterp). */
)
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
@ -800,16 +801,17 @@ Tcl_DeleteInterp(interp)
*/ */
Tcl_Command Tcl_Command
Tcl_CreateCommand(interp, cmdName, proc, clientData, deleteProc) Tcl_CreateCommand(
Tcl_Interp *interp; /* Token for command interpreter (returned Tcl_Interp *interp, /* Token for command interpreter (returned
* by a previous call to Tcl_CreateInterp). */ * by a previous call to Tcl_CreateInterp). */
char *cmdName; /* Name of command. */ char *cmdName, /* Name of command. */
Tcl_CmdProc *proc; /* Command procedure to associate with Tcl_CmdProc *proc, /* Command procedure to associate with
* cmdName. */ * cmdName. */
ClientData clientData; /* Arbitrary one-word value to pass to proc. */ ClientData clientData, /* Arbitrary one-word value to pass to proc. */
Tcl_CmdDeleteProc *deleteProc; Tcl_CmdDeleteProc *deleteProc
/* If not NULL, gives a procedure to call when /* If not NULL, gives a procedure to call when
* this command is deleted. */ * this command is deleted. */
)
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
Command *cmdPtr; Command *cmdPtr;
@ -901,12 +903,13 @@ Tcl_CreateCommand(interp, cmdName, proc, clientData, deleteProc)
*/ */
int int
Tcl_SetCommandInfo(interp, cmdName, infoPtr) Tcl_SetCommandInfo(
Tcl_Interp *interp; /* Interpreter in which to look Tcl_Interp *interp, /* Interpreter in which to look
* for command. */ * for command. */
char *cmdName; /* Name of desired command. */ char *cmdName, /* Name of desired command. */
Tcl_CmdInfo *infoPtr; /* Where to store information about Tcl_CmdInfo *infoPtr /* Where to store information about
* command. */ * command. */
)
{ {
Tcl_HashEntry *hPtr; Tcl_HashEntry *hPtr;
Command *cmdPtr; Command *cmdPtr;
@ -943,12 +946,13 @@ Tcl_SetCommandInfo(interp, cmdName, infoPtr)
*/ */
int int
Tcl_GetCommandInfo(interp, cmdName, infoPtr) Tcl_GetCommandInfo(
Tcl_Interp *interp; /* Interpreter in which to look Tcl_Interp *interp, /* Interpreter in which to look
* for command. */ * for command. */
char *cmdName; /* Name of desired command. */ char *cmdName, /* Name of desired command. */
Tcl_CmdInfo *infoPtr; /* Where to store information about Tcl_CmdInfo *infoPtr /* Where to store information about
* command. */ * command. */
)
{ {
Tcl_HashEntry *hPtr; Tcl_HashEntry *hPtr;
Command *cmdPtr; Command *cmdPtr;
@ -984,11 +988,12 @@ Tcl_GetCommandInfo(interp, cmdName, infoPtr)
*/ */
char * char *
Tcl_GetCommandName(interp, command) Tcl_GetCommandName(
Tcl_Interp *interp; /* Interpreter containing the command. */ Tcl_Interp *interp, /* Interpreter containing the command. */
Tcl_Command command; /* Token for the command, returned by a Tcl_Command command /* Token for the command, returned by a
* previous call to Tcl_CreateCommand. * previous call to Tcl_CreateCommand.
* The command must not have been deleted. */ * The command must not have been deleted. */
)
{ {
Command *cmdPtr = (Command *) command; Command *cmdPtr = (Command *) command;
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
@ -1026,10 +1031,11 @@ Tcl_GetCommandName(interp, command)
*/ */
int int
Tcl_DeleteCommand(interp, cmdName) Tcl_DeleteCommand(
Tcl_Interp *interp; /* Token for command interpreter (returned Tcl_Interp *interp, /* Token for command interpreter (returned
* by a previous call to Tcl_CreateInterp). */ * by a previous call to Tcl_CreateInterp). */
char *cmdName; /* Name of command to remove. */ char *cmdName /* Name of command to remove. */
)
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
Tcl_HashEntry *hPtr, *tkErrorHPtr; Tcl_HashEntry *hPtr, *tkErrorHPtr;
@ -1137,10 +1143,11 @@ Tcl_DeleteCommand(interp, cmdName)
*/ */
int int
Tcl_Eval(interp, cmd) Tcl_Eval(
Tcl_Interp *interp; /* Token for command interpreter (returned Tcl_Interp *interp, /* Token for command interpreter (returned
* by a previous call to Tcl_CreateInterp). */ * by a previous call to Tcl_CreateInterp). */
char *cmd; /* Pointer to TCL command to interpret. */ char *cmd /* Pointer to TCL command to interpret. */
)
{ {
/* /*
* The storage immediately below is used to generate a copy * The storage immediately below is used to generate a copy
@ -1583,13 +1590,14 @@ Tcl_Eval(interp, cmd)
*/ */
Tcl_Trace Tcl_Trace
Tcl_CreateTrace(interp, level, proc, clientData) Tcl_CreateTrace(
Tcl_Interp *interp; /* Interpreter in which to create the trace. */ Tcl_Interp *interp, /* Interpreter in which to create the trace. */
int level; /* Only call proc for commands at nesting level int level, /* Only call proc for commands at nesting level
* <= level (1 => top level). */ * <= level (1 => top level). */
Tcl_CmdTraceProc *proc; /* Procedure to call before executing each Tcl_CmdTraceProc *proc, /* Procedure to call before executing each
* command. */ * command. */
ClientData clientData; /* Arbitrary one-word value to pass to proc. */ ClientData clientData /* Arbitrary one-word value to pass to proc. */
)
{ {
register Trace *tracePtr; register Trace *tracePtr;
register Interp *iPtr = (Interp *) interp; register Interp *iPtr = (Interp *) interp;
@ -1622,10 +1630,11 @@ Tcl_CreateTrace(interp, level, proc, clientData)
*/ */
void void
Tcl_DeleteTrace(interp, trace) Tcl_DeleteTrace(
Tcl_Interp *interp; /* Interpreter that contains trace. */ Tcl_Interp *interp, /* Interpreter that contains trace. */
Tcl_Trace trace; /* Token for trace (returned previously by Tcl_Trace trace /* Token for trace (returned previously by
* Tcl_CreateTrace). */ * Tcl_CreateTrace). */
)
{ {
register Interp *iPtr = (Interp *) interp; register Interp *iPtr = (Interp *) interp;
register Trace *tracePtr = (Trace *) trace; register Trace *tracePtr = (Trace *) trace;
@ -1666,10 +1675,11 @@ Tcl_DeleteTrace(interp, trace)
*/ */
void void
Tcl_AddErrorInfo(interp, message) Tcl_AddErrorInfo(
Tcl_Interp *interp; /* Interpreter to which error information Tcl_Interp *interp, /* Interpreter to which error information
* pertains. */ * pertains. */
char *message; /* Message to record. */ char *message /* Message to record. */
)
{ {
register Interp *iPtr = (Interp *) interp; register Interp *iPtr = (Interp *) interp;
@ -1773,9 +1783,10 @@ Tcl_VarEval TCL_VARARGS_DEF(Tcl_Interp *, arg1)
*/ */
int int
Tcl_GlobalEval(interp, command) Tcl_GlobalEval(
Tcl_Interp *interp; /* Interpreter in which to evaluate command. */ Tcl_Interp *interp, /* Interpreter in which to evaluate command. */
char *command; /* Command to evaluate. */ char *command /* Command to evaluate. */
)
{ {
register Interp *iPtr = (Interp *) interp; register Interp *iPtr = (Interp *) interp;
int result; int result;
@ -1806,10 +1817,11 @@ Tcl_GlobalEval(interp, command)
*/ */
int int
Tcl_SetRecursionLimit(interp, depth) Tcl_SetRecursionLimit(
Tcl_Interp *interp; /* Interpreter whose nesting limit Tcl_Interp *interp, /* Interpreter whose nesting limit
* is to be set. */ * is to be set. */
int depth; /* New value for maximimum depth. */ int depth /* New value for maximimum depth. */
)
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
int old; int old;
@ -1842,8 +1854,9 @@ Tcl_SetRecursionLimit(interp, depth)
*/ */
void void
Tcl_AllowExceptions(interp) Tcl_AllowExceptions(
Tcl_Interp *interp; /* Interpreter in which to set flag. */ Tcl_Interp *interp /* Interpreter in which to set flag. */
)
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;

View file

@ -646,8 +646,7 @@ Tcl_CreateCommand (interp, "memory", MemoryCmd, (ClientData) NULL,
*---------------------------------------------------------------------- *----------------------------------------------------------------------
*/ */
VOID * VOID *
Tcl_Ckalloc (size) Tcl_Ckalloc (unsigned int size)
unsigned int size;
{ {
char *result; char *result;
@ -659,10 +658,7 @@ Tcl_Ckalloc (size)
char * char *
Tcl_DbCkalloc(size, file, line) Tcl_DbCkalloc(unsigned int size, char *file, int line)
unsigned int size;
char *file;
int line;
{ {
char *result; char *result;
@ -677,11 +673,7 @@ Tcl_DbCkalloc(size, file, line)
} }
char * char *
Tcl_DbCkrealloc(ptr, size, file, line) Tcl_DbCkrealloc(char *ptr, unsigned int size, char *file, int line)
char *ptr;
unsigned int size;
char *file;
int line;
{ {
char *result; char *result;
@ -705,17 +697,13 @@ Tcl_DbCkrealloc(ptr, size, file, line)
*---------------------------------------------------------------------- *----------------------------------------------------------------------
*/ */
void void
Tcl_Ckfree (ptr) Tcl_Ckfree (char *ptr)
char *ptr;
{ {
free (ptr); free (ptr);
} }
int int
Tcl_DbCkfree(ptr, file, line) Tcl_DbCkfree(char *ptr, char *file, int line)
char * ptr;
char *file;
int line;
{ {
free (ptr); free (ptr);
return 0; return 0;
@ -732,8 +720,7 @@ Tcl_DbCkfree(ptr, file, line)
*/ */
/* ARGSUSED */ /* ARGSUSED */
void void
Tcl_InitMemory(interp) Tcl_InitMemory(Tcl_Interp *interp)
Tcl_Interp *interp;
{ {
} }
@ -745,16 +732,13 @@ extern void Tcl_ValidateAllMemory _ANSI_ARGS_((char *file,
int line)); int line));
int int
Tcl_DumpActiveMemory (fileName) Tcl_DumpActiveMemory (char *fileName)
char *fileName;
{ {
return TCL_OK; return TCL_OK;
} }
void void
Tcl_ValidateAllMemory (file, line) Tcl_ValidateAllMemory (char *file, int line)
char *file;
int line;
{ {
} }

View file

@ -69,11 +69,12 @@ static int ParseTime _ANSI_ARGS_((Tcl_Interp *interp,
*/ */
int int
Tcl_ClockCmd (dummy, interp, argc, argv) Tcl_ClockCmd (
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int c; int c;
size_t length; size_t length;
@ -224,10 +225,7 @@ Tcl_ClockCmd (dummy, interp, argc, argv)
*/ */
static int static int
ParseTime(interp, string, timePtr) ParseTime(Tcl_Interp *interp, char *string, unsigned long *timePtr)
Tcl_Interp *interp;
char *string;
unsigned long *timePtr;
{ {
char *end, *p; char *end, *p;
unsigned long i; unsigned long i;
@ -290,11 +288,12 @@ ParseTime(interp, string, timePtr)
*/ */
static int static int
FormatClock(interp, clockVal, useGMT, format) FormatClock(
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
unsigned long clockVal; /* Time in seconds. */ unsigned long clockVal, /* Time in seconds. */
int useGMT; /* Boolean */ int useGMT, /* Boolean */
char *format; /* Format string */ char *format /* Format string */
)
{ {
struct tm *timeDataPtr; struct tm *timeDataPtr;
Tcl_DString buffer; Tcl_DString buffer;

View file

@ -67,11 +67,12 @@ static int StoreStatData _ANSI_ARGS_((Tcl_Interp *interp,
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_BreakCmd(dummy, interp, argc, argv) Tcl_BreakCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
if (argc != 1) { if (argc != 1) {
Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_AppendResult(interp, "wrong # args: should be \"",
@ -100,11 +101,12 @@ Tcl_BreakCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_CaseCmd(dummy, interp, argc, argv) Tcl_CaseCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int i, result; int i, result;
int body; int body;
@ -240,11 +242,12 @@ Tcl_CaseCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_CatchCmd(dummy, interp, argc, argv) Tcl_CatchCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int result; int result;
@ -285,11 +288,12 @@ Tcl_CatchCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_CdCmd(dummy, interp, argc, argv) Tcl_CdCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
char *dirName; char *dirName;
Tcl_DString buffer; Tcl_DString buffer;
@ -334,11 +338,12 @@ Tcl_CdCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_ConcatCmd(dummy, interp, argc, argv) Tcl_ConcatCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
if (argc >= 2) { if (argc >= 2) {
interp->result = Tcl_Concat(argc-1, argv+1); interp->result = Tcl_Concat(argc-1, argv+1);
@ -366,11 +371,12 @@ Tcl_ConcatCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_ContinueCmd(dummy, interp, argc, argv) Tcl_ContinueCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
if (argc != 1) { if (argc != 1) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
@ -399,11 +405,12 @@ Tcl_ContinueCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_ErrorCmd(dummy, interp, argc, argv) Tcl_ErrorCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
@ -444,11 +451,12 @@ Tcl_ErrorCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_EvalCmd(dummy, interp, argc, argv) Tcl_EvalCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int result; int result;
char *cmd; char *cmd;
@ -498,11 +506,12 @@ Tcl_EvalCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_ExitCmd(dummy, interp, argc, argv) Tcl_ExitCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int value; int value;
@ -540,11 +549,12 @@ Tcl_ExitCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_ExprCmd(dummy, interp, argc, argv) Tcl_ExprCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Tcl_DString buffer; Tcl_DString buffer;
int i, result; int i, result;
@ -588,11 +598,12 @@ Tcl_ExprCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_FileCmd(dummy, interp, argc, argv) Tcl_FileCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
char *fileName, *extension; char *fileName, *extension;
int c, statOp, result; int c, statOp, result;
@ -1005,12 +1016,13 @@ Tcl_FileCmd(dummy, interp, argc, argv)
*/ */
static int static int
StoreStatData(interp, varName, statPtr) StoreStatData(
Tcl_Interp *interp; /* Interpreter for error reports. */ Tcl_Interp *interp, /* Interpreter for error reports. */
char *varName; /* Name of associative array variable char *varName, /* Name of associative array variable
* in which to store stat results. */ * in which to store stat results. */
struct stat *statPtr; /* Pointer to buffer containing struct stat *statPtr /* Pointer to buffer containing
* stat data to store in varName. */ * stat data to store in varName. */
)
{ {
char string[30]; char string[30];
@ -1089,8 +1101,7 @@ StoreStatData(interp, varName, statPtr)
*/ */
static char * static char *
GetTypeFromMode(mode) GetTypeFromMode(int mode)
int mode;
{ {
if (S_ISREG(mode)) { if (S_ISREG(mode)) {
return "file"; return "file";
@ -1129,11 +1140,12 @@ GetTypeFromMode(mode)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_ForCmd(dummy, interp, argc, argv) Tcl_ForCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int result, value; int result, value;
@ -1205,11 +1217,12 @@ Tcl_ForCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_ForeachCmd(dummy, interp, argc, argv) Tcl_ForeachCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int result = TCL_OK; int result = TCL_OK;
int i; /* i selects a value list */ int i; /* i selects a value list */
@ -1363,11 +1376,12 @@ errorReturn:
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_FormatCmd(dummy, interp, argc, argv) Tcl_FormatCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
register char *format; /* Used to read characters from the format register char *format; /* Used to read characters from the format
* string. */ * string. */

View file

@ -102,11 +102,12 @@ static int SortCompareProc _ANSI_ARGS_((CONST VOID *first,
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_IfCmd(dummy, interp, argc, argv) Tcl_IfCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int i, result, value; int i, result, value;
@ -195,11 +196,12 @@ Tcl_IfCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_IncrCmd(dummy, interp, argc, argv) Tcl_IncrCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int value; int value;
char *oldString, *result; char *oldString, *result;
@ -260,11 +262,12 @@ Tcl_IncrCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_InfoCmd(dummy, interp, argc, argv) Tcl_InfoCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
register Interp *iPtr = (Interp *) interp; register Interp *iPtr = (Interp *) interp;
size_t length; size_t length;
@ -697,11 +700,12 @@ Tcl_InfoCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_JoinCmd(dummy, interp, argc, argv) Tcl_JoinCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
char *joinString; char *joinString;
char **listArgv; char **listArgv;
@ -750,11 +754,12 @@ Tcl_JoinCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_LindexCmd(dummy, interp, argc, argv) Tcl_LindexCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
char *p, *element, *next; char *p, *element, *next;
int index, size, parenthesized, result, returnLast; int index, size, parenthesized, result, returnLast;
@ -822,11 +827,12 @@ Tcl_LindexCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_LinsertCmd(dummy, interp, argc, argv) Tcl_LinsertCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
char *p, *element, savedChar; char *p, *element, savedChar;
int i, index, count, result, size; int i, index, count, result, size;
@ -909,11 +915,12 @@ Tcl_LinsertCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_ListCmd(dummy, interp, argc, argv) Tcl_ListCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
if (argc >= 2) { if (argc >= 2) {
interp->result = Tcl_Merge(argc-1, argv+1); interp->result = Tcl_Merge(argc-1, argv+1);
@ -941,11 +948,12 @@ Tcl_ListCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_LlengthCmd(dummy, interp, argc, argv) Tcl_LlengthCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int count, result; int count, result;
char *element, *p; char *element, *p;
@ -988,11 +996,12 @@ Tcl_LlengthCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_LrangeCmd(notUsed, interp, argc, argv) Tcl_LrangeCmd(
ClientData notUsed; /* Not used. */ ClientData notUsed, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int first, last, result; int first, last, result;
char *begin, *end, c, *dummy, *next; char *begin, *end, c, *dummy, *next;
@ -1093,11 +1102,12 @@ Tcl_LrangeCmd(notUsed, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_LreplaceCmd(notUsed, interp, argc, argv) Tcl_LreplaceCmd(
ClientData notUsed; /* Not used. */ ClientData notUsed, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
char *p1, *p2, *element, savedChar, *dummy, *next; char *p1, *p2, *element, savedChar, *dummy, *next;
int i, first, last, count, result, size, firstIsEnd; int i, first, last, count, result, size, firstIsEnd;
@ -1222,11 +1232,12 @@ Tcl_LreplaceCmd(notUsed, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_LsearchCmd(notUsed, interp, argc, argv) Tcl_LsearchCmd(
ClientData notUsed; /* Not used. */ ClientData notUsed, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
#define EXACT 0 #define EXACT 0
#define GLOB 1 #define GLOB 1
@ -1303,11 +1314,12 @@ Tcl_LsearchCmd(notUsed, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_LsortCmd(notUsed, interp, argc, argv) Tcl_LsortCmd(
ClientData notUsed; /* Not used. */ ClientData notUsed, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int listArgc, i, c; int listArgc, i, c;
size_t length; size_t length;
@ -1421,8 +1433,7 @@ Tcl_LsortCmd(notUsed, interp, argc, argv)
*/ */
static int static int
SortCompareProc(first, second) SortCompareProc(CONST VOID *first, CONST VOID *second) /* Elements to be compared. */
CONST VOID *first, *second; /* Elements to be compared. */
{ {
int order; int order;
char *firstString = *((char **) first); char *firstString = *((char **) first);

View file

@ -85,11 +85,12 @@ static char * TraceVarProc _ANSI_ARGS_((ClientData clientData,
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_PwdCmd(dummy, interp, argc, argv) Tcl_PwdCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
char *dirName; char *dirName;
@ -126,11 +127,12 @@ Tcl_PwdCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_RegexpCmd(dummy, interp, argc, argv) Tcl_RegexpCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int noCase = 0; int noCase = 0;
int indices = 0; int indices = 0;
@ -279,11 +281,12 @@ Tcl_RegexpCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_RegsubCmd(dummy, interp, argc, argv) Tcl_RegsubCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int noCase = 0, all = 0; int noCase = 0, all = 0;
Tcl_RegExp regExpr; Tcl_RegExp regExpr;
@ -529,11 +532,12 @@ Tcl_RegsubCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_RenameCmd(dummy, interp, argc, argv) Tcl_RenameCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
register Command *cmdPtr; register Command *cmdPtr;
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
@ -646,11 +650,12 @@ Tcl_RenameCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_ReturnCmd(dummy, interp, argc, argv) Tcl_ReturnCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
int c, code; int c, code;
@ -723,11 +728,12 @@ Tcl_ReturnCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_ScanCmd(dummy, interp, argc, argv) Tcl_ScanCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
# define MAX_FIELDS 20 # define MAX_FIELDS 20
typedef struct { typedef struct {
@ -1018,11 +1024,12 @@ Tcl_ScanCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_SourceCmd(dummy, interp, argc, argv) Tcl_SourceCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
if (argc != 2) { if (argc != 2) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
@ -1051,11 +1058,12 @@ Tcl_SourceCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_SplitCmd(dummy, interp, argc, argv) Tcl_SplitCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
char *splitChars; char *splitChars;
register char *p, *p2; register char *p, *p2;
@ -1127,11 +1135,12 @@ Tcl_SplitCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_StringCmd(dummy, interp, argc, argv) Tcl_StringCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
size_t length; size_t length;
register char *p; register char *p;
@ -1456,11 +1465,12 @@ Tcl_StringCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_SubstCmd(dummy, interp, argc, argv) Tcl_SubstCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
Tcl_DString result; Tcl_DString result;
@ -1594,11 +1604,12 @@ Tcl_SubstCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_SwitchCmd(dummy, interp, argc, argv) Tcl_SwitchCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
#define EXACT 0 #define EXACT 0
#define GLOB 1 #define GLOB 1
@ -1750,11 +1761,12 @@ Tcl_SwitchCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_TimeCmd(dummy, interp, argc, argv) Tcl_TimeCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int count, i, result; int count, i, result;
double timePer; double timePer;
@ -1811,11 +1823,12 @@ Tcl_TimeCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_TraceCmd(dummy, interp, argc, argv) Tcl_TraceCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int c; int c;
size_t length; size_t length;
@ -1989,14 +2002,15 @@ Tcl_TraceCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
static char * static char *
TraceVarProc(clientData, interp, name1, name2, flags) TraceVarProc(
ClientData clientData; /* Information about the variable trace. */ ClientData clientData, /* Information about the variable trace. */
Tcl_Interp *interp; /* Interpreter containing variable. */ Tcl_Interp *interp, /* Interpreter containing variable. */
char *name1; /* Name of variable or array. */ char *name1, /* Name of variable or array. */
char *name2; /* Name of element within array; NULL means char *name2, /* Name of element within array; NULL means
* scalar variable is being referenced. */ * scalar variable is being referenced. */
int flags; /* OR-ed bits giving operation and other int flags /* OR-ed bits giving operation and other
* information. */ * information. */
)
{ {
TraceVarInfo *tvarPtr = (TraceVarInfo *) clientData; TraceVarInfo *tvarPtr = (TraceVarInfo *) clientData;
char *result; char *result;
@ -2087,11 +2101,12 @@ TraceVarProc(clientData, interp, name1, name2, flags)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_WhileCmd(dummy, interp, argc, argv) Tcl_WhileCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int result, value; int result, value;

View file

@ -408,18 +408,13 @@ static TABLE MilitaryTable[] = {
* Dump error messages in the bit bucket. * Dump error messages in the bit bucket.
*/ */
static void static void
TclDateerror(s) TclDateerror(char *s)
char *s;
{ {
} }
static time_t static time_t
ToSeconds(Hours, Minutes, Seconds, Meridian) ToSeconds(time_t Hours, time_t Minutes, time_t Seconds, MERIDIAN Meridian)
time_t Hours;
time_t Minutes;
time_t Seconds;
MERIDIAN Meridian;
{ {
if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 59) if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 59)
return -1; return -1;
@ -442,16 +437,9 @@ ToSeconds(Hours, Minutes, Seconds, Meridian)
static int static int
Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode, TimePtr) Convert(time_t Month, time_t Day, time_t Year,
time_t Month; time_t Hours, time_t Minutes, time_t Seconds,
time_t Day; MERIDIAN Meridian, DSTMODE DSTmode, time_t *TimePtr)
time_t Year;
time_t Hours;
time_t Minutes;
time_t Seconds;
MERIDIAN Meridian;
DSTMODE DSTmode;
time_t *TimePtr;
{ {
static int DaysInMonth[12] = { static int DaysInMonth[12] = {
31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
@ -494,9 +482,7 @@ Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode, TimePtr)
static time_t static time_t
DSTcorrect(Start, Future) DSTcorrect(time_t Start, time_t Future)
time_t Start;
time_t Future;
{ {
time_t StartDay; time_t StartDay;
time_t FutureDay; time_t FutureDay;
@ -508,10 +494,7 @@ DSTcorrect(Start, Future)
static time_t static time_t
RelativeDate(Start, DayOrdinal, DayNumber) RelativeDate(time_t Start, time_t DayOrdinal, time_t DayNumber)
time_t Start;
time_t DayOrdinal;
time_t DayNumber;
{ {
struct tm *tm; struct tm *tm;
time_t now; time_t now;
@ -525,10 +508,7 @@ RelativeDate(Start, DayOrdinal, DayNumber)
static int static int
RelativeMonth(Start, RelMonth, TimePtr) RelativeMonth(time_t Start, time_t RelMonth, time_t *TimePtr)
time_t Start;
time_t RelMonth;
time_t *TimePtr;
{ {
struct tm *tm; struct tm *tm;
time_t Month; time_t Month;
@ -553,8 +533,7 @@ RelativeMonth(Start, RelMonth, TimePtr)
static int static int
LookupWord(buff) LookupWord(char *buff)
char *buff;
{ {
register char *p; register char *p;
register char *q; register char *q;
@ -673,7 +652,7 @@ LookupWord(buff)
static int static int
TclDatelex() TclDatelex(void)
{ {
register char c; register char c;
register char *p; register char *p;
@ -739,11 +718,7 @@ TclDatelex()
*/ */
int int
TclGetDate(p, now, zone, timePtr) TclGetDate(char *p, unsigned long now, long zone, unsigned long *timePtr)
char *p;
unsigned long now;
long zone;
unsigned long *timePtr;
{ {
struct tm *tm; struct tm *tm;
time_t Start; time_t Start;

View file

@ -114,9 +114,10 @@ void TclUnsetEnv _ANSI_ARGS_((CONST char *name));
*/ */
void void
TclSetupEnv(interp) TclSetupEnv(
Tcl_Interp *interp; /* Interpreter whose "env" array is to be Tcl_Interp *interp /* Interpreter whose "env" array is to be
* managed. */ * managed. */
)
{ {
EnvInterp *eiPtr; EnvInterp *eiPtr;
int i; int i;
@ -186,12 +187,13 @@ TclSetupEnv(interp)
*/ */
static int static int
FindVariable(name, lengthPtr) FindVariable(
CONST char *name; /* Name of desired environment variable. */ CONST char *name, /* Name of desired environment variable. */
int *lengthPtr; /* Used to return length of name (for int *lengthPtr /* Used to return length of name (for
* successful searches) or number of non-NULL * successful searches) or number of non-NULL
* entries in environ (for unsuccessful * entries in environ (for unsuccessful
* searches). */ * searches). */
)
{ {
int i; int i;
register CONST char *p1, *p2; register CONST char *p1, *p2;
@ -230,8 +232,9 @@ FindVariable(name, lengthPtr)
*/ */
char * char *
TclGetEnv(name) TclGetEnv(
char *name; /* Name of desired environment variable. */ char *name /* Name of desired environment variable. */
)
{ {
int i; int i;
size_t len; size_t len;
@ -274,10 +277,11 @@ TclGetEnv(name)
*/ */
void void
TclSetEnv(name, value) TclSetEnv(
CONST char *name; /* Name of variable whose value is to be CONST char *name, /* Name of variable whose value is to be
* set. */ * set. */
CONST char *value; /* New value for variable. */ CONST char *value /* New value for variable. */
)
{ {
int index, length, nameLength; int index, length, nameLength;
char *p; char *p;
@ -376,9 +380,10 @@ TclSetEnv(name, value)
*/ */
int int
Tcl_PutEnv(string) Tcl_PutEnv(
CONST char *string; /* Info about environment variable in the CONST char *string /* Info about environment variable in the
* form NAME=value. */ * form NAME=value. */
)
{ {
int nameLength; int nameLength;
char *name, *value; char *name, *value;
@ -429,8 +434,9 @@ Tcl_PutEnv(string)
*/ */
void void
TclUnsetEnv(name) TclUnsetEnv(
CONST char *name; /* Name of variable to remove. */ CONST char *name /* Name of variable to remove. */
)
{ {
int index, dummy; int index, dummy;
char **envPtr; char **envPtr;
@ -496,14 +502,15 @@ TclUnsetEnv(name)
/* ARGSUSED */ /* ARGSUSED */
static char * static char *
EnvTraceProc(clientData, interp, name1, name2, flags) EnvTraceProc(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
Tcl_Interp *interp; /* Interpreter whose "env" variable is Tcl_Interp *interp, /* Interpreter whose "env" variable is
* being modified. */ * being modified. */
char *name1; /* Better be "env". */ char *name1, /* Better be "env". */
char *name2; /* Name of variable being modified, or char *name2, /* Name of variable being modified, or
* NULL if whole array is being deleted. */ * NULL if whole array is being deleted. */
int flags; /* Indicates what's happening. */ int flags /* Indicates what's happening. */
)
{ {
/* /*
* First see if the whole "env" variable is being deleted. If * First see if the whole "env" variable is being deleted. If
@ -570,7 +577,7 @@ EnvTraceProc(clientData, interp, name1, name2, flags)
*/ */
static void static void
EnvInit() EnvInit(void)
{ {
#ifdef MAC_TCL #ifdef MAC_TCL
environSize = TclMacCreateEnv(); environSize = TclMacCreateEnv();
@ -615,8 +622,9 @@ EnvInit()
*/ */
static void static void
EnvExitProc(clientData) EnvExitProc(
ClientData clientData; /* Not used. */ ClientData clientData /* Not used. */
)
{ {
char **p; char **p;

View file

@ -329,15 +329,16 @@ static char * VwaitVarProc _ANSI_ARGS_((ClientData clientData,
*/ */
void void
Tcl_CreateFileHandler(file, mask, proc, clientData) Tcl_CreateFileHandler(
Tcl_File file; /* Handle of stream to watch. */ Tcl_File file, /* Handle of stream to watch. */
int mask; /* OR'ed combination of TCL_READABLE, int mask, /* OR'ed combination of TCL_READABLE,
* TCL_WRITABLE, and TCL_EXCEPTION: * TCL_WRITABLE, and TCL_EXCEPTION:
* indicates conditions under which * indicates conditions under which
* proc should be called. */ * proc should be called. */
Tcl_FileProc *proc; /* Procedure to call for each Tcl_FileProc *proc, /* Procedure to call for each
* selected event. */ * selected event. */
ClientData clientData; /* Arbitrary data to pass to proc. */ ClientData clientData /* Arbitrary data to pass to proc. */
)
{ {
register FileHandler *filePtr; register FileHandler *filePtr;
@ -397,9 +398,10 @@ Tcl_CreateFileHandler(file, mask, proc, clientData)
*/ */
void void
Tcl_DeleteFileHandler(file) Tcl_DeleteFileHandler(
Tcl_File file; /* Stream id for which to remove Tcl_File file /* Stream id for which to remove
* callback procedure. */ * callback procedure. */
)
{ {
FileHandler *filePtr, *prevPtr; FileHandler *filePtr, *prevPtr;
@ -449,8 +451,9 @@ Tcl_DeleteFileHandler(file)
/* ARGSUSED */ /* ARGSUSED */
static void static void
FileHandlerExitProc(clientData) FileHandlerExitProc(
ClientData clientData; /* Not used. */ ClientData clientData /* Not used. */
)
{ {
Tcl_DeleteEventSource(FileHandlerSetupProc, FileHandlerCheckProc, Tcl_DeleteEventSource(FileHandlerSetupProc, FileHandlerCheckProc,
(ClientData) NULL); (ClientData) NULL);
@ -475,12 +478,13 @@ FileHandlerExitProc(clientData)
*/ */
static void static void
FileHandlerSetupProc(clientData, flags) FileHandlerSetupProc(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
int flags; /* Flags passed to Tk_DoOneEvent: int flags /* Flags passed to Tk_DoOneEvent:
* if it doesn't include * if it doesn't include
* TCL_FILE_EVENTS then we do * TCL_FILE_EVENTS then we do
* nothing. */ * nothing. */
)
{ {
FileHandler *filePtr; FileHandler *filePtr;
@ -515,12 +519,13 @@ FileHandlerSetupProc(clientData, flags)
*/ */
static void static void
FileHandlerCheckProc(clientData, flags) FileHandlerCheckProc(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
int flags; /* Flags passed to Tk_DoOneEvent: int flags /* Flags passed to Tk_DoOneEvent:
* if it doesn't include * if it doesn't include
* TCL_FILE_EVENTS then we do * TCL_FILE_EVENTS then we do
* nothing. */ * nothing. */
)
{ {
FileHandler *filePtr; FileHandler *filePtr;
FileHandlerEvent *fileEvPtr; FileHandlerEvent *fileEvPtr;
@ -566,10 +571,11 @@ FileHandlerCheckProc(clientData, flags)
*/ */
static int static int
FileHandlerEventProc(evPtr, flags) FileHandlerEventProc(
Tcl_Event *evPtr; /* Event to service. */ Tcl_Event *evPtr, /* Event to service. */
int flags; /* Flags that indicate what events to int flags /* Flags that indicate what events to
* handle, such as TCL_FILE_EVENTS. */ * handle, such as TCL_FILE_EVENTS. */
)
{ {
FileHandler *filePtr; FileHandler *filePtr;
FileHandlerEvent *fileEvPtr = (FileHandlerEvent *) evPtr; FileHandlerEvent *fileEvPtr = (FileHandlerEvent *) evPtr;
@ -634,11 +640,12 @@ FileHandlerEventProc(evPtr, flags)
*/ */
Tcl_TimerToken Tcl_TimerToken
Tcl_CreateTimerHandler(milliseconds, proc, clientData) Tcl_CreateTimerHandler(
int milliseconds; /* How many milliseconds to wait int milliseconds, /* How many milliseconds to wait
* before invoking proc. */ * before invoking proc. */
Tcl_TimerProc *proc; /* Procedure to invoke. */ Tcl_TimerProc *proc, /* Procedure to invoke. */
ClientData clientData; /* Arbitrary data to pass to proc. */ ClientData clientData /* Arbitrary data to pass to proc. */
)
{ {
register TimerHandler *timerHandlerPtr, *tPtr2, *prevPtr; register TimerHandler *timerHandlerPtr, *tPtr2, *prevPtr;
static int id = 0; static int id = 0;
@ -715,9 +722,10 @@ Tcl_CreateTimerHandler(milliseconds, proc, clientData)
*/ */
void void
Tcl_DeleteTimerHandler(token) Tcl_DeleteTimerHandler(
Tcl_TimerToken token; /* Result previously returned by Tcl_TimerToken token /* Result previously returned by
* Tcl_DeleteTimerHandler. */ * Tcl_DeleteTimerHandler. */
)
{ {
register TimerHandler *timerHandlerPtr, *prevPtr; register TimerHandler *timerHandlerPtr, *prevPtr;
@ -756,11 +764,12 @@ Tcl_DeleteTimerHandler(token)
*/ */
void void
Tcl_CreateModalTimeout(milliseconds, proc, clientData) Tcl_CreateModalTimeout(
int milliseconds; /* How many milliseconds to wait int milliseconds, /* How many milliseconds to wait
* before invoking proc. */ * before invoking proc. */
Tcl_TimerProc *proc; /* Procedure to invoke. */ Tcl_TimerProc *proc, /* Procedure to invoke. */
ClientData clientData; /* Arbitrary data to pass to proc. */ ClientData clientData /* Arbitrary data to pass to proc. */
)
{ {
TimerHandler *timerHandlerPtr; TimerHandler *timerHandlerPtr;
@ -815,9 +824,10 @@ Tcl_CreateModalTimeout(milliseconds, proc, clientData)
*/ */
void void
Tcl_DeleteModalTimeout(proc, clientData) Tcl_DeleteModalTimeout(
Tcl_TimerProc *proc; /* Callback procedure for the timeout. */ Tcl_TimerProc *proc, /* Callback procedure for the timeout. */
ClientData clientData; /* Arbitrary data to pass to proc. */ ClientData clientData /* Arbitrary data to pass to proc. */
)
{ {
TimerHandler *timerHandlerPtr; TimerHandler *timerHandlerPtr;
@ -849,12 +859,13 @@ Tcl_DeleteModalTimeout(proc, clientData)
*/ */
static void static void
TimerHandlerSetupProc(clientData, flags) TimerHandlerSetupProc(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
int flags; /* Flags passed to Tk_DoOneEvent: int flags /* Flags passed to Tk_DoOneEvent:
* if it doesn't include * if it doesn't include
* TCL_TIMER_EVENTS then we only * TCL_TIMER_EVENTS then we only
* consider modal timers. */ * consider modal timers. */
)
{ {
TimerHandler *timerHandlerPtr, *tPtr2; TimerHandler *timerHandlerPtr, *tPtr2;
Tcl_Time blockTime; Tcl_Time blockTime;
@ -917,12 +928,13 @@ TimerHandlerSetupProc(clientData, flags)
*/ */
static void static void
TimerHandlerCheckProc(clientData, flags) TimerHandlerCheckProc(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
int flags; /* Flags passed to Tk_DoOneEvent: int flags /* Flags passed to Tk_DoOneEvent:
* if it doesn't include * if it doesn't include
* TCL_TIMER_EVENTS then we only * TCL_TIMER_EVENTS then we only
* consider modal timeouts. */ * consider modal timeouts. */
)
{ {
TimerHandler *timerHandlerPtr; TimerHandler *timerHandlerPtr;
TimerEvent *timerEvPtr; TimerEvent *timerEvPtr;
@ -980,8 +992,9 @@ TimerHandlerCheckProc(clientData, flags)
/* ARGSUSED */ /* ARGSUSED */
static void static void
TimerHandlerExitProc(clientData) TimerHandlerExitProc(
ClientData clientData; /* Not used. */ ClientData clientData /* Not used. */
)
{ {
Tcl_DeleteEventSource(TimerHandlerSetupProc, TimerHandlerCheckProc, Tcl_DeleteEventSource(TimerHandlerSetupProc, TimerHandlerCheckProc,
(ClientData) NULL); (ClientData) NULL);
@ -1010,10 +1023,11 @@ TimerHandlerExitProc(clientData)
*/ */
static int static int
TimerHandlerEventProc(evPtr, flags) TimerHandlerEventProc(
Tcl_Event *evPtr; /* Event to service. */ Tcl_Event *evPtr, /* Event to service. */
int flags; /* Flags that indicate what events to int flags /* Flags that indicate what events to
* handle, such as TCL_FILE_EVENTS. */ * handle, such as TCL_FILE_EVENTS. */
)
{ {
TimerHandler *timerHandlerPtr; TimerHandler *timerHandlerPtr;
TimerEvent *timerEvPtr = (TimerEvent *) evPtr; TimerEvent *timerEvPtr = (TimerEvent *) evPtr;
@ -1083,9 +1097,10 @@ TimerHandlerEventProc(evPtr, flags)
*/ */
void void
Tcl_DoWhenIdle(proc, clientData) Tcl_DoWhenIdle(
Tcl_IdleProc *proc; /* Procedure to invoke. */ Tcl_IdleProc *proc, /* Procedure to invoke. */
ClientData clientData; /* Arbitrary value to pass to proc. */ ClientData clientData /* Arbitrary value to pass to proc. */
)
{ {
register IdleHandler *idlePtr; register IdleHandler *idlePtr;
@ -1121,9 +1136,10 @@ Tcl_DoWhenIdle(proc, clientData)
*/ */
void void
Tcl_CancelIdleCall(proc, clientData) Tcl_CancelIdleCall(
Tcl_IdleProc *proc; /* Procedure that was previously registered. */ Tcl_IdleProc *proc, /* Procedure that was previously registered. */
ClientData clientData; /* Arbitrary value to pass to proc. */ ClientData clientData /* Arbitrary value to pass to proc. */
)
{ {
register IdleHandler *idlePtr, *prevPtr; register IdleHandler *idlePtr, *prevPtr;
IdleHandler *nextPtr; IdleHandler *nextPtr;
@ -1166,7 +1182,7 @@ Tcl_CancelIdleCall(proc, clientData)
*/ */
int int
TclIdlePending() TclIdlePending(void)
{ {
return (idleList == NULL) ? 0 : 1; return (idleList == NULL) ? 0 : 1;
} }
@ -1189,7 +1205,7 @@ TclIdlePending()
*/ */
int int
TclServiceIdle() TclServiceIdle(void)
{ {
IdleHandler *idlePtr; IdleHandler *idlePtr;
int oldGeneration; int oldGeneration;
@ -1259,9 +1275,10 @@ TclServiceIdle()
*/ */
void void
Tcl_BackgroundError(interp) Tcl_BackgroundError(
Tcl_Interp *interp; /* Interpreter in which an error has Tcl_Interp *interp /* Interpreter in which an error has
* occurred. */ * occurred. */
)
{ {
BgError *errPtr; BgError *errPtr;
char *varValue; char *varValue;
@ -1339,8 +1356,9 @@ Tcl_BackgroundError(interp)
*/ */
static void static void
HandleBgErrors(clientData) HandleBgErrors(
ClientData clientData; /* Pointer to ErrAssocData structure. */ ClientData clientData /* Pointer to ErrAssocData structure. */
)
{ {
Tcl_Interp *interp; Tcl_Interp *interp;
char *command; char *command;
@ -1458,9 +1476,10 @@ HandleBgErrors(clientData)
*/ */
static void static void
BgErrorDeleteProc(clientData, interp) BgErrorDeleteProc(
ClientData clientData; /* Pointer to ErrAssocData structure. */ ClientData clientData, /* Pointer to ErrAssocData structure. */
Tcl_Interp *interp; /* Interpreter being deleted. */ Tcl_Interp *interp /* Interpreter being deleted. */
)
{ {
ErrAssocData *assocPtr = (ErrAssocData *) clientData; ErrAssocData *assocPtr = (ErrAssocData *) clientData;
BgError *errPtr; BgError *errPtr;
@ -1496,9 +1515,10 @@ BgErrorDeleteProc(clientData, interp)
*/ */
void void
Tcl_CreateExitHandler(proc, clientData) Tcl_CreateExitHandler(
Tcl_ExitProc *proc; /* Procedure to invoke. */ Tcl_ExitProc *proc, /* Procedure to invoke. */
ClientData clientData; /* Arbitrary value to pass to proc. */ ClientData clientData /* Arbitrary value to pass to proc. */
)
{ {
ExitHandler *exitPtr; ExitHandler *exitPtr;
@ -1529,9 +1549,10 @@ Tcl_CreateExitHandler(proc, clientData)
*/ */
void void
Tcl_DeleteExitHandler(proc, clientData) Tcl_DeleteExitHandler(
Tcl_ExitProc *proc; /* Procedure that was previously registered. */ Tcl_ExitProc *proc, /* Procedure that was previously registered. */
ClientData clientData; /* Arbitrary value to pass to proc. */ ClientData clientData /* Arbitrary value to pass to proc. */
)
{ {
ExitHandler *exitPtr, *prevPtr; ExitHandler *exitPtr, *prevPtr;
@ -1568,9 +1589,10 @@ Tcl_DeleteExitHandler(proc, clientData)
*/ */
void void
Tcl_Exit(status) Tcl_Exit(
int status; /* Exit status for application; typically int status /* Exit status for application; typically
* 0 for normal return, 1 for error return. */ * 0 for normal return, 1 for error return. */
)
{ {
ExitHandler *exitPtr; ExitHandler *exitPtr;
@ -1613,13 +1635,14 @@ Tcl_Exit(status)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_AfterCmd(clientData, interp, argc, argv) Tcl_AfterCmd(
ClientData clientData; /* Points to the "tclAfter" assocData for ClientData clientData, /* Points to the "tclAfter" assocData for
* this interpreter, or NULL if the assocData * this interpreter, or NULL if the assocData
* hasn't been created yet.*/ * hasn't been created yet.*/
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
/* /*
* The variable below is used to generate unique identifiers for * The variable below is used to generate unique identifiers for
@ -1809,11 +1832,12 @@ Tcl_AfterCmd(clientData, interp, argc, argv)
*/ */
static AfterInfo * static AfterInfo *
GetAfterEvent(assocPtr, string) GetAfterEvent(
AfterAssocData *assocPtr; /* Points to "after"-related information for AfterAssocData *assocPtr, /* Points to "after"-related information for
* this interpreter. */ * this interpreter. */
char *string; /* Textual identifier for after event, such char *string /* Textual identifier for after event, such
* as "after#6". */ * as "after#6". */
)
{ {
AfterInfo *afterPtr; AfterInfo *afterPtr;
int id; int id;
@ -1857,8 +1881,9 @@ GetAfterEvent(assocPtr, string)
*/ */
static void static void
AfterProc(clientData) AfterProc(
ClientData clientData; /* Describes command to execute. */ ClientData clientData /* Describes command to execute. */
)
{ {
AfterInfo *afterPtr = (AfterInfo *) clientData; AfterInfo *afterPtr = (AfterInfo *) clientData;
AfterAssocData *assocPtr = afterPtr->assocPtr; AfterAssocData *assocPtr = afterPtr->assocPtr;
@ -1923,8 +1948,9 @@ AfterProc(clientData)
*/ */
static void static void
FreeAfterPtr(afterPtr) FreeAfterPtr(
AfterInfo *afterPtr; /* Command to be deleted. */ AfterInfo *afterPtr /* Command to be deleted. */
)
{ {
AfterInfo *prevPtr; AfterInfo *prevPtr;
AfterAssocData *assocPtr = afterPtr->assocPtr; AfterAssocData *assocPtr = afterPtr->assocPtr;
@ -1961,10 +1987,11 @@ FreeAfterPtr(afterPtr)
/* ARGSUSED */ /* ARGSUSED */
static void static void
AfterCleanupProc(clientData, interp) AfterCleanupProc(
ClientData clientData; /* Points to AfterAssocData for the ClientData clientData, /* Points to AfterAssocData for the
* interpreter. */ * interpreter. */
Tcl_Interp *interp; /* Interpreter that is being deleted. */ Tcl_Interp *interp /* Interpreter that is being deleted. */
)
{ {
AfterAssocData *assocPtr = (AfterAssocData *) clientData; AfterAssocData *assocPtr = (AfterAssocData *) clientData;
AfterInfo *afterPtr; AfterInfo *afterPtr;
@ -2002,11 +2029,12 @@ AfterCleanupProc(clientData, interp)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_VwaitCmd(clientData, interp, argc, argv) Tcl_VwaitCmd(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int done, foundEvent; int done, foundEvent;
@ -2043,12 +2071,13 @@ Tcl_VwaitCmd(clientData, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
static char * static char *
VwaitVarProc(clientData, interp, name1, name2, flags) VwaitVarProc(
ClientData clientData; /* Pointer to integer to set to 1. */ ClientData clientData, /* Pointer to integer to set to 1. */
Tcl_Interp *interp; /* Interpreter containing variable. */ Tcl_Interp *interp, /* Interpreter containing variable. */
char *name1; /* Name of variable. */ char *name1, /* Name of variable. */
char *name2; /* Second part of variable name. */ char *name2, /* Second part of variable name. */
int flags; /* Information about what happened. */ int flags /* Information about what happened. */
)
{ {
int *donePtr = (int *) clientData; int *donePtr = (int *) clientData;
@ -2075,11 +2104,12 @@ VwaitVarProc(clientData, interp, name1, name2, flags)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_UpdateCmd(clientData, interp, argc, argv) Tcl_UpdateCmd(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int flags = 0; /* Initialization needed only to stop int flags = 0; /* Initialization needed only to stop
* compiler warnings. */ * compiler warnings. */
@ -2137,16 +2167,17 @@ Tcl_UpdateCmd(clientData, interp, argc, argv)
*/ */
int int
TclWaitForFile(file, mask, timeout) TclWaitForFile(
Tcl_File file; /* Handle for file on which to wait. */ Tcl_File file, /* Handle for file on which to wait. */
int mask; /* What to wait for: OR'ed combination of int mask, /* What to wait for: OR'ed combination of
* TCL_READABLE, TCL_WRITABLE, and * TCL_READABLE, TCL_WRITABLE, and
* TCL_EXCEPTION. */ * TCL_EXCEPTION. */
int timeout; /* Maximum amount of time to wait for one int timeout /* Maximum amount of time to wait for one
* of the conditions in mask to occur, in * of the conditions in mask to occur, in
* milliseconds. A value of 0 means don't * milliseconds. A value of 0 means don't
* wait at all, and a value of -1 means * wait at all, and a value of -1 means
* wait forever. */ * wait forever. */
)
{ {
Tcl_Time abortTime, now, blockTime; Tcl_Time abortTime, now, blockTime;
int present; int present;

View file

@ -340,11 +340,12 @@ static BuiltinFunc funcTable[] = {
*/ */
static int static int
ExprParseString(interp, string, valuePtr) ExprParseString(
Tcl_Interp *interp; /* Where to store error message. */ Tcl_Interp *interp, /* Where to store error message. */
char *string; /* String to turn into value. */ char *string, /* String to turn into value. */
Value *valuePtr; /* Where to store value information. Value *valuePtr /* Where to store value information.
* Caller must have initialized pv field. */ * Caller must have initialized pv field. */
)
{ {
char *term, *p, *start; char *term, *p, *start;
@ -454,14 +455,15 @@ ExprParseString(interp, string, valuePtr)
*/ */
static int static int
ExprLex(interp, infoPtr, valuePtr) ExprLex(
Tcl_Interp *interp; /* Interpreter to use for error Tcl_Interp *interp, /* Interpreter to use for error
* reporting. */ * reporting. */
register ExprInfo *infoPtr; /* Describes the state of the parse. */ register ExprInfo *infoPtr, /* Describes the state of the parse. */
register Value *valuePtr; /* Where to store value, if that is register Value *valuePtr /* Where to store value, if that is
* what's parsed from string. Caller * what's parsed from string. Caller
* must have initialized pv field * must have initialized pv field
* correctly. */ * correctly. */
)
{ {
register char *p; register char *p;
char *var, *term; char *var, *term;
@ -731,19 +733,20 @@ ExprLex(interp, infoPtr, valuePtr)
*/ */
static int static int
ExprGetValue(interp, infoPtr, prec, valuePtr) ExprGetValue(
Tcl_Interp *interp; /* Interpreter to use for error Tcl_Interp *interp, /* Interpreter to use for error
* reporting. */ * reporting. */
register ExprInfo *infoPtr; /* Describes the state of the parse register ExprInfo *infoPtr, /* Describes the state of the parse
* just before the value (i.e. ExprLex * just before the value (i.e. ExprLex
* will be called to get first token * will be called to get first token
* of value). */ * of value). */
int prec; /* Treat any un-parenthesized operator int prec, /* Treat any un-parenthesized operator
* with precedence <= this as the end * with precedence <= this as the end
* of the expression. */ * of the expression. */
Value *valuePtr; /* Where to store the value of the Value *valuePtr /* Where to store the value of the
* expression. Caller must have * expression. Caller must have
* initialized pv field. */ * initialized pv field. */
)
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
Value value2; /* Second operand for current Value value2; /* Second operand for current
@ -1339,10 +1342,11 @@ ExprGetValue(interp, infoPtr, prec, valuePtr)
*/ */
static void static void
ExprMakeString(interp, valuePtr) ExprMakeString(
Tcl_Interp *interp; /* Interpreter to use for precision Tcl_Interp *interp, /* Interpreter to use for precision
* information. */ * information. */
register Value *valuePtr; /* Value to be converted. */ register Value *valuePtr /* Value to be converted. */
)
{ {
int shortfall; int shortfall;
@ -1382,12 +1386,13 @@ ExprMakeString(interp, valuePtr)
*/ */
static int static int
ExprTopLevel(interp, string, valuePtr) ExprTopLevel(
Tcl_Interp *interp; /* Context in which to evaluate the Tcl_Interp *interp, /* Context in which to evaluate the
* expression. */ * expression. */
char *string; /* Expression to evaluate. */ char *string, /* Expression to evaluate. */
Value *valuePtr; /* Where to store result. Should Value *valuePtr /* Where to store result. Should
* not be initialized by caller. */ * not be initialized by caller. */
)
{ {
ExprInfo info; ExprInfo info;
int result; int result;
@ -1459,11 +1464,12 @@ ExprTopLevel(interp, string, valuePtr)
*/ */
int int
Tcl_ExprLong(interp, string, ptr) Tcl_ExprLong(
Tcl_Interp *interp; /* Context in which to evaluate the Tcl_Interp *interp, /* Context in which to evaluate the
* expression. */ * expression. */
char *string; /* Expression to evaluate. */ char *string, /* Expression to evaluate. */
long *ptr; /* Where to store result. */ long *ptr /* Where to store result. */
)
{ {
Value value; Value value;
int result; int result;
@ -1486,11 +1492,12 @@ Tcl_ExprLong(interp, string, ptr)
} }
int int
Tcl_ExprDouble(interp, string, ptr) Tcl_ExprDouble(
Tcl_Interp *interp; /* Context in which to evaluate the Tcl_Interp *interp, /* Context in which to evaluate the
* expression. */ * expression. */
char *string; /* Expression to evaluate. */ char *string, /* Expression to evaluate. */
double *ptr; /* Where to store result. */ double *ptr /* Where to store result. */
)
{ {
Value value; Value value;
int result; int result;
@ -1513,11 +1520,12 @@ Tcl_ExprDouble(interp, string, ptr)
} }
int int
Tcl_ExprBoolean(interp, string, ptr) Tcl_ExprBoolean(
Tcl_Interp *interp; /* Context in which to evaluate the Tcl_Interp *interp, /* Context in which to evaluate the
* expression. */ * expression. */
char *string; /* Expression to evaluate. */ char *string, /* Expression to evaluate. */
int *ptr; /* Where to store 0/1 result. */ int *ptr /* Where to store 0/1 result. */
)
{ {
Value value; Value value;
int result; int result;
@ -1558,10 +1566,11 @@ Tcl_ExprBoolean(interp, string, ptr)
*/ */
int int
Tcl_ExprString(interp, string) Tcl_ExprString(
Tcl_Interp *interp; /* Context in which to evaluate the Tcl_Interp *interp, /* Context in which to evaluate the
* expression. */ * expression. */
char *string; /* Expression to evaluate. */ char *string /* Expression to evaluate. */
)
{ {
Value value; Value value;
int result; int result;
@ -1607,18 +1616,19 @@ Tcl_ExprString(interp, string)
*/ */
void void
Tcl_CreateMathFunc(interp, name, numArgs, argTypes, proc, clientData) Tcl_CreateMathFunc(
Tcl_Interp *interp; /* Interpreter in which function is Tcl_Interp *interp, /* Interpreter in which function is
* to be available. */ * to be available. */
char *name; /* Name of function (e.g. "sin"). */ char *name, /* Name of function (e.g. "sin"). */
int numArgs; /* Nnumber of arguments required by int numArgs, /* Nnumber of arguments required by
* function. */ * function. */
Tcl_ValueType *argTypes; /* Array of types acceptable for Tcl_ValueType *argTypes, /* Array of types acceptable for
* each argument. */ * each argument. */
Tcl_MathProc *proc; /* Procedure that implements the Tcl_MathProc *proc, /* Procedure that implements the
* math function. */ * math function. */
ClientData clientData; /* Additional value to pass to the ClientData clientData /* Additional value to pass to the
* function. */ * function. */
)
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
Tcl_HashEntry *hPtr; Tcl_HashEntry *hPtr;
@ -1665,17 +1675,18 @@ Tcl_CreateMathFunc(interp, name, numArgs, argTypes, proc, clientData)
*/ */
static int static int
ExprMathFunc(interp, infoPtr, valuePtr) ExprMathFunc(
Tcl_Interp *interp; /* Interpreter to use for error Tcl_Interp *interp, /* Interpreter to use for error
* reporting. */ * reporting. */
register ExprInfo *infoPtr; /* Describes the state of the parse. register ExprInfo *infoPtr, /* Describes the state of the parse.
* infoPtr->expr must point to the * infoPtr->expr must point to the
* first character of the function's * first character of the function's
* name. */ * name. */
register Value *valuePtr; /* Where to store value, if that is register Value *valuePtr /* Where to store value, if that is
* what's parsed from string. Caller * what's parsed from string. Caller
* must have initialized pv field * must have initialized pv field
* correctly. */ * correctly. */
)
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
MathFunc *mathFuncPtr; /* Info about math function. */ MathFunc *mathFuncPtr; /* Info about math function. */
@ -1838,10 +1849,11 @@ ExprMathFunc(interp, infoPtr, valuePtr)
*/ */
void void
TclExprFloatError(interp, value) TclExprFloatError(
Tcl_Interp *interp; /* Where to store error message. */ Tcl_Interp *interp, /* Where to store error message. */
double value; /* Value returned after error; used to double value /* Value returned after error; used to
* distinguish underflows from overflows. */ * distinguish underflows from overflows. */
)
{ {
char buf[20]; char buf[20];
@ -1888,13 +1900,14 @@ TclExprFloatError(interp, value)
*/ */
static int static int
ExprUnaryFunc(clientData, interp, args, resultPtr) ExprUnaryFunc(
ClientData clientData; /* Contains address of procedure that ClientData clientData, /* Contains address of procedure that
* takes one double argument and * takes one double argument and
* returns a double result. */ * returns a double result. */
Tcl_Interp *interp; Tcl_Interp *interp,
Tcl_Value *args; Tcl_Value *args,
Tcl_Value *resultPtr; Tcl_Value *resultPtr
)
{ {
double (*func) _ANSI_ARGS_((double)) = (double (*)_ANSI_ARGS_((double))) clientData; double (*func) _ANSI_ARGS_((double)) = (double (*)_ANSI_ARGS_((double))) clientData;
@ -1909,13 +1922,14 @@ ExprUnaryFunc(clientData, interp, args, resultPtr)
} }
static int static int
ExprBinaryFunc(clientData, interp, args, resultPtr) ExprBinaryFunc(
ClientData clientData; /* Contains address of procedure that ClientData clientData, /* Contains address of procedure that
* takes two double arguments and * takes two double arguments and
* returns a double result. */ * returns a double result. */
Tcl_Interp *interp; Tcl_Interp *interp,
Tcl_Value *args; Tcl_Value *args,
Tcl_Value *resultPtr; Tcl_Value *resultPtr
)
{ {
double (*func) _ANSI_ARGS_((double, double)) double (*func) _ANSI_ARGS_((double, double))
= (double (*)_ANSI_ARGS_((double, double))) clientData; = (double (*)_ANSI_ARGS_((double, double))) clientData;
@ -1932,11 +1946,12 @@ ExprBinaryFunc(clientData, interp, args, resultPtr)
/* ARGSUSED */ /* ARGSUSED */
static int static int
ExprAbsFunc(clientData, interp, args, resultPtr) ExprAbsFunc(
ClientData clientData; ClientData clientData,
Tcl_Interp *interp; Tcl_Interp *interp,
Tcl_Value *args; Tcl_Value *args,
Tcl_Value *resultPtr; Tcl_Value *resultPtr
)
{ {
resultPtr->type = TCL_DOUBLE; resultPtr->type = TCL_DOUBLE;
if (args[0].type == TCL_DOUBLE) { if (args[0].type == TCL_DOUBLE) {
@ -1965,11 +1980,12 @@ ExprAbsFunc(clientData, interp, args, resultPtr)
/* ARGSUSED */ /* ARGSUSED */
static int static int
ExprDoubleFunc(clientData, interp, args, resultPtr) ExprDoubleFunc(
ClientData clientData; ClientData clientData,
Tcl_Interp *interp; Tcl_Interp *interp,
Tcl_Value *args; Tcl_Value *args,
Tcl_Value *resultPtr; Tcl_Value *resultPtr
)
{ {
resultPtr->type = TCL_DOUBLE; resultPtr->type = TCL_DOUBLE;
if (args[0].type == TCL_DOUBLE) { if (args[0].type == TCL_DOUBLE) {
@ -1982,11 +1998,12 @@ ExprDoubleFunc(clientData, interp, args, resultPtr)
/* ARGSUSED */ /* ARGSUSED */
static int static int
ExprIntFunc(clientData, interp, args, resultPtr) ExprIntFunc(
ClientData clientData; ClientData clientData,
Tcl_Interp *interp; Tcl_Interp *interp,
Tcl_Value *args; Tcl_Value *args,
Tcl_Value *resultPtr; Tcl_Value *resultPtr
)
{ {
resultPtr->type = TCL_INT; resultPtr->type = TCL_INT;
if (args[0].type == TCL_INT) { if (args[0].type == TCL_INT) {
@ -2012,11 +2029,12 @@ ExprIntFunc(clientData, interp, args, resultPtr)
/* ARGSUSED */ /* ARGSUSED */
static int static int
ExprRoundFunc(clientData, interp, args, resultPtr) ExprRoundFunc(
ClientData clientData; ClientData clientData,
Tcl_Interp *interp; Tcl_Interp *interp,
Tcl_Value *args; Tcl_Value *args,
Tcl_Value *resultPtr; Tcl_Value *resultPtr
)
{ {
resultPtr->type = TCL_INT; resultPtr->type = TCL_INT;
if (args[0].type == TCL_INT) { if (args[0].type == TCL_INT) {
@ -2063,8 +2081,9 @@ ExprRoundFunc(clientData, interp, args, resultPtr)
*/ */
static int static int
ExprLooksLikeInt(p) ExprLooksLikeInt(
char *p; /* Pointer to string. */ char *p /* Pointer to string. */
)
{ {
while (isspace(UCHAR(*p))) { while (isspace(UCHAR(*p))) {
p++; p++;

View file

@ -85,9 +85,10 @@ static void FileExitProc _ANSI_ARGS_((ClientData clientData));
*/ */
Tcl_File Tcl_File
Tcl_GetFile(osHandle, type) Tcl_GetFile(
ClientData osHandle; /* Platform specific file handle. */ ClientData osHandle, /* Platform specific file handle. */
int type; /* Type of file handle. */ int type /* Type of file handle. */
)
{ {
FileHashKey key; FileHashKey key;
Tcl_HashEntry *entryPtr; Tcl_HashEntry *entryPtr;
@ -130,8 +131,9 @@ Tcl_GetFile(osHandle, type)
*/ */
void void
Tcl_FreeFile(handle) Tcl_FreeFile(
Tcl_File handle; Tcl_File handle
)
{ {
Tcl_HashEntry *entryPtr; Tcl_HashEntry *entryPtr;
FileHandle *handlePtr = (FileHandle *) handle; FileHandle *handlePtr = (FileHandle *) handle;
@ -170,9 +172,10 @@ Tcl_FreeFile(handle)
*/ */
ClientData ClientData
Tcl_GetFileInfo(handle, typePtr) Tcl_GetFileInfo(
Tcl_File handle; Tcl_File handle,
int *typePtr; int *typePtr
)
{ {
FileHandle *handlePtr = (FileHandle *) handle; FileHandle *handlePtr = (FileHandle *) handle;
@ -201,10 +204,11 @@ Tcl_GetFileInfo(handle, typePtr)
*/ */
void void
Tcl_SetNotifierData(handle, proc, data) Tcl_SetNotifierData(
Tcl_File handle; Tcl_File handle,
Tcl_FileFreeProc *proc; Tcl_FileFreeProc *proc,
ClientData data; ClientData data
)
{ {
FileHandle *handlePtr = (FileHandle *) handle; FileHandle *handlePtr = (FileHandle *) handle;
handlePtr->proc = proc; handlePtr->proc = proc;
@ -231,9 +235,10 @@ Tcl_SetNotifierData(handle, proc, data)
*/ */
ClientData ClientData
Tcl_GetNotifierData(handle, procPtr) Tcl_GetNotifierData(
Tcl_File handle; Tcl_File handle,
Tcl_FileFreeProc **procPtr; Tcl_FileFreeProc **procPtr
)
{ {
FileHandle *handlePtr = (FileHandle *) handle; FileHandle *handlePtr = (FileHandle *) handle;
if (procPtr != NULL) { if (procPtr != NULL) {
@ -260,8 +265,9 @@ Tcl_GetNotifierData(handle, procPtr)
*/ */
static void static void
FileExitProc(clientData) FileExitProc(
ClientData clientData; /* Not used. */ ClientData clientData /* Not used. */
)
{ {
Tcl_HashSearch search; Tcl_HashSearch search;
Tcl_HashEntry *entryPtr; Tcl_HashEntry *entryPtr;

View file

@ -113,8 +113,9 @@ static char * SplitUnixPath _ANSI_ARGS_((char *path,
*/ */
static void static void
FileNameCleanup(clientData) FileNameCleanup(
ClientData clientData; /* Not used. */ ClientData clientData /* Not used. */
)
{ {
if (winRootPatternPtr != NULL) { if (winRootPatternPtr != NULL) {
ckfree((char *)winRootPatternPtr); ckfree((char *)winRootPatternPtr);
@ -145,11 +146,12 @@ FileNameCleanup(clientData)
*/ */
static char * static char *
ExtractWinRoot(path, resultPtr, offset) ExtractWinRoot(
char *path; /* Path to parse. */ char *path, /* Path to parse. */
Tcl_DString *resultPtr; /* Buffer to hold result. */ Tcl_DString *resultPtr, /* Buffer to hold result. */
int offset; /* Offset in buffer where result should be int offset /* Offset in buffer where result should be
* stored. */ * stored. */
)
{ {
int length; int length;
@ -214,8 +216,9 @@ ExtractWinRoot(path, resultPtr, offset)
*/ */
Tcl_PathType Tcl_PathType
Tcl_GetPathType(path) Tcl_GetPathType(
char *path; char *path
)
{ {
Tcl_PathType type = TCL_PATH_ABSOLUTE; Tcl_PathType type = TCL_PATH_ABSOLUTE;
@ -311,12 +314,13 @@ Tcl_GetPathType(path)
*/ */
void void
Tcl_SplitPath(path, argcPtr, argvPtr) Tcl_SplitPath(
char *path; /* Pointer to string containing a path. */ char *path, /* Pointer to string containing a path. */
int *argcPtr; /* Pointer to location to fill in with int *argcPtr, /* Pointer to location to fill in with
* the number of elements in the path. */ * the number of elements in the path. */
char ***argvPtr; /* Pointer to place to store pointer to array char ***argvPtr /* Pointer to place to store pointer to array
* of pointers to path elements. */ * of pointers to path elements. */
)
{ {
int i, size; int i, size;
char *p; char *p;
@ -404,9 +408,10 @@ Tcl_SplitPath(path, argcPtr, argvPtr)
*/ */
static char * static char *
SplitUnixPath(path, bufPtr) SplitUnixPath(
char *path; /* Pointer to string containing a path. */ char *path, /* Pointer to string containing a path. */
Tcl_DString *bufPtr; /* Pointer to DString to use for the result. */ Tcl_DString *bufPtr /* Pointer to DString to use for the result. */
)
{ {
int length; int length;
char *p, *elementStart; char *p, *elementStart;
@ -466,9 +471,10 @@ SplitUnixPath(path, bufPtr)
*/ */
static char * static char *
SplitWinPath(path, bufPtr) SplitWinPath(
char *path; /* Pointer to string containing a path. */ char *path, /* Pointer to string containing a path. */
Tcl_DString *bufPtr; /* Pointer to DString to use for the result. */ Tcl_DString *bufPtr /* Pointer to DString to use for the result. */
)
{ {
int length; int length;
char *p, *elementStart; char *p, *elementStart;
@ -524,9 +530,10 @@ SplitWinPath(path, bufPtr)
*/ */
static char * static char *
SplitMacPath(path, bufPtr) SplitMacPath(
char *path; /* Pointer to string containing a path. */ char *path, /* Pointer to string containing a path. */
Tcl_DString *bufPtr; /* Pointer to DString to use for the result. */ Tcl_DString *bufPtr /* Pointer to DString to use for the result. */
)
{ {
int isMac = 0; /* 1 if is Mac-style, 0 if Unix-style path. */ int isMac = 0; /* 1 if is Mac-style, 0 if Unix-style path. */
int i, length; int i, length;
@ -703,10 +710,11 @@ SplitMacPath(path, bufPtr)
*/ */
char * char *
Tcl_JoinPath(argc, argv, resultPtr) Tcl_JoinPath(
int argc; int argc,
char **argv; char **argv,
Tcl_DString *resultPtr; /* Pointer to previously initialized DString. */ Tcl_DString *resultPtr /* Pointer to previously initialized DString. */
)
{ {
int oldLength, length, i, needsSep; int oldLength, length, i, needsSep;
Tcl_DString buffer; Tcl_DString buffer;
@ -927,16 +935,17 @@ Tcl_JoinPath(argc, argv, resultPtr)
*---------------------------------------------------------------------- */ *---------------------------------------------------------------------- */
char * char *
Tcl_TranslateFileName(interp, name, bufferPtr) Tcl_TranslateFileName(
Tcl_Interp *interp; /* Interpreter in which to store error Tcl_Interp *interp, /* Interpreter in which to store error
* message (if necessary). */ * message (if necessary). */
char *name; /* File name, which may begin with "~" char *name, /* File name, which may begin with "~"
* (to indicate current user's home directory) * (to indicate current user's home directory)
* or "~<user>" (to indicate any user's * or "~<user>" (to indicate any user's
* home directory). */ * home directory). */
Tcl_DString *bufferPtr; /* May be used to hold result. Must not hold Tcl_DString *bufferPtr /* May be used to hold result. Must not hold
* anything at the time of the call, and need * anything at the time of the call, and need
* not even be initialized. */ * not even be initialized. */
)
{ {
register char *p; register char *p;
@ -1011,8 +1020,9 @@ Tcl_TranslateFileName(interp, name, bufferPtr)
*/ */
char * char *
TclGetExtension(name) TclGetExtension(
char *name; /* File name to parse. */ char *name /* File name to parse. */
)
{ {
char *p, *lastSep; char *p, *lastSep;
@ -1073,14 +1083,15 @@ TclGetExtension(name)
*/ */
static char * static char *
DoTildeSubst(interp, user, resultPtr) DoTildeSubst(
Tcl_Interp *interp; /* Interpreter in which to store error Tcl_Interp *interp, /* Interpreter in which to store error
* message (if necessary). */ * message (if necessary). */
char *user; /* Name of user whose home directory should be char *user, /* Name of user whose home directory should be
* substituted, or "" for current user. */ * substituted, or "" for current user. */
Tcl_DString *resultPtr; /* May be used to hold result. Must not hold Tcl_DString *resultPtr /* May be used to hold result. Must not hold
* anything at the time of the call, and need * anything at the time of the call, and need
* not even be initialized. */ * not even be initialized. */
)
{ {
char *dir; char *dir;
@ -1127,11 +1138,12 @@ DoTildeSubst(interp, user, resultPtr)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_GlobCmd(dummy, interp, argc, argv) Tcl_GlobCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int i, noComplain, firstArg; int i, noComplain, firstArg;
char c; char c;
@ -1283,9 +1295,10 @@ done:
*/ */
static int static int
SkipToChar(stringPtr, match) SkipToChar(
char **stringPtr; /* Pointer string to check. */ char **stringPtr, /* Pointer string to check. */
char *match; /* Pointer to character to find. */ char *match /* Pointer to character to find. */
)
{ {
int quoted, level; int quoted, level;
register char *p; register char *p;
@ -1338,14 +1351,15 @@ SkipToChar(stringPtr, match)
*/ */
int int
TclDoGlob(interp, separators, headPtr, tail) TclDoGlob(
Tcl_Interp *interp; /* Interpreter to use for error reporting Tcl_Interp *interp, /* Interpreter to use for error reporting
* (e.g. unmatched brace). */ * (e.g. unmatched brace). */
char *separators; /* String containing separator characters char *separators, /* String containing separator characters
* that should be used to identify globbing * that should be used to identify globbing
* boundaries. */ * boundaries. */
Tcl_DString *headPtr; /* Completely expanded prefix. */ Tcl_DString *headPtr, /* Completely expanded prefix. */
char *tail; /* The unexpanded remainder of the path. */ char *tail /* The unexpanded remainder of the path. */
)
{ {
int level, baseLength, quoted, count; int level, baseLength, quoted, count;
int result = TCL_OK; int result = TCL_OK;

View file

@ -61,11 +61,12 @@
*/ */
int int
Tcl_GetInt(interp, string, intPtr) Tcl_GetInt(
Tcl_Interp *interp; /* Interpreter to use for error reporting. */ Tcl_Interp *interp, /* Interpreter to use for error reporting. */
char *string; /* String containing a (possibly signed) char *string, /* String containing a (possibly signed)
* integer in a form acceptable to strtol. */ * integer in a form acceptable to strtol. */
int *intPtr; /* Place to store converted result. */ int *intPtr /* Place to store converted result. */
)
{ {
char *end, *p; char *end, *p;
int i; int i;
@ -136,11 +137,12 @@ Tcl_GetInt(interp, string, intPtr)
*/ */
int int
Tcl_GetDouble(interp, string, doublePtr) Tcl_GetDouble(
Tcl_Interp *interp; /* Interpreter to use for error reporting. */ Tcl_Interp *interp, /* Interpreter to use for error reporting. */
char *string; /* String containing a floating-point number char *string, /* String containing a floating-point number
* in a form acceptable to strtod. */ * in a form acceptable to strtod. */
double *doublePtr; /* Place to store converted result. */ double *doublePtr /* Place to store converted result. */
)
{ {
char *end; char *end;
double d; double d;
@ -193,13 +195,14 @@ Tcl_GetDouble(interp, string, doublePtr)
*/ */
int int
Tcl_GetBoolean(interp, string, boolPtr) Tcl_GetBoolean(
Tcl_Interp *interp; /* Interpreter to use for error reporting. */ Tcl_Interp *interp, /* Interpreter to use for error reporting. */
char *string; /* String containing a boolean number char *string, /* String containing a boolean number
* specified either as 1/0 or true/false or * specified either as 1/0 or true/false or
* yes/no. */ * yes/no. */
int *boolPtr; /* Place to store converted result, which int *boolPtr /* Place to store converted result, which
* will be 0 or 1. */ * will be 0 or 1. */
)
{ {
int i; int i;
char lowerCase[10], c; char lowerCase[10], c;

View file

@ -99,12 +99,13 @@ static Tcl_HashEntry * OneWordCreate _ANSI_ARGS_((Tcl_HashTable *tablePtr,
*/ */
void void
Tcl_InitHashTable(tablePtr, keyType) Tcl_InitHashTable(
register Tcl_HashTable *tablePtr; /* Pointer to table record, which register Tcl_HashTable *tablePtr, /* Pointer to table record, which
* is supplied by the caller. */ * is supplied by the caller. */
int keyType; /* Type of keys to use in table: int keyType /* Type of keys to use in table:
* TCL_STRING_KEYS, TCL_ONE_WORD_KEYS, * TCL_STRING_KEYS, TCL_ONE_WORD_KEYS,
* or an integer >= 2. */ * or an integer >= 2. */
)
{ {
tablePtr->buckets = tablePtr->staticBuckets; tablePtr->buckets = tablePtr->staticBuckets;
tablePtr->staticBuckets[0] = tablePtr->staticBuckets[1] = 0; tablePtr->staticBuckets[0] = tablePtr->staticBuckets[1] = 0;
@ -147,8 +148,9 @@ Tcl_InitHashTable(tablePtr, keyType)
*/ */
void void
Tcl_DeleteHashEntry(entryPtr) Tcl_DeleteHashEntry(
Tcl_HashEntry *entryPtr; Tcl_HashEntry *entryPtr
)
{ {
register Tcl_HashEntry *prevPtr; register Tcl_HashEntry *prevPtr;
@ -187,8 +189,9 @@ Tcl_DeleteHashEntry(entryPtr)
*/ */
void void
Tcl_DeleteHashTable(tablePtr) Tcl_DeleteHashTable(
register Tcl_HashTable *tablePtr; /* Table to delete. */ register Tcl_HashTable *tablePtr /* Table to delete. */
)
{ {
register Tcl_HashEntry *hPtr, *nextPtr; register Tcl_HashEntry *hPtr, *nextPtr;
int i; int i;
@ -246,10 +249,11 @@ Tcl_DeleteHashTable(tablePtr)
*/ */
Tcl_HashEntry * Tcl_HashEntry *
Tcl_FirstHashEntry(tablePtr, searchPtr) Tcl_FirstHashEntry(
Tcl_HashTable *tablePtr; /* Table to search. */ Tcl_HashTable *tablePtr, /* Table to search. */
Tcl_HashSearch *searchPtr; /* Place to store information about Tcl_HashSearch *searchPtr /* Place to store information about
* progress through the table. */ * progress through the table. */
)
{ {
searchPtr->tablePtr = tablePtr; searchPtr->tablePtr = tablePtr;
searchPtr->nextIndex = 0; searchPtr->nextIndex = 0;
@ -277,11 +281,12 @@ Tcl_FirstHashEntry(tablePtr, searchPtr)
*/ */
Tcl_HashEntry * Tcl_HashEntry *
Tcl_NextHashEntry(searchPtr) Tcl_NextHashEntry(
register Tcl_HashSearch *searchPtr; /* Place to store information about register Tcl_HashSearch *searchPtr /* Place to store information about
* progress through the table. Must * progress through the table. Must
* have been initialized by calling * have been initialized by calling
* Tcl_FirstHashEntry. */ * Tcl_FirstHashEntry. */
)
{ {
Tcl_HashEntry *hPtr; Tcl_HashEntry *hPtr;
@ -318,8 +323,9 @@ Tcl_NextHashEntry(searchPtr)
*/ */
char * char *
Tcl_HashStats(tablePtr) Tcl_HashStats(
Tcl_HashTable *tablePtr; /* Table for which to produce stats. */ Tcl_HashTable *tablePtr /* Table for which to produce stats. */
)
{ {
#define NUM_COUNTERS 10 #define NUM_COUNTERS 10
int count[NUM_COUNTERS], overflow, i, j; int count[NUM_COUNTERS], overflow, i, j;
@ -389,8 +395,9 @@ Tcl_HashStats(tablePtr)
*/ */
static unsigned int static unsigned int
HashString(string) HashString(
register char *string; /* String from which to compute hash value. */ register char *string /* String from which to compute hash value. */
)
{ {
register unsigned int result; register unsigned int result;
register int c; register int c;
@ -442,9 +449,10 @@ HashString(string)
*/ */
static Tcl_HashEntry * static Tcl_HashEntry *
StringFind(tablePtr, key) StringFind(
Tcl_HashTable *tablePtr; /* Table in which to lookup entry. */ Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */
char *key; /* Key to use to find matching entry. */ char *key /* Key to use to find matching entry. */
)
{ {
register Tcl_HashEntry *hPtr; register Tcl_HashEntry *hPtr;
register char *p1, *p2; register char *p1, *p2;
@ -492,12 +500,13 @@ StringFind(tablePtr, key)
*/ */
static Tcl_HashEntry * static Tcl_HashEntry *
StringCreate(tablePtr, key, newPtr) StringCreate(
Tcl_HashTable *tablePtr; /* Table in which to lookup entry. */ Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */
char *key; /* Key to use to find or create matching char *key, /* Key to use to find or create matching
* entry. */ * entry. */
int *newPtr; /* Store info here telling whether a new int *newPtr /* Store info here telling whether a new
* entry was created. */ * entry was created. */
)
{ {
register Tcl_HashEntry *hPtr; register Tcl_HashEntry *hPtr;
register char *p1, *p2; register char *p1, *p2;
@ -567,9 +576,10 @@ StringCreate(tablePtr, key, newPtr)
*/ */
static Tcl_HashEntry * static Tcl_HashEntry *
OneWordFind(tablePtr, key) OneWordFind(
Tcl_HashTable *tablePtr; /* Table in which to lookup entry. */ Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */
register char *key; /* Key to use to find matching entry. */ register char *key /* Key to use to find matching entry. */
)
{ {
register Tcl_HashEntry *hPtr; register Tcl_HashEntry *hPtr;
int index; int index;
@ -611,12 +621,13 @@ OneWordFind(tablePtr, key)
*/ */
static Tcl_HashEntry * static Tcl_HashEntry *
OneWordCreate(tablePtr, key, newPtr) OneWordCreate(
Tcl_HashTable *tablePtr; /* Table in which to lookup entry. */ Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */
register char *key; /* Key to use to find or create matching register char *key, /* Key to use to find or create matching
* entry. */ * entry. */
int *newPtr; /* Store info here telling whether a new int *newPtr /* Store info here telling whether a new
* entry was created. */ * entry was created. */
)
{ {
register Tcl_HashEntry *hPtr; register Tcl_HashEntry *hPtr;
int index; int index;
@ -679,9 +690,10 @@ OneWordCreate(tablePtr, key, newPtr)
*/ */
static Tcl_HashEntry * static Tcl_HashEntry *
ArrayFind(tablePtr, key) ArrayFind(
Tcl_HashTable *tablePtr; /* Table in which to lookup entry. */ Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */
char *key; /* Key to use to find matching entry. */ char *key /* Key to use to find matching entry. */
)
{ {
register Tcl_HashEntry *hPtr; register Tcl_HashEntry *hPtr;
int *arrayPtr = (int *) key; int *arrayPtr = (int *) key;
@ -735,12 +747,13 @@ ArrayFind(tablePtr, key)
*/ */
static Tcl_HashEntry * static Tcl_HashEntry *
ArrayCreate(tablePtr, key, newPtr) ArrayCreate(
Tcl_HashTable *tablePtr; /* Table in which to lookup entry. */ Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */
register char *key; /* Key to use to find or create matching register char *key, /* Key to use to find or create matching
* entry. */ * entry. */
int *newPtr; /* Store info here telling whether a new int *newPtr /* Store info here telling whether a new
* entry was created. */ * entry was created. */
)
{ {
register Tcl_HashEntry *hPtr; register Tcl_HashEntry *hPtr;
int *arrayPtr = (int *) key; int *arrayPtr = (int *) key;
@ -820,9 +833,10 @@ ArrayCreate(tablePtr, key, newPtr)
/* ARGSUSED */ /* ARGSUSED */
static Tcl_HashEntry * static Tcl_HashEntry *
BogusFind(tablePtr, key) BogusFind(
Tcl_HashTable *tablePtr; /* Table in which to lookup entry. */ Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */
char *key; /* Key to use to find matching entry. */ char *key /* Key to use to find matching entry. */
)
{ {
panic("called Tcl_FindHashEntry on deleted table"); panic("called Tcl_FindHashEntry on deleted table");
return NULL; return NULL;
@ -848,12 +862,13 @@ BogusFind(tablePtr, key)
/* ARGSUSED */ /* ARGSUSED */
static Tcl_HashEntry * static Tcl_HashEntry *
BogusCreate(tablePtr, key, newPtr) BogusCreate(
Tcl_HashTable *tablePtr; /* Table in which to lookup entry. */ Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */
char *key; /* Key to use to find or create matching char *key, /* Key to use to find or create matching
* entry. */ * entry. */
int *newPtr; /* Store info here telling whether a new int *newPtr /* Store info here telling whether a new
* entry was created. */ * entry was created. */
)
{ {
panic("called Tcl_CreateHashEntry on deleted table"); panic("called Tcl_CreateHashEntry on deleted table");
return NULL; return NULL;
@ -880,8 +895,9 @@ BogusCreate(tablePtr, key, newPtr)
*/ */
static void static void
RebuildTable(tablePtr) RebuildTable(
register Tcl_HashTable *tablePtr; /* Table to enlarge. */ register Tcl_HashTable *tablePtr /* Table to enlarge. */
)
{ {
int oldSize, count, index; int oldSize, count, index;
Tcl_HashEntry **oldBuckets; Tcl_HashEntry **oldBuckets;

View file

@ -138,8 +138,9 @@ static int SubsAndEval _ANSI_ARGS_((Interp *iPtr, char *cmd,
*/ */
static void static void
InitHistory(iPtr) InitHistory(
register Interp *iPtr; /* Interpreter to initialize. */ register Interp *iPtr /* Interpreter to initialize. */
)
{ {
int i; int i;
@ -182,14 +183,15 @@ InitHistory(iPtr)
*/ */
int int
Tcl_RecordAndEval(interp, cmd, flags) Tcl_RecordAndEval(
Tcl_Interp *interp; /* Token for interpreter in which command Tcl_Interp *interp, /* Token for interpreter in which command
* will be executed. */ * will be executed. */
char *cmd; /* Command to record. */ char *cmd, /* Command to record. */
int flags; /* Additional flags. TCL_NO_EVAL means int flags /* Additional flags. TCL_NO_EVAL means
* only record: don't execute command. * only record: don't execute command.
* TCL_EVAL_GLOBAL means use Tcl_GlobalEval * TCL_EVAL_GLOBAL means use Tcl_GlobalEval
* instead of Tcl_Eval. */ * instead of Tcl_Eval. */
)
{ {
register Interp *iPtr = (Interp *) interp; register Interp *iPtr = (Interp *) interp;
register HistoryEvent *eventPtr; register HistoryEvent *eventPtr;
@ -273,11 +275,12 @@ Tcl_RecordAndEval(interp, cmd, flags)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_HistoryCmd(dummy, interp, argc, argv) Tcl_HistoryCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
register Interp *iPtr = (Interp *) interp; register Interp *iPtr = (Interp *) interp;
register HistoryEvent *eventPtr; register HistoryEvent *eventPtr;
@ -554,9 +557,10 @@ Tcl_HistoryCmd(dummy, interp, argc, argv)
*/ */
static void static void
MakeSpace(hPtr, size) MakeSpace(
HistoryEvent *hPtr; HistoryEvent *hPtr,
int size; /* # of bytes needed in hPtr. */ int size /* # of bytes needed in hPtr. */
)
{ {
if (hPtr->bytesAvl < size) { if (hPtr->bytesAvl < size) {
ckfree(hPtr->command); ckfree(hPtr->command);
@ -585,9 +589,10 @@ MakeSpace(hPtr, size)
*/ */
static void static void
InsertRev(iPtr, revPtr) InsertRev(
Interp *iPtr; /* Interpreter to use. */ Interp *iPtr, /* Interpreter to use. */
register HistoryRev *revPtr; /* Revision to add to iPtr's list. */ register HistoryRev *revPtr /* Revision to add to iPtr's list. */
)
{ {
register HistoryRev *curPtr; register HistoryRev *curPtr;
register HistoryRev *prevPtr; register HistoryRev *prevPtr;
@ -653,10 +658,11 @@ InsertRev(iPtr, revPtr)
*/ */
static void static void
RevCommand(iPtr, string) RevCommand(
register Interp *iPtr; /* Interpreter in which to perform the register Interp *iPtr, /* Interpreter in which to perform the
* substitution. */ * substitution. */
char *string; /* String to substitute. */ char *string /* String to substitute. */
)
{ {
register HistoryRev *revPtr; register HistoryRev *revPtr;
@ -691,10 +697,11 @@ RevCommand(iPtr, string)
*/ */
static void static void
RevResult(iPtr, string) RevResult(
register Interp *iPtr; /* Interpreter in which to perform the register Interp *iPtr, /* Interpreter in which to perform the
* substitution. */ * substitution. */
char *string; /* String to substitute. */ char *string /* String to substitute. */
)
{ {
register HistoryRev *revPtr; register HistoryRev *revPtr;
char *evalFirst, *evalLast; char *evalFirst, *evalLast;
@ -757,9 +764,10 @@ RevResult(iPtr, string)
*/ */
static void static void
DoRevs(iPtr) DoRevs(
register Interp *iPtr; /* Interpreter whose history is to register Interp *iPtr /* Interpreter whose history is to
* be modified. */ * be modified. */
)
{ {
register HistoryRev *revPtr; register HistoryRev *revPtr;
register HistoryEvent *eventPtr; register HistoryEvent *eventPtr;
@ -835,9 +843,10 @@ DoRevs(iPtr)
*/ */
static HistoryEvent * static HistoryEvent *
GetEvent(iPtr, string) GetEvent(
register Interp *iPtr; /* Interpreter in which to look. */ register Interp *iPtr, /* Interpreter in which to look. */
char *string; /* Description of event. */ char *string /* Description of event. */
)
{ {
int eventNum, index; int eventNum, index;
register HistoryEvent *eventPtr; register HistoryEvent *eventPtr;
@ -917,12 +926,13 @@ GetEvent(iPtr, string)
*/ */
static int static int
SubsAndEval(iPtr, cmd, old, new) SubsAndEval(
register Interp *iPtr; /* Interpreter in which to execute register Interp *iPtr, /* Interpreter in which to execute
* new command. */ * new command. */
char *cmd; /* Command in which to substitute. */ char *cmd, /* Command in which to substitute. */
char *old; /* String to search for in command. */ char *old, /* String to search for in command. */
char *new; /* Replacement string for "old". */ char *new /* Replacement string for "old". */
)
{ {
char *src, *dst, *newCmd; char *src, *dst, *newCmd;
int count, oldLength, newLength, length, result; int count, oldLength, newLength, length, result;
@ -999,13 +1009,14 @@ SubsAndEval(iPtr, cmd, old, new)
*/ */
static char * static char *
GetWords(iPtr, command, words) GetWords(
register Interp *iPtr; /* Tcl interpreter in which to place register Interp *iPtr, /* Tcl interpreter in which to place
* an error message if needed. */ * an error message if needed. */
char *command; /* Command string. */ char *command, /* Command string. */
char *words; /* Description of which words to extract char *words /* Description of which words to extract
* from the command. Either num[-num] or * from the command. Either num[-num] or
* a pattern. */ * a pattern. */
)
{ {
char *result; char *result;
char *start, *end, *dst; char *start, *end, *dst;

View file

@ -390,9 +390,10 @@ static int ScanInputForEOL _ANSI_ARGS_((Channel *chanPtr,
*/ */
void void
Tcl_SetStdChannel(channel, type) Tcl_SetStdChannel(
Tcl_Channel channel; Tcl_Channel channel,
int type; /* One of TCL_STDIN, TCL_STDOUT, TCL_STDERR. */ int type /* One of TCL_STDIN, TCL_STDOUT, TCL_STDERR. */
)
{ {
switch (type) { switch (type) {
case TCL_STDIN: case TCL_STDIN:
@ -428,8 +429,9 @@ Tcl_SetStdChannel(channel, type)
*/ */
Tcl_Channel Tcl_Channel
Tcl_GetStdChannel(type) Tcl_GetStdChannel(
int type; /* One of TCL_STDIN, TCL_STDOUT, TCL_STDERR. */ int type /* One of TCL_STDIN, TCL_STDOUT, TCL_STDERR. */
)
{ {
Tcl_Channel channel = NULL; Tcl_Channel channel = NULL;
@ -486,13 +488,14 @@ Tcl_GetStdChannel(type)
*/ */
void void
Tcl_CreateCloseHandler(chan, proc, clientData) Tcl_CreateCloseHandler(
Tcl_Channel chan; /* The channel for which to create the Tcl_Channel chan, /* The channel for which to create the
* close callback. */ * close callback. */
Tcl_CloseProc *proc; /* The callback routine to call when the Tcl_CloseProc *proc, /* The callback routine to call when the
* channel will be closed. */ * channel will be closed. */
ClientData clientData; /* Arbitrary data to pass to the ClientData clientData /* Arbitrary data to pass to the
* close callback. */ * close callback. */
)
{ {
Channel *chanPtr; Channel *chanPtr;
CloseCallback *cbPtr; CloseCallback *cbPtr;
@ -527,13 +530,14 @@ Tcl_CreateCloseHandler(chan, proc, clientData)
*/ */
void void
Tcl_DeleteCloseHandler(chan, proc, clientData) Tcl_DeleteCloseHandler(
Tcl_Channel chan; /* The channel for which to cancel the Tcl_Channel chan, /* The channel for which to cancel the
* close callback. */ * close callback. */
Tcl_CloseProc *proc; /* The procedure for the callback to Tcl_CloseProc *proc, /* The procedure for the callback to
* remove. */ * remove. */
ClientData clientData; /* The callback data for the callback ClientData clientData /* The callback data for the callback
* to remove. */ * to remove. */
)
{ {
Channel *chanPtr; Channel *chanPtr;
CloseCallback *cbPtr, *cbPrevPtr; CloseCallback *cbPtr, *cbPrevPtr;
@ -575,8 +579,9 @@ Tcl_DeleteCloseHandler(chan, proc, clientData)
/* ARGSUSED */ /* ARGSUSED */
static void static void
CloseChannelsOnExit(clientData) CloseChannelsOnExit(
ClientData clientData; /* NULL - unused. */ ClientData clientData /* NULL - unused. */
)
{ {
Channel *chanPtr; /* Iterates over open channels. */ Channel *chanPtr; /* Iterates over open channels. */
Channel *nextChanPtr; /* Iterates over open channels. */ Channel *nextChanPtr; /* Iterates over open channels. */
@ -628,8 +633,9 @@ CloseChannelsOnExit(clientData)
*/ */
static Tcl_HashTable * static Tcl_HashTable *
GetChannelTable(interp) GetChannelTable(
Tcl_Interp *interp; Tcl_Interp *interp
)
{ {
Tcl_HashTable *hTblPtr; /* Hash table of channels. */ Tcl_HashTable *hTblPtr; /* Hash table of channels. */
Tcl_Channel stdinChannel, stdoutChannel, stderrChannel; Tcl_Channel stdinChannel, stdoutChannel, stderrChannel;
@ -690,9 +696,10 @@ GetChannelTable(interp)
*/ */
static void static void
DeleteChannelTable(clientData, interp) DeleteChannelTable(
ClientData clientData; /* The per-interpreter data structure. */ ClientData clientData, /* The per-interpreter data structure. */
Tcl_Interp *interp; /* The interpreter being deleted. */ Tcl_Interp *interp /* The interpreter being deleted. */
)
{ {
Tcl_HashTable *hTblPtr; /* The hash table. */ Tcl_HashTable *hTblPtr; /* The hash table. */
Tcl_HashSearch hSearch; /* Search variable. */ Tcl_HashSearch hSearch; /* Search variable. */
@ -778,9 +785,10 @@ DeleteChannelTable(clientData, interp)
*/ */
int int
Tcl_UnregisterChannel(interp, chan) Tcl_UnregisterChannel(
Tcl_Interp *interp; /* Interpreter in which channel is defined. */ Tcl_Interp *interp, /* Interpreter in which channel is defined. */
Tcl_Channel chan; /* Channel to delete. */ Tcl_Channel chan /* Channel to delete. */
)
{ {
Tcl_HashTable *hTblPtr; /* Hash table of channels. */ Tcl_HashTable *hTblPtr; /* Hash table of channels. */
Tcl_HashEntry *hPtr; /* Search variable. */ Tcl_HashEntry *hPtr; /* Search variable. */
@ -828,10 +836,11 @@ Tcl_UnregisterChannel(interp, chan)
*/ */
void void
Tcl_RegisterChannel(interp, chan) Tcl_RegisterChannel(
Tcl_Interp *interp; /* Interpreter in which to add the channel. */ Tcl_Interp *interp, /* Interpreter in which to add the channel. */
Tcl_Channel chan; /* The channel to add to this interpreter Tcl_Channel chan /* The channel to add to this interpreter
* channel table. */ * channel table. */
)
{ {
Tcl_HashTable *hTblPtr; /* Hash table of channels. */ Tcl_HashTable *hTblPtr; /* Hash table of channels. */
Tcl_HashEntry *hPtr; /* Search variable. */ Tcl_HashEntry *hPtr; /* Search variable. */
@ -876,14 +885,15 @@ Tcl_RegisterChannel(interp, chan)
*/ */
Tcl_Channel Tcl_Channel
Tcl_GetChannel(interp, chanName, modePtr) Tcl_GetChannel(
Tcl_Interp *interp; /* Interpreter in which to find or create Tcl_Interp *interp, /* Interpreter in which to find or create
* the channel. */ * the channel. */
char *chanName; /* The name of the channel. */ char *chanName, /* The name of the channel. */
int *modePtr; /* Where to store the mode in which the int *modePtr /* Where to store the mode in which the
* channel was opened? Will contain an ORed * channel was opened? Will contain an ORed
* combination of TCL_READABLE and * combination of TCL_READABLE and
* TCL_WRITABLE, if non-NULL. */ * TCL_WRITABLE, if non-NULL. */
)
{ {
Channel *chanPtr; /* The actual channel. */ Channel *chanPtr; /* The actual channel. */
Tcl_HashTable *hTblPtr; /* Hash table of channels. */ Tcl_HashTable *hTblPtr; /* Hash table of channels. */
@ -948,12 +958,13 @@ Tcl_GetChannel(interp, chanName, modePtr)
*/ */
Tcl_Channel Tcl_Channel
Tcl_CreateChannel(typePtr, chanName, inFile, outFile, instanceData) Tcl_CreateChannel(
Tcl_ChannelType *typePtr; /* The channel type record. */ Tcl_ChannelType *typePtr, /* The channel type record. */
char *chanName; /* Name of channel to record. */ char *chanName, /* Name of channel to record. */
Tcl_File inFile; /* File to use for input, or NULL. */ Tcl_File inFile, /* File to use for input, or NULL. */
Tcl_File outFile; /* File to use for output, or NULL. */ Tcl_File outFile, /* File to use for output, or NULL. */
ClientData instanceData; /* Instance specific data. */ ClientData instanceData /* Instance specific data. */
)
{ {
Channel *chanPtr; /* The channel structure newly created. */ Channel *chanPtr; /* The channel structure newly created. */
@ -1053,8 +1064,9 @@ Tcl_CreateChannel(typePtr, chanName, inFile, outFile, instanceData)
*/ */
char * char *
Tcl_GetChannelName(chan) Tcl_GetChannelName(
Tcl_Channel chan; /* The channel for which to return the name. */ Tcl_Channel chan /* The channel for which to return the name. */
)
{ {
Channel *chanPtr; /* The actual channel. */ Channel *chanPtr; /* The actual channel. */
@ -1079,8 +1091,9 @@ Tcl_GetChannelName(chan)
*/ */
Tcl_ChannelType * Tcl_ChannelType *
Tcl_GetChannelType(chan) Tcl_GetChannelType(
Tcl_Channel chan; /* The channel to return type for. */ Tcl_Channel chan /* The channel to return type for. */
)
{ {
Channel *chanPtr; /* The actual channel. */ Channel *chanPtr; /* The actual channel. */
@ -1106,9 +1119,10 @@ Tcl_GetChannelType(chan)
*/ */
Tcl_File Tcl_File
Tcl_GetChannelFile(chan, direction) Tcl_GetChannelFile(
Tcl_Channel chan; /* The channel to get file from. */ Tcl_Channel chan, /* The channel to get file from. */
int direction; /* TCL_WRITABLE or TCL_READABLE. */ int direction /* TCL_WRITABLE or TCL_READABLE. */
)
{ {
Channel *chanPtr; /* The actual channel. */ Channel *chanPtr; /* The actual channel. */
@ -1140,8 +1154,9 @@ Tcl_GetChannelFile(chan, direction)
*/ */
ClientData ClientData
Tcl_GetChannelInstanceData(chan) Tcl_GetChannelInstanceData(
Tcl_Channel chan; /* Channel for which to return client data. */ Tcl_Channel chan /* Channel for which to return client data. */
)
{ {
Channel *chanPtr; /* The actual channel. */ Channel *chanPtr; /* The actual channel. */
@ -1170,11 +1185,12 @@ Tcl_GetChannelInstanceData(chan)
*/ */
static void static void
RecycleBuffer(chanPtr, bufPtr, mustDiscard) RecycleBuffer(
Channel *chanPtr; /* Channel for which to recycle buffers. */ Channel *chanPtr, /* Channel for which to recycle buffers. */
ChannelBuffer *bufPtr; /* The buffer to recycle. */ ChannelBuffer *bufPtr, /* The buffer to recycle. */
int mustDiscard; /* If nonzero, free the buffer to the int mustDiscard /* If nonzero, free the buffer to the
* OS, always. */ * OS, always. */
)
{ {
/* /*
* Do we have to free the buffer to the OS? * Do we have to free the buffer to the OS?
@ -1242,8 +1258,9 @@ keepit:
*/ */
static void static void
DiscardOutputQueued(chanPtr) DiscardOutputQueued(
Channel *chanPtr; /* The channel for which to discard output. */ Channel *chanPtr /* The channel for which to discard output. */
)
{ {
ChannelBuffer *bufPtr; ChannelBuffer *bufPtr;
@ -1278,12 +1295,13 @@ DiscardOutputQueued(chanPtr)
*/ */
static int static int
FlushChannel(interp, chanPtr, calledFromAsyncFlush) FlushChannel(
Tcl_Interp *interp; /* For error reporting during close. */ Tcl_Interp *interp, /* For error reporting during close. */
Channel *chanPtr; /* The channel to flush on. */ Channel *chanPtr, /* The channel to flush on. */
int calledFromAsyncFlush; /* If nonzero then we are being int calledFromAsyncFlush /* If nonzero then we are being
* called from an asynchronous * called from an asynchronous
* flush callback. */ * flush callback. */
)
{ {
ChannelBuffer *bufPtr; /* Iterates over buffered output ChannelBuffer *bufPtr; /* Iterates over buffered output
* queue. */ * queue. */
@ -1482,10 +1500,11 @@ FlushChannel(interp, chanPtr, calledFromAsyncFlush)
*/ */
static int static int
CloseChannel(interp, chanPtr, errorCode) CloseChannel(
Tcl_Interp *interp; /* For error reporting. */ Tcl_Interp *interp, /* For error reporting. */
Channel *chanPtr; /* The channel to close. */ Channel *chanPtr, /* The channel to close. */
int errorCode; /* Status of operation so far. */ int errorCode /* Status of operation so far. */
)
{ {
int result; /* Of calling driver close int result; /* Of calling driver close
* operation. */ * operation. */
@ -1615,11 +1634,12 @@ CloseChannel(interp, chanPtr, errorCode)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_Close(interp, chan) Tcl_Close(
Tcl_Interp *interp; /* Interpreter for errors. */ Tcl_Interp *interp, /* Interpreter for errors. */
Tcl_Channel chan; /* The channel being closed. Must Tcl_Channel chan /* The channel being closed. Must
* not be referenced in any * not be referenced in any
* interpreter. */ * interpreter. */
)
{ {
ChannelHandler *chPtr, *chNext; /* Iterate over channel handlers. */ ChannelHandler *chPtr, *chNext; /* Iterate over channel handlers. */
CloseCallback *cbPtr; /* Iterate over close callbacks CloseCallback *cbPtr; /* Iterate over close callbacks
@ -1742,9 +1762,10 @@ Tcl_Close(interp, chan)
*/ */
static int static int
ChannelEventDeleteProc(evPtr, clientData) ChannelEventDeleteProc(
Tcl_Event *evPtr; /* The event to check for a match. */ Tcl_Event *evPtr, /* The event to check for a match. */
ClientData clientData; /* The channel to check for. */ ClientData clientData /* The channel to check for. */
)
{ {
ChannelHandlerEvent *cEvPtr; ChannelHandlerEvent *cEvPtr;
Channel *chanPtr; Channel *chanPtr;
@ -1782,12 +1803,13 @@ ChannelEventDeleteProc(evPtr, clientData)
*/ */
int int
Tcl_Write(chan, srcPtr, slen) Tcl_Write(
Tcl_Channel chan; /* The channel to buffer output for. */ Tcl_Channel chan, /* The channel to buffer output for. */
char *srcPtr; /* Output to buffer. */ char *srcPtr, /* Output to buffer. */
int slen; /* Its length. Negative means int slen /* Its length. Negative means
* the output is null terminated * the output is null terminated
* and we must compute its length. */ * and we must compute its length. */
)
{ {
Channel *chanPtr; /* The actual channel. */ Channel *chanPtr; /* The actual channel. */
ChannelBuffer *outBufPtr; /* Current output buffer. */ ChannelBuffer *outBufPtr; /* Current output buffer. */
@ -1971,8 +1993,9 @@ Tcl_Write(chan, srcPtr, slen)
*/ */
int int
Tcl_Flush(chan) Tcl_Flush(
Tcl_Channel chan; /* The Channel to flush. */ Tcl_Channel chan /* The Channel to flush. */
)
{ {
int result; /* Of calling FlushChannel. */ int result; /* Of calling FlushChannel. */
Channel *chanPtr; /* The actual channel. */ Channel *chanPtr; /* The actual channel. */
@ -2034,11 +2057,12 @@ Tcl_Flush(chan)
*/ */
static void static void
DiscardInputQueued(chanPtr, discardSavedBuffers) DiscardInputQueued(
Channel *chanPtr; /* Channel on which to discard Channel *chanPtr, /* Channel on which to discard
* the queued input. */ * the queued input. */
int discardSavedBuffers; /* If non-zero, discard all buffers including int discardSavedBuffers /* If non-zero, discard all buffers including
* last one. */ * last one. */
)
{ {
ChannelBuffer *bufPtr, *nxtPtr; /* Loop variables. */ ChannelBuffer *bufPtr, *nxtPtr; /* Loop variables. */
@ -2080,8 +2104,9 @@ DiscardInputQueued(chanPtr, discardSavedBuffers)
*/ */
static int static int
GetInput(chanPtr) GetInput(
Channel *chanPtr; /* Channel to read input from. */ Channel *chanPtr /* Channel to read input from. */
)
{ {
int toRead; /* How much to read? */ int toRead; /* How much to read? */
int result; /* Of calling driver. */ int result; /* Of calling driver. */
@ -2194,11 +2219,12 @@ GetInput(chanPtr)
*/ */
static int static int
CopyAndTranslateBuffer(chanPtr, result, space) CopyAndTranslateBuffer(
Channel *chanPtr; /* The channel from which to read input. */ Channel *chanPtr, /* The channel from which to read input. */
char *result; /* Where to store the copied input. */ char *result, /* Where to store the copied input. */
int space; /* How many bytes are available in result int space /* How many bytes are available in result
* to store the copied input? */ * to store the copied input? */
)
{ {
int bytesInBuffer; /* How many bytes are available to be int bytesInBuffer; /* How many bytes are available to be
* copied in the current input buffer? */ * copied in the current input buffer? */
@ -2445,14 +2471,14 @@ CopyAndTranslateBuffer(chanPtr, result, space)
*/ */
static int static int
ScanBufferForEOL(chanPtr, bufPtr, translation, eofChar, bytesToEOLPtr, ScanBufferForEOL(
crSeenPtr) Channel *chanPtr,
Channel *chanPtr; ChannelBuffer *bufPtr, /* Buffer to scan for EOL. */
ChannelBuffer *bufPtr; /* Buffer to scan for EOL. */ Tcl_EolTranslation translation, /* Translation mode to use. */
Tcl_EolTranslation translation; /* Translation mode to use. */ int eofChar, /* EOF char to look for. */
int eofChar; /* EOF char to look for. */ int *bytesToEOLPtr, /* Running counter. */
int *bytesToEOLPtr; /* Running counter. */ int *crSeenPtr /* Has "\r" been seen? */
int *crSeenPtr; /* Has "\r" been seen? */ )
{ {
char *rPtr; /* Iterates over input string. */ char *rPtr; /* Iterates over input string. */
char *sPtr; /* Where to stop search? */ char *sPtr; /* Where to stop search? */
@ -2585,12 +2611,13 @@ ScanBufferForEOL(chanPtr, bufPtr, translation, eofChar, bytesToEOLPtr,
*/ */
static int static int
ScanInputForEOL(chanPtr, bytesQueuedPtr) ScanInputForEOL(
Channel *chanPtr; /* Channel for which to scan queued Channel *chanPtr, /* Channel for which to scan queued
* input for end of line. */ * input for end of line. */
int *bytesQueuedPtr; /* Where to store the number of bytes int *bytesQueuedPtr /* Where to store the number of bytes
* currently queued if no end of line * currently queued if no end of line
* was found. */ * was found. */
)
{ {
ChannelBuffer *bufPtr; /* Iterates over queued buffers. */ ChannelBuffer *bufPtr; /* Iterates over queued buffers. */
int bytesToEOL; /* How many bytes to end of line? */ int bytesToEOL; /* How many bytes to end of line? */
@ -2633,8 +2660,9 @@ ScanInputForEOL(chanPtr, bytesQueuedPtr)
*/ */
static int static int
GetEOL(chanPtr) GetEOL(
Channel *chanPtr; /* Channel to queue input on. */ Channel *chanPtr /* Channel to queue input on. */
)
{ {
int result; /* Of getting another buffer from the int result; /* Of getting another buffer from the
* channel. */ * channel. */
@ -2691,10 +2719,11 @@ GetEOL(chanPtr)
*/ */
int int
Tcl_Read(chan, bufPtr, toRead) Tcl_Read(
Tcl_Channel chan; /* The channel from which to read. */ Tcl_Channel chan, /* The channel from which to read. */
char *bufPtr; /* Where to store input read. */ char *bufPtr, /* Where to store input read. */
int toRead; /* Maximum number of characters to read. */ int toRead /* Maximum number of characters to read. */
)
{ {
Channel *chanPtr; /* The real IO channel. */ Channel *chanPtr; /* The real IO channel. */
int copied; /* How many characters were copied into int copied; /* How many characters were copied into
@ -2781,14 +2810,15 @@ Tcl_Read(chan, bufPtr, toRead)
*/ */
int int
Tcl_Gets(chan, lineRead) Tcl_Gets(
Tcl_Channel chan; /* Channel from which to read. */ Tcl_Channel chan, /* Channel from which to read. */
Tcl_DString *lineRead; /* The characters of the line read Tcl_DString *lineRead /* The characters of the line read
* (excluding the terminating newline if * (excluding the terminating newline if
* present) will be appended to this * present) will be appended to this
* DString. The caller must have initialized * DString. The caller must have initialized
* it and is responsible for managing the * it and is responsible for managing the
* storage. */ * storage. */
)
{ {
Channel *chanPtr; /* The channel to read from. */ Channel *chanPtr; /* The channel to read from. */
char *buf; /* Points into DString where data char *buf; /* Points into DString where data
@ -2879,10 +2909,11 @@ Tcl_Gets(chan, lineRead)
*/ */
int int
Tcl_Seek(chan, offset, mode) Tcl_Seek(
Tcl_Channel chan; /* The channel on which to seek. */ Tcl_Channel chan, /* The channel on which to seek. */
int offset; /* Offset to seek to. */ int offset, /* Offset to seek to. */
int mode; /* Relative to which location to seek? */ int mode /* Relative to which location to seek? */
)
{ {
Channel *chanPtr; /* The real IO channel. */ Channel *chanPtr; /* The real IO channel. */
ChannelBuffer *bufPtr; /* Iterates over queued input ChannelBuffer *bufPtr; /* Iterates over queued input
@ -3070,8 +3101,9 @@ Tcl_Seek(chan, offset, mode)
*/ */
int int
Tcl_Tell(chan) Tcl_Tell(
Tcl_Channel chan; /* The channel to return pos for. */ Tcl_Channel chan /* The channel to return pos for. */
)
{ {
Channel *chanPtr; /* The actual channel to tell on. */ Channel *chanPtr; /* The actual channel to tell on. */
ChannelBuffer *bufPtr; /* Iterates over queued input ChannelBuffer *bufPtr; /* Iterates over queued input
@ -3170,8 +3202,9 @@ Tcl_Tell(chan)
*/ */
int int
Tcl_Eof(chan) Tcl_Eof(
Tcl_Channel chan; /* Does this channel have EOF? */ Tcl_Channel chan /* Does this channel have EOF? */
)
{ {
Channel *chanPtr; /* The real channel structure. */ Channel *chanPtr; /* The real channel structure. */
@ -3198,8 +3231,9 @@ Tcl_Eof(chan)
*/ */
int int
Tcl_InputBlocked(chan) Tcl_InputBlocked(
Tcl_Channel chan; /* Is this channel blocked? */ Tcl_Channel chan /* Is this channel blocked? */
)
{ {
Channel *chanPtr; /* The real channel structure. */ Channel *chanPtr; /* The real channel structure. */
@ -3226,8 +3260,9 @@ Tcl_InputBlocked(chan)
*/ */
int int
Tcl_InputBuffered(chan) Tcl_InputBuffered(
Tcl_Channel chan; /* The channel to query. */ Tcl_Channel chan /* The channel to query. */
)
{ {
Channel *chanPtr; Channel *chanPtr;
int bytesBuffered; int bytesBuffered;
@ -3260,10 +3295,11 @@ Tcl_InputBuffered(chan)
*/ */
void void
Tcl_SetChannelBufferSize(chan, sz) Tcl_SetChannelBufferSize(
Tcl_Channel chan; /* The channel whose buffer size Tcl_Channel chan, /* The channel whose buffer size
* to set. */ * to set. */
int sz; /* The size to set. */ int sz /* The size to set. */
)
{ {
Channel *chanPtr; Channel *chanPtr;
@ -3300,9 +3336,10 @@ Tcl_SetChannelBufferSize(chan, sz)
*/ */
int int
Tcl_GetChannelBufferSize(chan) Tcl_GetChannelBufferSize(
Tcl_Channel chan; /* The channel for which to find the Tcl_Channel chan /* The channel for which to find the
* buffer size. */ * buffer size. */
)
{ {
Channel *chanPtr; Channel *chanPtr;
@ -3332,10 +3369,11 @@ Tcl_GetChannelBufferSize(chan)
*/ */
int int
Tcl_GetChannelOption(chan, optionName, dsPtr) Tcl_GetChannelOption(
Tcl_Channel chan; /* Channel on which to get option. */ Tcl_Channel chan, /* Channel on which to get option. */
char *optionName; /* Option to get. */ char *optionName, /* Option to get. */
Tcl_DString *dsPtr; /* Where to store value(s). */ Tcl_DString *dsPtr /* Where to store value(s). */
)
{ {
Channel *chanPtr; /* The real IO channel. */ Channel *chanPtr; /* The real IO channel. */
size_t len; /* Length of optionName string. */ size_t len; /* Length of optionName string. */
@ -3498,11 +3536,12 @@ Tcl_GetChannelOption(chan, optionName, dsPtr)
*/ */
int int
Tcl_SetChannelOption(interp, chan, optionName, newValue) Tcl_SetChannelOption(
Tcl_Interp *interp; /* For error reporting - can be NULL. */ Tcl_Interp *interp, /* For error reporting - can be NULL. */
Tcl_Channel chan; /* Channel on which to set mode. */ Tcl_Channel chan, /* Channel on which to set mode. */
char *optionName; /* Which option to set? */ char *optionName, /* Which option to set? */
char *newValue; /* New value for option. */ char *newValue /* New value for option. */
)
{ {
int result; /* Result of channel type operation. */ int result; /* Result of channel type operation. */
int newMode; /* New (numeric) mode to sert. */ int newMode; /* New (numeric) mode to sert. */
@ -3809,8 +3848,9 @@ Tcl_SetChannelOption(interp, chan, optionName, newValue)
/* ARGSUSED */ /* ARGSUSED */
static void static void
ChannelEventSourceExitProc(clientData) ChannelEventSourceExitProc(
ClientData clientData; /* Not used. */ ClientData clientData /* Not used. */
)
{ {
Tcl_DeleteEventSource(ChannelHandlerSetupProc, ChannelHandlerCheckProc, Tcl_DeleteEventSource(ChannelHandlerSetupProc, ChannelHandlerCheckProc,
(ClientData) NULL); (ClientData) NULL);
@ -3837,12 +3877,13 @@ ChannelEventSourceExitProc(clientData)
*/ */
static void static void
ChannelHandlerSetupProc(clientData, flags) ChannelHandlerSetupProc(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
int flags; /* Flags passed to Tk_DoOneEvent: int flags /* Flags passed to Tk_DoOneEvent:
* if it doesn't include * if it doesn't include
* TCL_FILE_EVENTS then we do * TCL_FILE_EVENTS then we do
* nothing. */ * nothing. */
)
{ {
Tcl_Time dontBlock; Tcl_Time dontBlock;
Channel *chanPtr, *nextChanPtr; Channel *chanPtr, *nextChanPtr;
@ -3904,12 +3945,13 @@ ChannelHandlerSetupProc(clientData, flags)
*/ */
static void static void
ChannelHandlerCheckProc(clientData, flags) ChannelHandlerCheckProc(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
int flags; /* Flags passed to Tk_DoOneEvent: int flags /* Flags passed to Tk_DoOneEvent:
* if it doesn't include * if it doesn't include
* TCL_FILE_EVENTS then we do * TCL_FILE_EVENTS then we do
* nothing. */ * nothing. */
)
{ {
Channel *chanPtr, *nextChanPtr; Channel *chanPtr, *nextChanPtr;
ChannelHandlerEvent *ePtr; ChannelHandlerEvent *ePtr;
@ -4026,9 +4068,10 @@ ChannelHandlerCheckProc(clientData, flags)
*/ */
static void static void
FlushEventProc(clientData, mask) FlushEventProc(
ClientData clientData; /* Channel to produce output on. */ ClientData clientData, /* Channel to produce output on. */
int mask; /* Not used. */ int mask /* Not used. */
)
{ {
(void) FlushChannel(NULL, (Channel *) clientData, 1); (void) FlushChannel(NULL, (Channel *) clientData, 1);
} }
@ -4061,10 +4104,11 @@ FlushEventProc(clientData, mask)
*/ */
static int static int
ChannelHandlerEventProc(evPtr, flags) ChannelHandlerEventProc(
Tcl_Event *evPtr; /* Event to service. */ Tcl_Event *evPtr, /* Event to service. */
int flags; /* Flags that indicate what events to int flags /* Flags that indicate what events to
* handle, such as TCL_FILE_EVENTS. */ * handle, such as TCL_FILE_EVENTS. */
)
{ {
Channel *chanPtr; Channel *chanPtr;
ChannelHandler *chPtr; ChannelHandler *chPtr;
@ -4131,16 +4175,17 @@ ChannelHandlerEventProc(evPtr, flags)
*/ */
void void
Tcl_CreateChannelHandler(chan, mask, proc, clientData) Tcl_CreateChannelHandler(
Tcl_Channel chan; /* The channel to create the handler for. */ Tcl_Channel chan, /* The channel to create the handler for. */
int mask; /* OR'ed combination of TCL_READABLE, int mask, /* OR'ed combination of TCL_READABLE,
* TCL_WRITABLE, and TCL_EXCEPTION: * TCL_WRITABLE, and TCL_EXCEPTION:
* indicates conditions under which * indicates conditions under which
* proc should be called. Use 0 to * proc should be called. Use 0 to
* disable a registered handler. */ * disable a registered handler. */
Tcl_ChannelProc *proc; /* Procedure to call for each Tcl_ChannelProc *proc, /* Procedure to call for each
* selected event. */ * selected event. */
ClientData clientData; /* Arbitrary data to pass to proc. */ ClientData clientData /* Arbitrary data to pass to proc. */
)
{ {
ChannelHandler *chPtr; ChannelHandler *chPtr;
Channel *chanPtr; Channel *chanPtr;
@ -4224,13 +4269,13 @@ Tcl_CreateChannelHandler(chan, mask, proc, clientData)
*/ */
void void
Tcl_DeleteChannelHandler(chan, proc, clientData) Tcl_DeleteChannelHandler(
Tcl_Channel chan; /* The channel for which to remove the Tcl_Channel chan, /* The channel for which to remove the
* callback. */ * callback. */
Tcl_ChannelProc *proc; /* The procedure in the callback to delete. */ Tcl_ChannelProc *proc, /* The procedure in the callback to delete. */
ClientData clientData; /* The client data in the callback ClientData clientData /* The client data in the callback
* to delete. */ * to delete. */
)
{ {
ChannelHandler *chPtr, *prevChPtr; ChannelHandler *chPtr, *prevChPtr;
Channel *chanPtr; Channel *chanPtr;
@ -4310,13 +4355,14 @@ Tcl_DeleteChannelHandler(chan, proc, clientData)
*/ */
static void static void
ReturnScriptRecord(interp, chanPtr, mask) ReturnScriptRecord(
Tcl_Interp *interp; /* The interpreter in which the script Tcl_Interp *interp, /* The interpreter in which the script
* is to be executed. */ * is to be executed. */
Channel *chanPtr; /* The channel for which the script is Channel *chanPtr, /* The channel for which the script is
* stored. */ * stored. */
int mask; /* Events in mask must overlap with events int mask /* Events in mask must overlap with events
* for which this script is stored. */ * for which this script is stored. */
)
{ {
EventScriptRecord *esPtr; EventScriptRecord *esPtr;
@ -4348,13 +4394,14 @@ ReturnScriptRecord(interp, chanPtr, mask)
*/ */
static void static void
DeleteScriptRecord(interp, chanPtr, mask) DeleteScriptRecord(
Tcl_Interp *interp; /* Interpreter in which script was to be Tcl_Interp *interp, /* Interpreter in which script was to be
* executed. */ * executed. */
Channel *chanPtr; /* The channel for which to delete the Channel *chanPtr, /* The channel for which to delete the
* script record (if any). */ * script record (if any). */
int mask; /* Events in mask must exactly match mask int mask /* Events in mask must exactly match mask
* of script to delete. */ * of script to delete. */
)
{ {
EventScriptRecord *esPtr, *prevEsPtr; EventScriptRecord *esPtr, *prevEsPtr;
@ -4398,15 +4445,16 @@ DeleteScriptRecord(interp, chanPtr, mask)
*/ */
static void static void
CreateScriptRecord(interp, chanPtr, mask, script) CreateScriptRecord(
Tcl_Interp *interp; /* Interpreter in which to execute Tcl_Interp *interp, /* Interpreter in which to execute
* the stored script. */ * the stored script. */
Channel *chanPtr; /* Channel for which script is to Channel *chanPtr, /* Channel for which script is to
* be stored. */ * be stored. */
int mask; /* Set of events for which script int mask, /* Set of events for which script
* will be invoked. */ * will be invoked. */
char *script; /* A copy of this script is stored char *script /* A copy of this script is stored
* in the newly created record. */ * in the newly created record. */
)
{ {
EventScriptRecord *esPtr; EventScriptRecord *esPtr;
@ -4453,9 +4501,10 @@ CreateScriptRecord(interp, chanPtr, mask, script)
*/ */
static void static void
ChannelEventScriptInvoker(clientData, mask) ChannelEventScriptInvoker(
ClientData clientData; /* The script+interp record. */ ClientData clientData, /* The script+interp record. */
int mask; /* Not used. */ int mask /* Not used. */
)
{ {
Tcl_Interp *interp; /* Interpreter in which to eval the script. */ Tcl_Interp *interp; /* Interpreter in which to eval the script. */
Channel *chanPtr; /* The channel for which this handler is Channel *chanPtr; /* The channel for which this handler is
@ -4519,13 +4568,14 @@ ChannelEventScriptInvoker(clientData, mask)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_FileEventCmd(clientData, interp, argc, argv) Tcl_FileEventCmd(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
Tcl_Interp *interp; /* Interpreter in which the channel Tcl_Interp *interp, /* Interpreter in which the channel
* for which to create the handler * for which to create the handler
* is found. */ * is found. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Channel *chanPtr; /* The channel to create Channel *chanPtr; /* The channel to create
* the handler for. */ * the handler for. */
@ -4617,11 +4667,12 @@ Tcl_FileEventCmd(clientData, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
TclTestChannelCmd(clientData, interp, argc, argv) TclTestChannelCmd(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
Tcl_Interp *interp; /* Interpreter for result. */ Tcl_Interp *interp, /* Interpreter for result. */
int argc; /* Count of additional args. */ int argc, /* Count of additional args. */
char **argv; /* Additional arg strings. */ char **argv /* Additional arg strings. */
)
{ {
char *cmdName; /* Sub command. */ char *cmdName; /* Sub command. */
Tcl_HashTable *hTblPtr; /* Hash table of channels. */ Tcl_HashTable *hTblPtr; /* Hash table of channels. */
@ -4935,11 +4986,12 @@ TclTestChannelCmd(clientData, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
TclTestChannelEventCmd(dummy, interp, argc, argv) TclTestChannelEventCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Channel *chanPtr; Channel *chanPtr;
EventScriptRecord *esPtr, *prevEsPtr, *nextEsPtr; EventScriptRecord *esPtr, *prevEsPtr, *nextEsPtr;

View file

@ -85,11 +85,12 @@ static void UnregisterTcpServerInterpCleanupProc _ANSI_ARGS_((
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_PutsCmd(clientData, interp, argc, argv) Tcl_PutsCmd(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Tcl_Channel chan; /* The channel to puts on. */ Tcl_Channel chan; /* The channel to puts on. */
int i; /* Counter. */ int i; /* Counter. */
@ -175,11 +176,12 @@ error:
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_FlushCmd(clientData, interp, argc, argv) Tcl_FlushCmd(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Tcl_Channel chan; /* The channel to flush on. */ Tcl_Channel chan; /* The channel to flush on. */
int result; /* Result of call to channel int result; /* Result of call to channel
@ -228,11 +230,12 @@ Tcl_FlushCmd(clientData, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_GetsCmd(clientData, interp, argc, argv) Tcl_GetsCmd(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Tcl_Channel chan; /* The channel to read from. */ Tcl_Channel chan; /* The channel to read from. */
char *varName; /* Assign to this variable? */ char *varName; /* Assign to this variable? */
@ -312,11 +315,12 @@ Tcl_GetsCmd(clientData, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_ReadCmd(clientData, interp, argc, argv) Tcl_ReadCmd(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Tcl_Channel chan; /* The channel to read from. */ Tcl_Channel chan; /* The channel to read from. */
int newline, i; /* Discard newline at end? */ int newline, i; /* Discard newline at end? */
@ -450,12 +454,13 @@ argerror:
*/ */
int int
TclUnsupported0Cmd(clientData, interp, argc, argv) TclUnsupported0Cmd(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
Tcl_Interp *interp; /* Interpreter in which both channels Tcl_Interp *interp, /* Interpreter in which both channels
* are defined. */ * are defined. */
int argc; /* How many arguments? */ int argc, /* How many arguments? */
char **argv; /* The argument strings. */ char **argv /* The argument strings. */
)
{ {
Tcl_Channel inChan, outChan; Tcl_Channel inChan, outChan;
int requested; int requested;
@ -555,11 +560,12 @@ TclUnsupported0Cmd(clientData, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_SeekCmd(clientData, interp, argc, argv) Tcl_SeekCmd(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Tcl_Channel chan; /* The channel to tell on. */ Tcl_Channel chan; /* The channel to tell on. */
int offset, mode; /* Where to seek? */ int offset, mode; /* Where to seek? */
@ -626,11 +632,12 @@ Tcl_SeekCmd(clientData, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_TellCmd(clientData, interp, argc, argv) Tcl_TellCmd(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Tcl_Channel chan; /* The channel to tell on. */ Tcl_Channel chan; /* The channel to tell on. */
@ -672,11 +679,12 @@ Tcl_TellCmd(clientData, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_CloseCmd(clientData, interp, argc, argv) Tcl_CloseCmd(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Tcl_Channel chan; /* The channel to close. */ Tcl_Channel chan; /* The channel to close. */
int len; /* Length of error output. */ int len; /* Length of error output. */
@ -732,11 +740,12 @@ Tcl_CloseCmd(clientData, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_FconfigureCmd(clientData, interp, argc, argv) Tcl_FconfigureCmd(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Tcl_Channel chan; /* The channel to set a mode on. */ Tcl_Channel chan; /* The channel to set a mode on. */
int result; /* Of Tcl_Set/GetChannelOption. */ int result; /* Of Tcl_Set/GetChannelOption. */
@ -808,11 +817,12 @@ Tcl_FconfigureCmd(clientData, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_EofCmd(unused, interp, argc, argv) Tcl_EofCmd(
ClientData unused; /* Not used. */ ClientData unused, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Tcl_Channel chan; /* The channel to query for EOF. */ Tcl_Channel chan; /* The channel to query for EOF. */
int mode; /* Mode in which channel is opened. */ int mode; /* Mode in which channel is opened. */
@ -849,11 +859,12 @@ Tcl_EofCmd(unused, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_ExecCmd(dummy, interp, argc, argv) Tcl_ExecCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
#ifdef MAC_TCL #ifdef MAC_TCL
Tcl_AppendResult(interp, "exec not implemented under Mac OS", Tcl_AppendResult(interp, "exec not implemented under Mac OS",
@ -992,11 +1003,12 @@ Tcl_ExecCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_FblockedCmd(unused, interp, argc, argv) Tcl_FblockedCmd(
ClientData unused; /* Not used. */ ClientData unused, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Tcl_Channel chan; /* The channel to query for blocked. */ Tcl_Channel chan; /* The channel to query for blocked. */
int mode; /* Mode in which channel was opened. */ int mode; /* Mode in which channel was opened. */
@ -1039,11 +1051,12 @@ Tcl_FblockedCmd(unused, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_OpenCmd(notUsed, interp, argc, argv) Tcl_OpenCmd(
ClientData notUsed; /* Not used. */ ClientData notUsed, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int pipeline, prot; int pipeline, prot;
char *modeString; char *modeString;
@ -1139,10 +1152,11 @@ Tcl_OpenCmd(notUsed, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
static void static void
TcpAcceptCallbacksDeleteProc(clientData, interp) TcpAcceptCallbacksDeleteProc(
ClientData clientData; /* Data which was passed when the assocdata ClientData clientData, /* Data which was passed when the assocdata
* was registered. */ * was registered. */
Tcl_Interp *interp; /* Interpreter being deleted - not used. */ Tcl_Interp *interp /* Interpreter being deleted - not used. */
)
{ {
Tcl_HashTable *hTblPtr; Tcl_HashTable *hTblPtr;
Tcl_HashEntry *hPtr; Tcl_HashEntry *hPtr;
@ -1181,13 +1195,14 @@ TcpAcceptCallbacksDeleteProc(clientData, interp)
*/ */
static void static void
RegisterTcpServerInterpCleanup(interp, acceptCallbackPtr) RegisterTcpServerInterpCleanup(
Tcl_Interp *interp; /* Interpreter for which we want to be Tcl_Interp *interp, /* Interpreter for which we want to be
* informed of deletion. */ * informed of deletion. */
AcceptCallback *acceptCallbackPtr; AcceptCallback *acceptCallbackPtr
/* The accept callback record whose /* The accept callback record whose
* interp field we want set to NULL when * interp field we want set to NULL when
* the interpreter is deleted. */ * the interpreter is deleted. */
)
{ {
Tcl_HashTable *hTblPtr; /* Hash table for accept callback Tcl_HashTable *hTblPtr; /* Hash table for accept callback
* records to smash when the interpreter * records to smash when the interpreter
@ -1231,12 +1246,13 @@ RegisterTcpServerInterpCleanup(interp, acceptCallbackPtr)
*/ */
static void static void
UnregisterTcpServerInterpCleanupProc(interp, acceptCallbackPtr) UnregisterTcpServerInterpCleanupProc(
Tcl_Interp *interp; /* Interpreter in which the accept callback Tcl_Interp *interp, /* Interpreter in which the accept callback
* record was registered. */ * record was registered. */
AcceptCallback *acceptCallbackPtr; AcceptCallback *acceptCallbackPtr
/* The record for which to delete the /* The record for which to delete the
* registration. */ * registration. */
)
{ {
Tcl_HashTable *hTblPtr; Tcl_HashTable *hTblPtr;
Tcl_HashEntry *hPtr; Tcl_HashEntry *hPtr;
@ -1271,15 +1287,16 @@ UnregisterTcpServerInterpCleanupProc(interp, acceptCallbackPtr)
*/ */
static void static void
AcceptCallbackProc(callbackData, chan, address, port) AcceptCallbackProc(
ClientData callbackData; /* The data stored when the callback ClientData callbackData, /* The data stored when the callback
* was created in the call to * was created in the call to
* Tcl_OpenTcpServer. */ * Tcl_OpenTcpServer. */
Tcl_Channel chan; /* Channel for the newly accepted Tcl_Channel chan, /* Channel for the newly accepted
* connection. */ * connection. */
char *address; /* Address of client that was char *address, /* Address of client that was
* accepted. */ * accepted. */
int port; /* Port of client that was accepted. */ int port /* Port of client that was accepted. */
)
{ {
AcceptCallback *acceptCallbackPtr; AcceptCallback *acceptCallbackPtr;
Tcl_Interp *interp; Tcl_Interp *interp;
@ -1346,9 +1363,10 @@ AcceptCallbackProc(callbackData, chan, address, port)
*/ */
static void static void
TcpServerCloseProc(callbackData) TcpServerCloseProc(
ClientData callbackData; /* The data passed in the call to ClientData callbackData /* The data passed in the call to
* Tcl_CreateCloseHandler. */ * Tcl_CreateCloseHandler. */
)
{ {
AcceptCallback *acceptCallbackPtr; AcceptCallback *acceptCallbackPtr;
/* The actual data. */ /* The actual data. */
@ -1380,11 +1398,12 @@ TcpServerCloseProc(callbackData)
*/ */
int int
Tcl_SocketCmd(notUsed, interp, argc, argv) Tcl_SocketCmd(
ClientData notUsed; /* Not used. */ ClientData notUsed, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int a, server, port; int a, server, port;
char *arg, *copyScript, *host, *script; char *arg, *copyScript, *host, *script;

View file

@ -58,11 +58,12 @@
*/ */
int int
TclSockGetPort(interp, string, proto, portPtr) TclSockGetPort(
Tcl_Interp *interp; Tcl_Interp *interp,
char *string; /* Integer or service name */ char *string, /* Integer or service name */
char *proto; /* "tcp" or "udp", typically */ char *proto, /* "tcp" or "udp", typically */
int *portPtr; /* Return port number */ int *portPtr /* Return port number */
)
{ {
struct servent *sp = getservbyname(string, proto); struct servent *sp = getservbyname(string, proto);
if (sp != NULL) { if (sp != NULL) {
@ -97,9 +98,10 @@ TclSockGetPort(interp, string, proto, portPtr)
*/ */
int int
TclSockMinimumBuffers(sock, size) TclSockMinimumBuffers(
int sock; /* Socket file descriptor */ int sock, /* Socket file descriptor */
int size; /* Minimum buffer size */ int size /* Minimum buffer size */
)
{ {
int current; int current;
int len = sizeof(int); int len = sizeof(int);

View file

@ -89,27 +89,28 @@ static Tcl_File FileForRedirect _ANSI_ARGS_((Tcl_Interp *interp,
*/ */
static Tcl_File static Tcl_File
FileForRedirect(interp, spec, atOk, arg, flags, nextArg, skipPtr, closePtr) FileForRedirect(
Tcl_Interp *interp; /* Intepreter to use for error Tcl_Interp *interp, /* Intepreter to use for error
* reporting. */ * reporting. */
register char *spec; /* Points to character just after register char *spec, /* Points to character just after
* redirection character. */ * redirection character. */
int atOk; /* Non-zero means '@' notation is int atOk, /* Non-zero means '@' notation is
* OK, zero means it isn't. */ * OK, zero means it isn't. */
char *arg; /* Pointer to entire argument char *arg, /* Pointer to entire argument
* containing spec: used for error * containing spec: used for error
* reporting. */ * reporting. */
int flags; /* Flags to use for opening file. */ int flags, /* Flags to use for opening file. */
char *nextArg; /* Next argument in argc/argv char *nextArg, /* Next argument in argc/argv
* array, if needed for file name. * array, if needed for file name.
* May be NULL. */ * May be NULL. */
int *skipPtr; /* This value is incremented if int *skipPtr, /* This value is incremented if
* nextArg is used for redirection * nextArg is used for redirection
* spec. */ * spec. */
int *closePtr; /* This value is set to 1 if the file int *closePtr /* This value is set to 1 if the file
* that's returned must be closed, 0 * that's returned must be closed, 0
* if it was specified with "@" so * if it was specified with "@" so
* it must be left open. */ * it must be left open. */
)
{ {
int writing = (flags & O_WRONLY); int writing = (flags & O_WRONLY);
Tcl_Channel chan; Tcl_Channel chan;
@ -209,14 +210,15 @@ FileForRedirect(interp, spec, atOk, arg, flags, nextArg, skipPtr, closePtr)
*/ */
int int
TclGetOpenMode(interp, string, seekFlagPtr) TclGetOpenMode(
Tcl_Interp *interp; /* Interpreter to use for error Tcl_Interp *interp, /* Interpreter to use for error
* reporting - may be NULL. */ * reporting - may be NULL. */
char *string; /* Mode string, e.g. "r+" or char *string, /* Mode string, e.g. "r+" or
* "RDONLY CREAT". */ * "RDONLY CREAT". */
int *seekFlagPtr; /* Set this to 1 if the caller int *seekFlagPtr /* Set this to 1 if the caller
* should seek to EOF during the * should seek to EOF during the
* opening of the file. */ * opening of the file. */
)
{ {
int mode, modeArgc, c, i, gotRW; int mode, modeArgc, c, i, gotRW;
char **modeArgv, *flag; char **modeArgv, *flag;
@ -369,10 +371,11 @@ TclGetOpenMode(interp, string, seekFlagPtr)
*/ */
int int
Tcl_EvalFile(interp, fileName) Tcl_EvalFile(
Tcl_Interp *interp; /* Interpreter in which to process file. */ Tcl_Interp *interp, /* Interpreter in which to process file. */
char *fileName; /* Name of file to process. Tilde-substitution char *fileName /* Name of file to process. Tilde-substitution
* will be performed on this name. */ * will be performed on this name. */
)
{ {
int result; int result;
struct stat statBuf; struct stat statBuf;
@ -478,10 +481,11 @@ error:
*/ */
void void
Tcl_DetachPids(numPids, pidPtr) Tcl_DetachPids(
int numPids; /* Number of pids to detach: gives size int numPids, /* Number of pids to detach: gives size
* of array pointed to by pidPtr. */ * of array pointed to by pidPtr. */
pid_t *pidPtr; /* Array of pids to detach. */ pid_t *pidPtr /* Array of pids to detach. */
)
{ {
register Detached *detPtr; register Detached *detPtr;
int i; int i;
@ -515,7 +519,7 @@ Tcl_DetachPids(numPids, pidPtr)
*/ */
void void
Tcl_ReapDetachedProcs() Tcl_ReapDetachedProcs(void)
{ {
register Detached *detPtr; register Detached *detPtr;
Detached *nextPtr, *prevPtr; Detached *nextPtr, *prevPtr;
@ -563,13 +567,14 @@ Tcl_ReapDetachedProcs()
*/ */
int int
TclCleanupChildren(interp, numPids, pidPtr, errorChan) TclCleanupChildren(
Tcl_Interp *interp; /* Used for error messages. */ Tcl_Interp *interp, /* Used for error messages. */
int numPids; /* Number of entries in pidPtr array. */ int numPids, /* Number of entries in pidPtr array. */
pid_t *pidPtr; /* Array of process ids of children. */ pid_t *pidPtr, /* Array of process ids of children. */
Tcl_Channel errorChan; /* Channel for file containing stderr output Tcl_Channel errorChan /* Channel for file containing stderr output
* from pipeline. NULL means there isn't any * from pipeline. NULL means there isn't any
* stderr output. */ * stderr output. */
)
{ {
int result = TCL_OK; int result = TCL_OK;
pid_t pid; pid_t pid;
@ -735,30 +740,29 @@ TclCleanupChildren(interp, numPids, pidPtr, errorChan)
*/ */
int int
TclCreatePipeline(interp, argc, argv, pidArrayPtr, inPipePtr, TclCreatePipeline(
outPipePtr, errFilePtr) Tcl_Interp *interp, /* Interpreter to use for error reporting. */
Tcl_Interp *interp; /* Interpreter to use for error reporting. */ int argc, /* Number of entries in argv. */
int argc; /* Number of entries in argv. */ char **argv, /* Array of strings describing commands in
char **argv; /* Array of strings describing commands in
* pipeline plus I/O redirection with <, * pipeline plus I/O redirection with <,
* <<, >, etc. Argv[argc] must be NULL. */ * <<, >, etc. Argv[argc] must be NULL. */
pid_t **pidArrayPtr; /* Word at *pidArrayPtr gets filled in with pid_t **pidArrayPtr, /* Word at *pidArrayPtr gets filled in with
* address of array of pids for processes * address of array of pids for processes
* in pipeline (first pid is first process * in pipeline (first pid is first process
* in pipeline). */ * in pipeline). */
Tcl_File *inPipePtr; /* If non-NULL, input to the pipeline comes Tcl_File *inPipePtr, /* If non-NULL, input to the pipeline comes
* from a pipe (unless overridden by * from a pipe (unless overridden by
* redirection in the command). The file * redirection in the command). The file
* id with which to write to this pipe is * id with which to write to this pipe is
* stored at *inPipePtr. NULL means command * stored at *inPipePtr. NULL means command
* specified its own input source. */ * specified its own input source. */
Tcl_File *outPipePtr; /* If non-NULL, output to the pipeline goes Tcl_File *outPipePtr, /* If non-NULL, output to the pipeline goes
* to a pipe, unless overriden by redirection * to a pipe, unless overriden by redirection
* in the command. The file id with which to * in the command. The file id with which to
* read frome this pipe is stored at * read frome this pipe is stored at
* *outPipePtr. NULL means command specified * *outPipePtr. NULL means command specified
* its own output sink. */ * its own output sink. */
Tcl_File *errFilePtr; /* If non-NULL, all stderr output from the Tcl_File *errFilePtr /* If non-NULL, all stderr output from the
* pipeline will go to a temporary file * pipeline will go to a temporary file
* created here, and a descriptor to read * created here, and a descriptor to read
* the file will be left at *errFilePtr. * the file will be left at *errFilePtr.
@ -769,6 +773,7 @@ TclCreatePipeline(interp, argc, argv, pidArrayPtr, inPipePtr,
* If the pipeline specifies redirection * If the pipeline specifies redirection
* then the file will still be created * then the file will still be created
* but it will never get any data. */ * but it will never get any data. */
)
{ {
#if defined( MAC_TCL ) #if defined( MAC_TCL )
Tcl_AppendResult(interp, Tcl_AppendResult(interp,
@ -1143,7 +1148,7 @@ error:
*/ */
int int
Tcl_GetErrno() Tcl_GetErrno(void)
{ {
return errno; return errno;
} }
@ -1165,8 +1170,9 @@ Tcl_GetErrno()
*/ */
void void
Tcl_SetErrno(err) Tcl_SetErrno(
int err; /* The new value. */ int err /* The new value. */
)
{ {
errno = err; errno = err;
} }
@ -1192,9 +1198,10 @@ Tcl_SetErrno(err)
*/ */
char * char *
Tcl_PosixError(interp) Tcl_PosixError(
Tcl_Interp *interp; /* Interpreter whose $errorCode variable Tcl_Interp *interp /* Interpreter whose $errorCode variable
* is to be changed. */ * is to be changed. */
)
{ {
char *id, *msg; char *id, *msg;
@ -1239,13 +1246,14 @@ Tcl_PosixError(interp)
*/ */
Tcl_Channel Tcl_Channel
Tcl_OpenCommandChannel(interp, argc, argv, flags) Tcl_OpenCommandChannel(
Tcl_Interp *interp; /* Interpreter for error reporting. Can Tcl_Interp *interp, /* Interpreter for error reporting. Can
* NOT be NULL. */ * NOT be NULL. */
int argc; /* How many arguments. */ int argc, /* How many arguments. */
char **argv; /* Array of arguments for command pipe. */ char **argv, /* Array of arguments for command pipe. */
int flags; /* Or'ed combination of TCL_STDIN, TCL_STDOUT, int flags /* Or'ed combination of TCL_STDIN, TCL_STDOUT,
* TCL_STDERR, and TCL_ENFORCE_MODE. */ * TCL_STDERR, and TCL_ENFORCE_MODE. */
)
{ {
Tcl_File *inPipePtr, *outPipePtr, *errFilePtr; Tcl_File *inPipePtr, *outPipePtr, *errFilePtr;
Tcl_File inPipe, outPipe, errFile; Tcl_File inPipe, outPipe, errFile;

View file

@ -233,16 +233,17 @@ static int TclCommandsToKeepCt =
*/ */
int int
TclPreventAliasLoop(interp, cmdInterp, cmdName, proc, clientData) TclPreventAliasLoop(
Tcl_Interp *interp; /* Interp in which to report errors. */ Tcl_Interp *interp, /* Interp in which to report errors. */
Tcl_Interp *cmdInterp; /* Interp in which the command is Tcl_Interp *cmdInterp, /* Interp in which the command is
* being defined. */ * being defined. */
char *cmdName; /* Name of Tcl command we are char *cmdName, /* Name of Tcl command we are
* attempting to define. */ * attempting to define. */
Tcl_CmdProc *proc; /* The command procedure for the Tcl_CmdProc *proc, /* The command procedure for the
* command being created. */ * command being created. */
ClientData clientData; /* The client data associated with the ClientData clientData /* The client data associated with the
* command to be created. */ * command to be created. */
)
{ {
Alias *aliasPtr, *nextAliasPtr; Alias *aliasPtr, *nextAliasPtr;
Tcl_CmdInfo cmdInfo; Tcl_CmdInfo cmdInfo;
@ -321,8 +322,9 @@ TclPreventAliasLoop(interp, cmdInterp, cmdName, proc, clientData)
*/ */
static int static int
MakeSafe(interp) MakeSafe(
Tcl_Interp *interp; /* Interpreter to be made safe. */ Tcl_Interp *interp /* Interpreter to be made safe. */
)
{ {
char **argv; /* Args for Tcl_Eval. */ char **argv; /* Args for Tcl_Eval. */
int argc, keep, i, j; /* Loop indices. */ int argc, keep, i, j; /* Loop indices. */
@ -403,11 +405,12 @@ MakeSafe(interp)
*/ */
static Tcl_Interp * static Tcl_Interp *
GetInterp(interp, masterPtr, path, masterPtrPtr) GetInterp(
Tcl_Interp *interp; /* Interp. to start search from. */ Tcl_Interp *interp, /* Interp. to start search from. */
Master *masterPtr; /* Its master record. */ Master *masterPtr, /* Its master record. */
char *path; /* The path (name) of interp. to be found. */ char *path, /* The path (name) of interp. to be found. */
Master **masterPtrPtr; /* (Return) its master record. */ Master **masterPtrPtr /* (Return) its master record. */
)
{ {
Tcl_HashEntry *hPtr; /* Search element. */ Tcl_HashEntry *hPtr; /* Search element. */
Slave *slavePtr; /* Interim slave record. */ Slave *slavePtr; /* Interim slave record. */
@ -466,10 +469,11 @@ GetInterp(interp, masterPtr, path, masterPtrPtr)
*/ */
static Tcl_Interp * static Tcl_Interp *
CreateSlave(interp, slavePath, safe) CreateSlave(
Tcl_Interp *interp; /* Interp. to start search from. */ Tcl_Interp *interp, /* Interp. to start search from. */
char *slavePath; /* Path (name) of slave to create. */ char *slavePath, /* Path (name) of slave to create. */
int safe; /* Should we make it "safe"? */ int safe /* Should we make it "safe"? */
)
{ {
Master *masterPtr; /* Master record. */ Master *masterPtr; /* Master record. */
Tcl_Interp *slaveInterp; /* Ptr to slave interpreter. */ Tcl_Interp *slaveInterp; /* Ptr to slave interpreter. */
@ -577,10 +581,11 @@ CreateSlave(interp, slavePath, safe)
*/ */
static int static int
CreateInterpObject(interp, argc, argv) CreateInterpObject(
Tcl_Interp *interp; /* Invoking interpreter. */ Tcl_Interp *interp, /* Invoking interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int safe; /* Create a safe interpreter? */ int safe; /* Create a safe interpreter? */
Master *masterPtr; /* Master record. */ Master *masterPtr; /* Master record. */
@ -656,9 +661,10 @@ CreateInterpObject(interp, argc, argv)
*/ */
static int static int
DeleteOneInterpObject(interp, path) DeleteOneInterpObject(
Tcl_Interp *interp; /* Interpreter for reporting errors. */ Tcl_Interp *interp, /* Interpreter for reporting errors. */
char *path; /* Path of interpreter to delete. */ char *path /* Path of interpreter to delete. */
)
{ {
Master *masterPtr; /* Interim storage for master record.*/ Master *masterPtr; /* Interim storage for master record.*/
Slave *slavePtr; /* Interim storage for slave record. */ Slave *slavePtr; /* Interim storage for slave record. */
@ -736,11 +742,12 @@ DeleteOneInterpObject(interp, path)
*/ */
static int static int
DeleteInterpObject(interp, argc, argv) DeleteInterpObject(
Tcl_Interp *interp; /* Interpreter start search from. */ Tcl_Interp *interp, /* Interpreter start search from. */
int argc; /* Number of arguments in vector. */ int argc, /* Number of arguments in vector. */
char **argv; /* Contains path to interps to char **argv /* Contains path to interps to
* delete. */ * delete. */
)
{ {
int i; int i;
@ -771,18 +778,18 @@ DeleteInterpObject(interp, argc, argv)
*/ */
static int static int
AliasHelper(curInterp, slaveInterp, masterInterp, masterPtr, AliasHelper(
aliasName, targetName, argc, argv) Tcl_Interp *curInterp, /* Interp that invoked this proc. */
Tcl_Interp *curInterp; /* Interp that invoked this proc. */ Tcl_Interp *slaveInterp, /* Interp where alias cmd will live
Tcl_Interp *slaveInterp; /* Interp where alias cmd will live
* or from which alias will be * or from which alias will be
* deleted. */ * deleted. */
Tcl_Interp *masterInterp; /* Interp where target cmd will be. */ Tcl_Interp *masterInterp, /* Interp where target cmd will be. */
Master *masterPtr; /* Master record for target interp. */ Master *masterPtr, /* Master record for target interp. */
char *aliasName; /* Name of alias cmd. */ char *aliasName, /* Name of alias cmd. */
char *targetName; /* Name of target cmd. */ char *targetName, /* Name of target cmd. */
int argc; /* Additional arguments to store */ int argc, /* Additional arguments to store */
char **argv; /* with alias. */ char **argv /* with alias. */
)
{ {
Alias *aliasPtr; /* Storage for alias data. */ Alias *aliasPtr; /* Storage for alias data. */
Alias *tmpAliasPtr; /* Temp storage for alias to delete. */ Alias *tmpAliasPtr; /* Temp storage for alias to delete. */
@ -916,10 +923,11 @@ AliasHelper(curInterp, slaveInterp, masterInterp, masterPtr,
*/ */
static int static int
SlaveAliasHelper(interp, argc, argv) SlaveAliasHelper(
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Master *masterPtr; /* Master record for current interp. */ Master *masterPtr; /* Master record for current interp. */
Tcl_Interp *slaveInterp, /* Interpreters used when */ Tcl_Interp *slaveInterp, /* Interpreters used when */
@ -983,10 +991,11 @@ SlaveAliasHelper(interp, argc, argv)
*/ */
static int static int
DescribeAlias(interp, slaveInterp, aliasName) DescribeAlias(
Tcl_Interp *interp; /* Interpreter for result and errors. */ Tcl_Interp *interp, /* Interpreter for result and errors. */
Tcl_Interp *slaveInterp; /* Interpreter defining alias. */ Tcl_Interp *slaveInterp, /* Interpreter defining alias. */
char *aliasName; /* Name of alias to describe. */ char *aliasName /* Name of alias to describe. */
)
{ {
Slave *slavePtr; /* Slave record for slave interpreter. */ Slave *slavePtr; /* Slave record for slave interpreter. */
Tcl_HashEntry *hPtr; /* Search variable. */ Tcl_HashEntry *hPtr; /* Search variable. */
@ -1028,10 +1037,11 @@ DescribeAlias(interp, slaveInterp, aliasName)
*/ */
static int static int
DeleteAlias(interp, slaveInterp, aliasName) DeleteAlias(
Tcl_Interp *interp; /* Interpreter for result and errors. */ Tcl_Interp *interp, /* Interpreter for result and errors. */
Tcl_Interp *slaveInterp; /* Interpreter defining alias. */ Tcl_Interp *slaveInterp, /* Interpreter defining alias. */
char *aliasName; /* Name of alias to delete. */ char *aliasName /* Name of alias to delete. */
)
{ {
Slave *slavePtr; /* Slave record for slave interpreter. */ Slave *slavePtr; /* Slave record for slave interpreter. */
Tcl_HashEntry *hPtr; /* Search variable. */ Tcl_HashEntry *hPtr; /* Search variable. */
@ -1101,9 +1111,10 @@ DeleteAlias(interp, slaveInterp, aliasName)
*/ */
int int
Tcl_GetInterpPath(askingInterp, targetInterp) Tcl_GetInterpPath(
Tcl_Interp *askingInterp; /* Interpreter to start search from. */ Tcl_Interp *askingInterp, /* Interpreter to start search from. */
Tcl_Interp *targetInterp; /* Interpreter to find. */ Tcl_Interp *targetInterp /* Interpreter to find. */
)
{ {
Master *masterPtr; /* Interim storage for Master record. */ Master *masterPtr; /* Interim storage for Master record. */
Slave *slavePtr; /* Interim storage for Slave record. */ Slave *slavePtr; /* Interim storage for Slave record. */
@ -1154,10 +1165,11 @@ Tcl_GetInterpPath(askingInterp, targetInterp)
*/ */
static int static int
GetTarget(askingInterp, path, aliasName) GetTarget(
Tcl_Interp *askingInterp; /* Interpreter to start search from. */ Tcl_Interp *askingInterp, /* Interpreter to start search from. */
char *path; /* The path of the interp to find. */ char *path, /* The path of the interp to find. */
char *aliasName; /* The target of this allias. */ char *aliasName /* The target of this allias. */
)
{ {
Tcl_Interp *slaveInterp; /* Interim storage for slave. */ Tcl_Interp *slaveInterp; /* Interim storage for slave. */
Slave *slaveSlavePtr; /* Its Slave record. */ Slave *slaveSlavePtr; /* Its Slave record. */
@ -1221,11 +1233,12 @@ GetTarget(askingInterp, path, aliasName)
*/ */
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_InterpCmd(clientData, interp, argc, argv) Tcl_InterpCmd(
ClientData clientData; /* Unused. */ ClientData clientData, /* Unused. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Tcl_Interp *slaveInterp; /* A slave. */ Tcl_Interp *slaveInterp; /* A slave. */
Tcl_Interp *masterInterp; /* A master. */ Tcl_Interp *masterInterp; /* A master. */
@ -1524,11 +1537,12 @@ Tcl_InterpCmd(clientData, interp, argc, argv)
*/ */
static int static int
SlaveObjectCmd(clientData, interp, argc, argv) SlaveObjectCmd(
ClientData clientData; /* Slave interpreter. */ ClientData clientData, /* Slave interpreter. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Master *masterPtr; /* Master record for slave interp. */ Master *masterPtr; /* Master record for slave interp. */
Slave *slavePtr; /* Slave record. */ Slave *slavePtr; /* Slave record. */
@ -1710,8 +1724,9 @@ SlaveObjectCmd(clientData, interp, argc, argv)
*/ */
static void static void
SlaveObjectDeleteProc(clientData) SlaveObjectDeleteProc(
ClientData clientData; /* The SlaveRecord for the command. */ ClientData clientData /* The SlaveRecord for the command. */
)
{ {
Slave *slavePtr; /* Interim storage for Slave record. */ Slave *slavePtr; /* Interim storage for Slave record. */
Tcl_Interp *slaveInterp; /* And for a slave interp. */ Tcl_Interp *slaveInterp; /* And for a slave interp. */
@ -1773,11 +1788,12 @@ SlaveObjectDeleteProc(clientData)
*/ */
static int static int
AliasCmd(clientData, interp, argc, argv) AliasCmd(
ClientData clientData; /* Alias record. */ ClientData clientData, /* Alias record. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Alias *aliasPtr; /* Describes the alias. */ Alias *aliasPtr; /* Describes the alias. */
Tcl_CmdInfo cmdInfo; /* Info about target command. */ Tcl_CmdInfo cmdInfo; /* Info about target command. */
@ -1926,8 +1942,9 @@ AliasCmd(clientData, interp, argc, argv)
*/ */
static void static void
AliasCmdDeleteProc(clientData) AliasCmdDeleteProc(
ClientData clientData; /* The alias record for this alias. */ ClientData clientData /* The alias record for this alias. */
)
{ {
Alias *aliasPtr; /* Alias record for alias to delete. */ Alias *aliasPtr; /* Alias record for alias to delete. */
Target *targetPtr; /* Record for target of this alias. */ Target *targetPtr; /* Record for target of this alias. */
@ -1972,9 +1989,10 @@ AliasCmdDeleteProc(clientData)
*/ */
static void static void
MasterRecordDeleteProc(clientData, interp) MasterRecordDeleteProc(
ClientData clientData; /* Master record for deleted interp. */ ClientData clientData, /* Master record for deleted interp. */
Tcl_Interp *interp; /* Interpreter being deleted. */ Tcl_Interp *interp /* Interpreter being deleted. */
)
{ {
Target *targetPtr; /* Loop variable. */ Target *targetPtr; /* Loop variable. */
Tcl_HashEntry *hPtr; /* Search element. */ Tcl_HashEntry *hPtr; /* Search element. */
@ -2025,9 +2043,10 @@ MasterRecordDeleteProc(clientData, interp)
*/ */
static void static void
SlaveRecordDeleteProc(clientData, interp) SlaveRecordDeleteProc(
ClientData clientData; /* Slave record for deleted interp. */ ClientData clientData, /* Slave record for deleted interp. */
Tcl_Interp *interp; /* Interpreter being deleted. */ Tcl_Interp *interp /* Interpreter being deleted. */
)
{ {
Slave *slavePtr; /* Interim storage. */ Slave *slavePtr; /* Interim storage. */
Alias *aliasPtr; Alias *aliasPtr;
@ -2128,8 +2147,9 @@ SlaveRecordDeleteProc(clientData, interp)
*/ */
int int
TclInterpInit(interp) TclInterpInit(
Tcl_Interp *interp; /* Interpreter to initialize. */ Tcl_Interp *interp /* Interpreter to initialize. */
)
{ {
Master *masterPtr; /* Its Master record. */ Master *masterPtr; /* Its Master record. */
@ -2161,8 +2181,9 @@ TclInterpInit(interp)
*/ */
int int
Tcl_IsSafe(interp) Tcl_IsSafe(
Tcl_Interp *interp; /* Is this interpreter "safe" ? */ Tcl_Interp *interp /* Is this interpreter "safe" ? */
)
{ {
Master *masterPtr; /* Its master record. */ Master *masterPtr; /* Its master record. */
@ -2193,8 +2214,9 @@ Tcl_IsSafe(interp)
*/ */
int int
Tcl_MakeSafe(interp) Tcl_MakeSafe(
Tcl_Interp *interp; /* Make this interpreter "safe". */ Tcl_Interp *interp /* Make this interpreter "safe". */
)
{ {
if (interp == (Tcl_Interp *) NULL) { if (interp == (Tcl_Interp *) NULL) {
return TCL_ERROR; return TCL_ERROR;
@ -2226,10 +2248,11 @@ Tcl_MakeSafe(interp)
*/ */
Tcl_Interp * Tcl_Interp *
Tcl_CreateSlave(interp, slavePath, isSafe) Tcl_CreateSlave(
Tcl_Interp *interp; /* Interpreter to start search at. */ Tcl_Interp *interp, /* Interpreter to start search at. */
char *slavePath; /* Name of slave to create. */ char *slavePath, /* Name of slave to create. */
int isSafe; /* Should new slave be "safe" ? */ int isSafe /* Should new slave be "safe" ? */
)
{ {
if ((interp == (Tcl_Interp *) NULL) || (slavePath == (char *) NULL)) { if ((interp == (Tcl_Interp *) NULL) || (slavePath == (char *) NULL)) {
return NULL; return NULL;
@ -2255,9 +2278,10 @@ Tcl_CreateSlave(interp, slavePath, isSafe)
*/ */
Tcl_Interp * Tcl_Interp *
Tcl_GetSlave(interp, slavePath) Tcl_GetSlave(
Tcl_Interp *interp; /* Interpreter to start search from. */ Tcl_Interp *interp, /* Interpreter to start search from. */
char *slavePath; /* Path of slave to find. */ char *slavePath /* Path of slave to find. */
)
{ {
Master *masterPtr; /* Interim storage for Master record. */ Master *masterPtr; /* Interim storage for Master record. */
@ -2288,8 +2312,9 @@ Tcl_GetSlave(interp, slavePath)
*/ */
Tcl_Interp * Tcl_Interp *
Tcl_GetMaster(interp) Tcl_GetMaster(
Tcl_Interp *interp; /* Get the master of this interpreter. */ Tcl_Interp *interp /* Get the master of this interpreter. */
)
{ {
Slave *slavePtr; /* Slave record of this interpreter. */ Slave *slavePtr; /* Slave record of this interpreter. */
@ -2321,13 +2346,14 @@ Tcl_GetMaster(interp)
*/ */
int int
Tcl_CreateAlias(slaveInterp, slaveCmd, targetInterp, targetCmd, argc, argv) Tcl_CreateAlias(
Tcl_Interp *slaveInterp; /* Interpreter for source command. */ Tcl_Interp *slaveInterp, /* Interpreter for source command. */
char *slaveCmd; /* Command to install in slave. */ char *slaveCmd, /* Command to install in slave. */
Tcl_Interp *targetInterp; /* Interpreter for target command. */ Tcl_Interp *targetInterp, /* Interpreter for target command. */
char *targetCmd; /* Name of target command. */ char *targetCmd, /* Name of target command. */
int argc; /* How many additional arguments? */ int argc, /* How many additional arguments? */
char **argv; /* These are the additional args. */ char **argv /* These are the additional args. */
)
{ {
Master *masterPtr; /* Master record for target interp. */ Master *masterPtr; /* Master record for target interp. */
@ -2365,14 +2391,14 @@ Tcl_CreateAlias(slaveInterp, slaveCmd, targetInterp, targetCmd, argc, argv)
*/ */
int int
Tcl_GetAlias(interp, aliasName, targetInterpPtr, targetNamePtr, argcPtr, Tcl_GetAlias(
argvPtr) Tcl_Interp *interp, /* Interp to start search from. */
Tcl_Interp *interp; /* Interp to start search from. */ char *aliasName, /* Name of alias to find. */
char *aliasName; /* Name of alias to find. */ Tcl_Interp **targetInterpPtr, /* (Return) target interpreter. */
Tcl_Interp **targetInterpPtr; /* (Return) target interpreter. */ char **targetNamePtr, /* (Return) name of target command. */
char **targetNamePtr; /* (Return) name of target command. */ int *argcPtr, /* (Return) count of addnl args. */
int *argcPtr; /* (Return) count of addnl args. */ char ***argvPtr /* (Return) additional arguments. */
char ***argvPtr; /* (Return) additional arguments. */ )
{ {
Slave *slavePtr; /* Slave record for slave interp. */ Slave *slavePtr; /* Slave record for slave interp. */
Tcl_HashEntry *hPtr; /* Search element. */ Tcl_HashEntry *hPtr; /* Search element. */

View file

@ -94,14 +94,15 @@ static char * StringValue _ANSI_ARGS_((Link *linkPtr,
*/ */
int int
Tcl_LinkVar(interp, varName, addr, type) Tcl_LinkVar(
Tcl_Interp *interp; /* Interpreter in which varName exists. */ Tcl_Interp *interp, /* Interpreter in which varName exists. */
char *varName; /* Name of a global variable in interp. */ char *varName, /* Name of a global variable in interp. */
char *addr; /* Address of a C variable to be linked char *addr, /* Address of a C variable to be linked
* to varName. */ * to varName. */
int type; /* Type of C variable: TCL_LINK_INT, etc. int type /* Type of C variable: TCL_LINK_INT, etc.
* Also may have TCL_LINK_READ_ONLY * Also may have TCL_LINK_READ_ONLY
* OR'ed in. */ * OR'ed in. */
)
{ {
Link *linkPtr; Link *linkPtr;
char buffer[TCL_DOUBLE_SPACE]; char buffer[TCL_DOUBLE_SPACE];
@ -149,9 +150,10 @@ Tcl_LinkVar(interp, varName, addr, type)
*/ */
void void
Tcl_UnlinkVar(interp, varName) Tcl_UnlinkVar(
Tcl_Interp *interp; /* Interpreter containing variable to unlink. */ Tcl_Interp *interp, /* Interpreter containing variable to unlink. */
char *varName; /* Global variable in interp to unlink. */ char *varName /* Global variable in interp to unlink. */
)
{ {
Link *linkPtr; Link *linkPtr;
@ -187,9 +189,10 @@ Tcl_UnlinkVar(interp, varName)
*/ */
void void
Tcl_UpdateLinkedVar(interp, varName) Tcl_UpdateLinkedVar(
Tcl_Interp *interp; /* Interpreter containing variable. */ Tcl_Interp *interp, /* Interpreter containing variable. */
char *varName; /* Name of global variable that is linked. */ char *varName /* Name of global variable that is linked. */
)
{ {
Link *linkPtr; Link *linkPtr;
char buffer[TCL_DOUBLE_SPACE]; char buffer[TCL_DOUBLE_SPACE];
@ -225,12 +228,13 @@ Tcl_UpdateLinkedVar(interp, varName)
*/ */
static char * static char *
LinkTraceProc(clientData, interp, name1, name2, flags) LinkTraceProc(
ClientData clientData; /* Contains information about the link. */ ClientData clientData, /* Contains information about the link. */
Tcl_Interp *interp; /* Interpreter containing Tcl variable. */ Tcl_Interp *interp, /* Interpreter containing Tcl variable. */
char *name1; /* First part of variable name. */ char *name1, /* First part of variable name. */
char *name2; /* Second part of variable name. */ char *name2, /* Second part of variable name. */
int flags; /* Miscellaneous additional information. */ int flags /* Miscellaneous additional information. */
)
{ {
Link *linkPtr = (Link *) clientData; Link *linkPtr = (Link *) clientData;
int changed; int changed;
@ -373,11 +377,12 @@ LinkTraceProc(clientData, interp, name1, name2, flags)
*/ */
static char * static char *
StringValue(linkPtr, buffer) StringValue(
Link *linkPtr; /* Structure describing linked variable. */ Link *linkPtr, /* Structure describing linked variable. */
char *buffer; /* Small buffer to use for converting char *buffer /* Small buffer to use for converting
* values. Must have TCL_DOUBLE_SPACE * values. Must have TCL_DOUBLE_SPACE
* bytes or more. */ * bytes or more. */
)
{ {
char *p; char *p;

View file

@ -117,11 +117,12 @@ static void LoadExitProc _ANSI_ARGS_((ClientData clientData));
*/ */
int int
Tcl_LoadCmd(dummy, interp, argc, argv) Tcl_LoadCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Tcl_Interp *target; Tcl_Interp *target;
LoadedPackage *pkgPtr; LoadedPackage *pkgPtr;
@ -430,23 +431,24 @@ Tcl_LoadCmd(dummy, interp, argc, argv)
*/ */
void void
Tcl_StaticPackage(interp, pkgName, initProc, safeInitProc) Tcl_StaticPackage(
Tcl_Interp *interp; /* If not NULL, it means that the Tcl_Interp *interp, /* If not NULL, it means that the
* package has already been loaded * package has already been loaded
* into the given interpreter by * into the given interpreter by
* calling the appropriate init proc. */ * calling the appropriate init proc. */
char *pkgName; /* Name of package (must be properly char *pkgName, /* Name of package (must be properly
* capitalized: first letter upper * capitalized: first letter upper
* case, others lower case). */ * case, others lower case). */
Tcl_PackageInitProc *initProc; /* Procedure to call to incorporate Tcl_PackageInitProc *initProc, /* Procedure to call to incorporate
* this package into a trusted * this package into a trusted
* interpreter. */ * interpreter. */
Tcl_PackageInitProc *safeInitProc; /* Procedure to call to incorporate Tcl_PackageInitProc *safeInitProc /* Procedure to call to incorporate
* this package into a safe interpreter * this package into a safe interpreter
* (one that will execute untrusted * (one that will execute untrusted
* scripts). NULL means the package * scripts). NULL means the package
* can't be used in safe * can't be used in safe
* interpreters. */ * interpreters. */
)
{ {
LoadedPackage *pkgPtr; LoadedPackage *pkgPtr;
InterpPackage *ipPtr, *ipFirstPtr; InterpPackage *ipPtr, *ipFirstPtr;
@ -500,13 +502,14 @@ Tcl_StaticPackage(interp, pkgName, initProc, safeInitProc)
*/ */
int int
TclGetLoadedPackages(interp, targetName) TclGetLoadedPackages(
Tcl_Interp *interp; /* Interpreter in which to return Tcl_Interp *interp, /* Interpreter in which to return
* information or error message. */ * information or error message. */
char *targetName; /* Name of target interpreter or NULL. char *targetName /* Name of target interpreter or NULL.
* If NULL, return info about all interps; * If NULL, return info about all interps;
* otherwise, just return info about this * otherwise, just return info about this
* interpreter. */ * interpreter. */
)
{ {
Tcl_Interp *target; Tcl_Interp *target;
LoadedPackage *pkgPtr; LoadedPackage *pkgPtr;
@ -575,10 +578,11 @@ TclGetLoadedPackages(interp, targetName)
*/ */
static void static void
LoadCleanupProc(clientData, interp) LoadCleanupProc(
ClientData clientData; /* Pointer to first InterpPackage structure ClientData clientData, /* Pointer to first InterpPackage structure
* for interp. */ * for interp. */
Tcl_Interp *interp; /* Interpreter that is being deleted. */ Tcl_Interp *interp /* Interpreter that is being deleted. */
)
{ {
InterpPackage *ipPtr, *nextPtr; InterpPackage *ipPtr, *nextPtr;
@ -608,8 +612,9 @@ LoadCleanupProc(clientData, interp)
*/ */
static void static void
LoadExitProc(clientData) LoadExitProc(
ClientData clientData; /* Not used. */ ClientData clientData /* Not used. */
)
{ {
LoadedPackage *pkgPtr; LoadedPackage *pkgPtr;

View file

@ -58,15 +58,16 @@
*/ */
int int
TclLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr) TclLoadFile(
Tcl_Interp *interp; /* Used for error reporting. */ Tcl_Interp *interp, /* Used for error reporting. */
char *fileName; /* Name of the file containing the desired char *fileName, /* Name of the file containing the desired
* code. */ * code. */
char *sym1, *sym2; /* Names of two procedures to look up in char *sym1, char *sym2, /* Names of two procedures to look up in
* the file's symbol table. */ * the file's symbol table. */
Tcl_PackageInitProc **proc1Ptr, **proc2Ptr; Tcl_PackageInitProc **proc1Ptr, Tcl_PackageInitProc **proc2Ptr
/* Where to return the addresses corresponding /* Where to return the addresses corresponding
* to sym1 and sym2. */ * to sym1 and sym2. */
)
{ {
interp->result = interp->result =
"dynamic loading is not currently available on this system"; "dynamic loading is not currently available on this system";
@ -94,11 +95,12 @@ TclLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr)
*/ */
int int
TclGuessPackageName(fileName, bufPtr) TclGuessPackageName(
char *fileName; /* Name of file containing package (already char *fileName, /* Name of file containing package (already
* translated to local form if needed). */ * translated to local form if needed). */
Tcl_DString *bufPtr; /* Initialized empty dstring. Append Tcl_DString *bufPtr /* Initialized empty dstring. Append
* package name to this if possible. */ * package name to this if possible. */
)
{ {
return 0; return 0;
} }

View file

@ -100,13 +100,14 @@ static int CheckmemCmd _ANSI_ARGS_((ClientData clientData,
*/ */
void void
Tcl_Main(argc, argv, appInitProc) Tcl_Main(
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Array of argument strings. */ char **argv, /* Array of argument strings. */
Tcl_AppInitProc *appInitProc; /* Application-specific initialization Tcl_AppInitProc *appInitProc /* Application-specific initialization
* procedure to call after most * procedure to call after most
* initialization but before starting * initialization but before starting
* to execute commands. */ * to execute commands. */
)
{ {
char buffer[1000], *cmd, *args, *fileName; char buffer[1000], *cmd, *args, *fileName;
int code, gotPartial, tty, length; int code, gotPartial, tty, length;
@ -350,11 +351,12 @@ done:
/* ARGSUSED */ /* ARGSUSED */
static int static int
CheckmemCmd(clientData, interp, argc, argv) CheckmemCmd(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
Tcl_Interp *interp; /* Interpreter for evaluation. */ Tcl_Interp *interp, /* Interpreter for evaluation. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char *argv[]; /* String values of arguments. */ char *argv[] /* String values of arguments. */
)
{ {
extern char *tclMemDumpFileName; extern char *tclMemDumpFileName;
if (argc != 2) { if (argc != 2) {

View file

@ -127,13 +127,14 @@ static int ServiceEvent _ANSI_ARGS_((int flags));
*/ */
void void
Tcl_CreateEventSource(setupProc, checkProc, clientData) Tcl_CreateEventSource(
Tcl_EventSetupProc *setupProc; /* Procedure to invoke to figure out Tcl_EventSetupProc *setupProc, /* Procedure to invoke to figure out
* what to wait for. */ * what to wait for. */
Tcl_EventCheckProc *checkProc; /* Procedure to call after waiting Tcl_EventCheckProc *checkProc, /* Procedure to call after waiting
* to see what happened. */ * to see what happened. */
ClientData clientData; /* One-word argument to pass to ClientData clientData /* One-word argument to pass to
* setupProc and checkProc. */ * setupProc and checkProc. */
)
{ {
TclEventSource *sourcePtr; TclEventSource *sourcePtr;
@ -165,13 +166,14 @@ Tcl_CreateEventSource(setupProc, checkProc, clientData)
*/ */
void void
Tcl_DeleteEventSource(setupProc, checkProc, clientData) Tcl_DeleteEventSource(
Tcl_EventSetupProc *setupProc; /* Procedure to invoke to figure out Tcl_EventSetupProc *setupProc, /* Procedure to invoke to figure out
* what to wait for. */ * what to wait for. */
Tcl_EventCheckProc *checkProc; /* Procedure to call after waiting Tcl_EventCheckProc *checkProc, /* Procedure to call after waiting
* to see what happened. */ * to see what happened. */
ClientData clientData; /* One-word argument to pass to ClientData clientData /* One-word argument to pass to
* setupProc and checkProc. */ * setupProc and checkProc. */
)
{ {
TclEventSource *sourcePtr, *prevPtr; TclEventSource *sourcePtr, *prevPtr;
@ -215,15 +217,16 @@ Tcl_DeleteEventSource(setupProc, checkProc, clientData)
*/ */
void void
Tcl_QueueEvent(evPtr, position) Tcl_QueueEvent(
Tcl_Event* evPtr; /* Event to add to queue. The storage Tcl_Event* evPtr, /* Event to add to queue. The storage
* space must have been allocated the caller * space must have been allocated the caller
* with malloc (ckalloc), and it becomes * with malloc (ckalloc), and it becomes
* the property of the event queue. It * the property of the event queue. It
* will be freed after the event has been * will be freed after the event has been
* handled. */ * handled. */
Tcl_QueuePosition position; /* One of TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, Tcl_QueuePosition position /* One of TCL_QUEUE_TAIL, TCL_QUEUE_HEAD,
* TCL_QUEUE_MARK. */ * TCL_QUEUE_MARK. */
)
{ {
if (position == TCL_QUEUE_TAIL) { if (position == TCL_QUEUE_TAIL) {
/* /*
@ -286,9 +289,10 @@ Tcl_QueueEvent(evPtr, position)
*/ */
void void
Tcl_DeleteEvents(proc, clientData) Tcl_DeleteEvents(
Tcl_EventDeleteProc *proc; /* The procedure to call. */ Tcl_EventDeleteProc *proc, /* The procedure to call. */
ClientData clientData; /* type-specific data. */ ClientData clientData /* type-specific data. */
)
{ {
Tcl_Event *evPtr, *prevPtr, *hold; Tcl_Event *evPtr, *prevPtr, *hold;
@ -335,13 +339,14 @@ Tcl_DeleteEvents(proc, clientData)
*/ */
static int static int
ServiceEvent(flags) ServiceEvent(
int flags; /* Indicates what events should be processed. int flags /* Indicates what events should be processed.
* May be any combination of TCL_WINDOW_EVENTS * May be any combination of TCL_WINDOW_EVENTS
* TCL_FILE_EVENTS, TCL_TIMER_EVENTS, or other * TCL_FILE_EVENTS, TCL_TIMER_EVENTS, or other
* flags defined elsewhere. Events not * flags defined elsewhere. Events not
* matching this will be skipped for processing * matching this will be skipped for processing
* later. */ * later. */
)
{ {
Tcl_Event *evPtr, *prevPtr; Tcl_Event *evPtr, *prevPtr;
Tcl_EventProc *proc; Tcl_EventProc *proc;
@ -438,10 +443,11 @@ ServiceEvent(flags)
*/ */
void void
Tcl_SetMaxBlockTime(timePtr) Tcl_SetMaxBlockTime(
Tcl_Time *timePtr; /* Specifies a maximum elapsed time for Tcl_Time *timePtr /* Specifies a maximum elapsed time for
* the next blocking operation in the * the next blocking operation in the
* event notifier. */ * event notifier. */
)
{ {
if (!blockTimeSet || (timePtr->sec < blockTime.sec) if (!blockTimeSet || (timePtr->sec < blockTime.sec)
|| ((timePtr->sec == blockTime.sec) || ((timePtr->sec == blockTime.sec)
@ -475,12 +481,13 @@ Tcl_SetMaxBlockTime(timePtr)
*/ */
int int
Tcl_DoOneEvent(flags) Tcl_DoOneEvent(
int flags; /* Miscellaneous flag values: may be any int flags /* Miscellaneous flag values: may be any
* combination of TCL_DONT_WAIT, * combination of TCL_DONT_WAIT,
* TCL_WINDOW_EVENTS, TCL_FILE_EVENTS, * TCL_WINDOW_EVENTS, TCL_FILE_EVENTS,
* TCL_TIMER_EVENTS, TCL_IDLE_EVENTS, or * TCL_TIMER_EVENTS, TCL_IDLE_EVENTS, or
* others defined by event sources. */ * others defined by event sources. */
)
{ {
TclEventSource *sourcePtr; TclEventSource *sourcePtr;
Tcl_Time *timePtr; Tcl_Time *timePtr;

View file

@ -192,11 +192,12 @@ static char * VarNameEnd _ANSI_ARGS_((char *string));
*/ */
char char
Tcl_Backslash(src, readPtr) Tcl_Backslash(
char *src; /* Points to the backslash character of char *src, /* Points to the backslash character of
* a backslash sequence. */ * a backslash sequence. */
int *readPtr; /* Fill in with number of characters read int *readPtr /* Fill in with number of characters read
* from src, unless NULL. */ * from src, unless NULL. */
)
{ {
register char *p = src+1; register char *p = src+1;
char result; char result;
@ -307,19 +308,20 @@ Tcl_Backslash(src, readPtr)
*/ */
int int
TclParseQuotes(interp, string, termChar, flags, termPtr, pvPtr) TclParseQuotes(
Tcl_Interp *interp; /* Interpreter to use for nested command Tcl_Interp *interp, /* Interpreter to use for nested command
* evaluations and error messages. */ * evaluations and error messages. */
char *string; /* Character just after opening double- char *string, /* Character just after opening double-
* quote. */ * quote. */
int termChar; /* Character that terminates "quoted" string int termChar, /* Character that terminates "quoted" string
* (usually double-quote, but sometimes * (usually double-quote, but sometimes
* right-paren or something else). */ * right-paren or something else). */
int flags; /* Flags to pass to nested Tcl_Eval calls. */ int flags, /* Flags to pass to nested Tcl_Eval calls. */
char **termPtr; /* Store address of terminating character char **termPtr, /* Store address of terminating character
* here. */ * here. */
ParseValue *pvPtr; /* Information about where to place ParseValue *pvPtr /* Information about where to place
* fully-substituted result of parse. */ * fully-substituted result of parse. */
)
{ {
register char *src, *dst, c; register char *src, *dst, c;
@ -426,15 +428,16 @@ TclParseQuotes(interp, string, termChar, flags, termPtr, pvPtr)
*/ */
int int
TclParseNestedCmd(interp, string, flags, termPtr, pvPtr) TclParseNestedCmd(
Tcl_Interp *interp; /* Interpreter to use for nested command Tcl_Interp *interp, /* Interpreter to use for nested command
* evaluations and error messages. */ * evaluations and error messages. */
char *string; /* Character just after opening bracket. */ char *string, /* Character just after opening bracket. */
int flags; /* Flags to pass to nested Tcl_Eval. */ int flags, /* Flags to pass to nested Tcl_Eval. */
char **termPtr; /* Store address of terminating character char **termPtr, /* Store address of terminating character
* here. */ * here. */
register ParseValue *pvPtr; /* Information about where to place register ParseValue *pvPtr /* Information about where to place
* result of command. */ * result of command. */
)
{ {
int result, length, shortfall; int result, length, shortfall;
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
@ -494,14 +497,15 @@ TclParseNestedCmd(interp, string, flags, termPtr, pvPtr)
*/ */
int int
TclParseBraces(interp, string, termPtr, pvPtr) TclParseBraces(
Tcl_Interp *interp; /* Interpreter to use for nested command Tcl_Interp *interp, /* Interpreter to use for nested command
* evaluations and error messages. */ * evaluations and error messages. */
char *string; /* Character just after opening bracket. */ char *string, /* Character just after opening bracket. */
char **termPtr; /* Store address of terminating character char **termPtr, /* Store address of terminating character
* here. */ * here. */
register ParseValue *pvPtr; /* Information about where to place register ParseValue *pvPtr /* Information about where to place
* result of command. */ * result of command. */
)
{ {
int level; int level;
register char *src, *dst, *end; register char *src, *dst, *end;
@ -620,20 +624,21 @@ TclParseBraces(interp, string, termPtr, pvPtr)
*/ */
int int
TclParseWords(interp, string, flags, maxWords, termPtr, argcPtr, argv, pvPtr) TclParseWords(
Tcl_Interp *interp; /* Interpreter to use for nested command Tcl_Interp *interp, /* Interpreter to use for nested command
* evaluations and error messages. */ * evaluations and error messages. */
char *string; /* First character of word. */ char *string, /* First character of word. */
int flags; /* Flags to control parsing (same values as int flags, /* Flags to control parsing (same values as
* passed to Tcl_Eval). */ * passed to Tcl_Eval). */
int maxWords; /* Maximum number of words to parse. */ int maxWords, /* Maximum number of words to parse. */
char **termPtr; /* Store address of terminating character char **termPtr, /* Store address of terminating character
* here. */ * here. */
int *argcPtr; /* Filled in with actual number of words int *argcPtr, /* Filled in with actual number of words
* parsed. */ * parsed. */
char **argv; /* Store addresses of individual words here. */ char **argv, /* Store addresses of individual words here. */
register ParseValue *pvPtr; /* Information about where to place register ParseValue *pvPtr /* Information about where to place
* fully-substituted word. */ * fully-substituted word. */
)
{ {
register char *src, *dst; register char *src, *dst;
register char c; register char c;
@ -875,14 +880,15 @@ TclParseWords(interp, string, flags, maxWords, termPtr, argcPtr, argv, pvPtr)
*/ */
void void
TclExpandParseValue(pvPtr, needed) TclExpandParseValue(
register ParseValue *pvPtr; /* Information about buffer that register ParseValue *pvPtr, /* Information about buffer that
* must be expanded. If the clientData * must be expanded. If the clientData
* in the structure is non-zero, it * in the structure is non-zero, it
* means that the current buffer is * means that the current buffer is
* dynamically allocated. */ * dynamically allocated. */
int needed; /* Minimum amount of additional space int needed /* Minimum amount of additional space
* to allocate. */ * to allocate. */
)
{ {
int newSpace; int newSpace;
char *new; char *new;
@ -937,14 +943,15 @@ TclExpandParseValue(pvPtr, needed)
*/ */
char * char *
TclWordEnd(start, nested, semiPtr) TclWordEnd(
char *start; /* Beginning of a word of a Tcl command. */ char *start, /* Beginning of a word of a Tcl command. */
int nested; /* Zero means this is a top-level command. int nested, /* Zero means this is a top-level command.
* One means this is a nested command (close * One means this is a nested command (close
* bracket is a word terminator). */ * bracket is a word terminator). */
int *semiPtr; /* Set to 1 if word ends with a command- int *semiPtr /* Set to 1 if word ends with a command-
* terminating semi-colon, zero otherwise. * terminating semi-colon, zero otherwise.
* If NULL then ignored. */ * If NULL then ignored. */
)
{ {
register char *p; register char *p;
int count; int count;
@ -1086,11 +1093,12 @@ TclWordEnd(start, nested, semiPtr)
*/ */
static char * static char *
QuoteEnd(string, term) QuoteEnd(
char *string; /* Pointer to character just after opening char *string, /* Pointer to character just after opening
* "quote". */ * "quote". */
int term; /* This character will terminate the int term /* This character will terminate the
* quoted string (e.g. '"' or ')'). */ * quoted string (e.g. '"' or ')'). */
)
{ {
register char *p = string; register char *p = string;
int count; int count;
@ -1143,8 +1151,9 @@ QuoteEnd(string, term)
*/ */
static char * static char *
VarNameEnd(string) VarNameEnd(
char *string; /* Pointer to dollar-sign character. */ char *string /* Pointer to dollar-sign character. */
)
{ {
register char *p = string+1; register char *p = string+1;
@ -1185,12 +1194,13 @@ VarNameEnd(string)
*/ */
static char * static char *
ScriptEnd(p, nested) ScriptEnd(
char *p; /* Script to check. */ char *p, /* Script to check. */
int nested; /* Zero means this is a top-level command. int nested /* Zero means this is a top-level command.
* One means this is a nested command (the * One means this is a nested command (the
* last character of the script must be * last character of the script must be
* an unquoted ]). */ * an unquoted ]). */
)
{ {
int commentOK = 1; int commentOK = 1;
int length; int length;
@ -1261,14 +1271,14 @@ ScriptEnd(p, nested)
*/ */
char * char *
Tcl_ParseVar(interp, string, termPtr) Tcl_ParseVar(
Tcl_Interp *interp; /* Context for looking up variable. */ Tcl_Interp *interp, /* Context for looking up variable. */
register char *string; /* String containing variable name. register char *string, /* String containing variable name.
* First character must be "$". */ * First character must be "$". */
char **termPtr; /* If non-NULL, points to word to fill char **termPtr /* If non-NULL, points to word to fill
* in with character just after last * in with character just after last
* one in the variable specifier. */ * one in the variable specifier. */
)
{ {
char *name1, *name1End, c, *result; char *name1, *name1End, c, *result;
register char *name2; register char *name2;
@ -1396,8 +1406,9 @@ Tcl_ParseVar(interp, string, termPtr)
*/ */
int int
Tcl_CommandComplete(cmd) Tcl_CommandComplete(
char *cmd; /* Command to check. */ char *cmd /* Command to check. */
)
{ {
char *p; char *p;

View file

@ -103,11 +103,12 @@ static Package * FindPackage _ANSI_ARGS_((Tcl_Interp *interp,
*/ */
int int
Tcl_PkgProvide(interp, name, version) Tcl_PkgProvide(
Tcl_Interp *interp; /* Interpreter in which package is now Tcl_Interp *interp, /* Interpreter in which package is now
* available. */ * available. */
char *name; /* Name of package. */ char *name, /* Name of package. */
char *version; /* Version string for package. */ char *version /* Version string for package. */
)
{ {
Package *pkgPtr; Package *pkgPtr;
@ -155,16 +156,17 @@ Tcl_PkgProvide(interp, name, version)
*/ */
char * char *
Tcl_PkgRequire(interp, name, version, exact) Tcl_PkgRequire(
Tcl_Interp *interp; /* Interpreter in which package is now Tcl_Interp *interp, /* Interpreter in which package is now
* available. */ * available. */
char *name; /* Name of desired package. */ char *name, /* Name of desired package. */
char *version; /* Version string for desired version; char *version, /* Version string for desired version;
* NULL means use the latest version * NULL means use the latest version
* available. */ * available. */
int exact; /* Non-zero means that only the particular int exact /* Non-zero means that only the particular
* version given is acceptable. Zero means * version given is acceptable. Zero means
* use the latest compatible version. */ * use the latest compatible version. */
)
{ {
Package *pkgPtr; Package *pkgPtr;
PkgAvail *availPtr, *bestPtr; PkgAvail *availPtr, *bestPtr;
@ -312,11 +314,12 @@ Tcl_PkgRequire(interp, name, version, exact)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_PackageCmd(dummy, interp, argc, argv) Tcl_PackageCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
size_t length; size_t length;
@ -554,9 +557,10 @@ Tcl_PackageCmd(dummy, interp, argc, argv)
*/ */
static Package * static Package *
FindPackage(interp, name) FindPackage(
Tcl_Interp *interp; /* Interpreter to use for package lookup. */ Tcl_Interp *interp, /* Interpreter to use for package lookup. */
char *name; /* Name of package to fine. */ char *name /* Name of package to fine. */
)
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
Tcl_HashEntry *hPtr; Tcl_HashEntry *hPtr;
@ -594,8 +598,9 @@ FindPackage(interp, name)
*/ */
void void
TclFreePackageInfo(iPtr) TclFreePackageInfo(
Interp *iPtr; /* Interpereter that is being deleted. */ Interp *iPtr /* Interpereter that is being deleted. */
)
{ {
Package *pkgPtr; Package *pkgPtr;
Tcl_HashSearch search; Tcl_HashSearch search;
@ -643,11 +648,12 @@ TclFreePackageInfo(iPtr)
*/ */
static int static int
CheckVersion(interp, string) CheckVersion(
Tcl_Interp *interp; /* Used for error reporting. */ Tcl_Interp *interp, /* Used for error reporting. */
char *string; /* Supposedly a version number, which is char *string /* Supposedly a version number, which is
* groups of decimal digits separated * groups of decimal digits separated
* by dots. */ * by dots. */
)
{ {
char *p = string; char *p = string;
@ -690,14 +696,15 @@ CheckVersion(interp, string)
*/ */
static int static int
ComparePkgVersions(v1, v2, satPtr) ComparePkgVersions(
char *v1, *v2; /* Versions strings, of form 2.1.3 (any char *v1, char *v2, /* Versions strings, of form 2.1.3 (any
* number of version numbers). */ * number of version numbers). */
int *satPtr; /* If non-null, the word pointed to is int *satPtr /* If non-null, the word pointed to is
* filled in with a 0/1 value. 1 means * filled in with a 0/1 value. 1 means
* v1 "satisfies" v2: v1 is greater than * v1 "satisfies" v2: v1 is greater than
* or equal to v2 and both version numbers * or equal to v2 and both version numbers
* have the same major number. */ * have the same major number. */
)
{ {
int thisIsMajor, n1, n2; int thisIsMajor, n1, n2;

View file

@ -59,7 +59,7 @@
*/ */
char * char *
Tcl_ErrnoId() Tcl_ErrnoId(void)
{ {
switch (errno) { switch (errno) {
#ifdef E2BIG #ifdef E2BIG
@ -504,8 +504,9 @@ Tcl_ErrnoId()
*/ */
char * char *
Tcl_ErrnoMsg(err) Tcl_ErrnoMsg(
int err; /* Error number (such as in errno variable). */ int err /* Error number (such as in errno variable). */
)
{ {
switch (err) { switch (err) {
#ifdef E2BIG #ifdef E2BIG
@ -951,8 +952,9 @@ Tcl_ErrnoMsg(err)
*/ */
char * char *
Tcl_SignalId(sig) Tcl_SignalId(
int sig; /* Number of signal. */ int sig /* Number of signal. */
)
{ {
switch (sig) { switch (sig) {
#ifdef SIGABRT #ifdef SIGABRT
@ -1083,8 +1085,9 @@ Tcl_SignalId(sig)
*/ */
char * char *
Tcl_SignalMsg(sig) Tcl_SignalMsg(
int sig; /* Number of signal. */ int sig /* Number of signal. */
)
{ {
switch (sig) { switch (sig) {
#ifdef SIGABRT #ifdef SIGABRT

View file

@ -89,8 +89,9 @@ static void PreserveExitProc _ANSI_ARGS_((ClientData clientData));
/* ARGSUSED */ /* ARGSUSED */
static void static void
PreserveExitProc(clientData) PreserveExitProc(
ClientData clientData; /* NULL -Unused. */ ClientData clientData /* NULL -Unused. */
)
{ {
if (spaceAvl != 0) { if (spaceAvl != 0) {
ckfree((char *) refArray); ckfree((char *) refArray);
@ -120,8 +121,9 @@ PreserveExitProc(clientData)
*/ */
void void
Tcl_Preserve(clientData) Tcl_Preserve(
ClientData clientData; /* Pointer to malloc'ed block of memory. */ ClientData clientData /* Pointer to malloc'ed block of memory. */
)
{ {
Reference *refPtr; Reference *refPtr;
int i; int i;
@ -195,8 +197,9 @@ Tcl_Preserve(clientData)
*/ */
void void
Tcl_Release(clientData) Tcl_Release(
ClientData clientData; /* Pointer to malloc'ed block of memory. */ ClientData clientData /* Pointer to malloc'ed block of memory. */
)
{ {
Reference *refPtr; Reference *refPtr;
int mustFree; int mustFree;
@ -262,9 +265,10 @@ Tcl_Release(clientData)
*/ */
void void
Tcl_EventuallyFree(clientData, freeProc) Tcl_EventuallyFree(
ClientData clientData; /* Pointer to malloc'ed block of memory. */ ClientData clientData, /* Pointer to malloc'ed block of memory. */
Tcl_FreeProc *freeProc; /* Procedure to actually do free. */ Tcl_FreeProc *freeProc /* Procedure to actually do free. */
)
{ {
Reference *refPtr; Reference *refPtr;
int i; int i;

View file

@ -66,11 +66,12 @@ static void ProcDeleteProc _ANSI_ARGS_((ClientData clientData));
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_ProcCmd(dummy, interp, argc, argv) Tcl_ProcCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
register Interp *iPtr = (Interp *) interp; register Interp *iPtr = (Interp *) interp;
register Proc *procPtr; register Proc *procPtr;
@ -202,11 +203,12 @@ Tcl_ProcCmd(dummy, interp, argc, argv)
*/ */
int int
TclGetFrame(interp, string, framePtrPtr) TclGetFrame(
Tcl_Interp *interp; /* Interpreter in which to find frame. */ Tcl_Interp *interp, /* Interpreter in which to find frame. */
char *string; /* String describing frame. */ char *string, /* String describing frame. */
CallFrame **framePtrPtr; /* Store pointer to frame here (or NULL CallFrame **framePtrPtr /* Store pointer to frame here (or NULL
* if global frame indicated). */ * if global frame indicated). */
)
{ {
register Interp *iPtr = (Interp *) interp; register Interp *iPtr = (Interp *) interp;
int curLevel, level, result; int curLevel, level, result;
@ -279,11 +281,12 @@ TclGetFrame(interp, string, framePtrPtr)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_UplevelCmd(dummy, interp, argc, argv) Tcl_UplevelCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
register Interp *iPtr = (Interp *) interp; register Interp *iPtr = (Interp *) interp;
int result; int result;
@ -364,9 +367,10 @@ Tcl_UplevelCmd(dummy, interp, argc, argv)
*/ */
Proc * Proc *
TclFindProc(iPtr, procName) TclFindProc(
Interp *iPtr; /* Interpreter in which to look. */ Interp *iPtr, /* Interpreter in which to look. */
char *procName; /* Name of desired procedure. */ char *procName /* Name of desired procedure. */
)
{ {
Tcl_HashEntry *hPtr; Tcl_HashEntry *hPtr;
Command *cmdPtr; Command *cmdPtr;
@ -401,8 +405,9 @@ TclFindProc(iPtr, procName)
*/ */
Proc * Proc *
TclIsProc(cmdPtr) TclIsProc(
Command *cmdPtr; /* Command to test. */ Command *cmdPtr /* Command to test. */
)
{ {
if (cmdPtr->proc == InterpProc) { if (cmdPtr->proc == InterpProc) {
return (Proc *) cmdPtr->clientData; return (Proc *) cmdPtr->clientData;
@ -428,14 +433,15 @@ TclIsProc(cmdPtr)
*/ */
static int static int
InterpProc(clientData, interp, argc, argv) InterpProc(
ClientData clientData; /* Record describing procedure to be ClientData clientData, /* Record describing procedure to be
* interpreted. */ * interpreted. */
Tcl_Interp *interp; /* Interpreter in which procedure was Tcl_Interp *interp, /* Interpreter in which procedure was
* invoked. */ * invoked. */
int argc; /* Count of number of arguments to this int argc, /* Count of number of arguments to this
* procedure. */ * procedure. */
char **argv; /* Argument values. */ char **argv /* Argument values. */
)
{ {
register Proc *procPtr = (Proc *) clientData; register Proc *procPtr = (Proc *) clientData;
register Arg *argPtr; register Arg *argPtr;
@ -592,8 +598,9 @@ InterpProc(clientData, interp, argc, argv)
*/ */
static void static void
ProcDeleteProc(clientData) ProcDeleteProc(
ClientData clientData; /* Procedure to be deleted. */ ClientData clientData /* Procedure to be deleted. */
)
{ {
Proc *procPtr = (Proc *) clientData; Proc *procPtr = (Proc *) clientData;
@ -622,8 +629,9 @@ ProcDeleteProc(clientData)
*/ */
static void static void
CleanupProc(procPtr) CleanupProc(
register Proc *procPtr; /* Procedure to be deleted. */ register Proc *procPtr /* Procedure to be deleted. */
)
{ {
register Arg *argPtr; register Arg *argPtr;
@ -658,9 +666,10 @@ CleanupProc(procPtr)
*/ */
int int
TclUpdateReturnInfo(iPtr) TclUpdateReturnInfo(
Interp *iPtr; /* Interpreter for which TCL_RETURN Interp *iPtr /* Interpreter for which TCL_RETURN
* exception is being processed. */ * exception is being processed. */
)
{ {
int code; int code;

View file

@ -190,12 +190,13 @@ static Tcl_ChannelType tcpChannelType = {
/* ARGSUSED */ /* ARGSUSED */
static int static int
CommonBlockModeProc(instanceData, inFile, outFile, mode) CommonBlockModeProc(
ClientData instanceData; /* Unused. */ ClientData instanceData, /* Unused. */
Tcl_File inFile, outFile; /* Input, output files for channel. */ Tcl_File inFile, Tcl_File outFile, /* Input, output files for channel. */
int mode; /* The mode to set. Can be one of int mode /* The mode to set. Can be one of
* TCL_MODE_BLOCKING or * TCL_MODE_BLOCKING or
* TCL_MODE_NONBLOCKING. */ * TCL_MODE_NONBLOCKING. */
)
{ {
int curStatus; int curStatus;
int fd; int fd;
@ -249,13 +250,14 @@ CommonBlockModeProc(instanceData, inFile, outFile, mode)
/* ARGSUSED */ /* ARGSUSED */
static int static int
FilePipeInputProc(instanceData, inFile, buf, toRead, errorCodePtr) FilePipeInputProc(
ClientData instanceData; /* Unused. */ ClientData instanceData, /* Unused. */
Tcl_File inFile; /* Input device for channel. */ Tcl_File inFile, /* Input device for channel. */
char *buf; /* Where to store data read. */ char *buf, /* Where to store data read. */
int toRead; /* How much space is available int toRead, /* How much space is available
* in the buffer? */ * in the buffer? */
int *errorCodePtr; /* Where to store error code. */ int *errorCodePtr /* Where to store error code. */
)
{ {
int fd; /* The OS handle for reading. */ int fd; /* The OS handle for reading. */
int bytesRead; /* How many bytes were actually int bytesRead; /* How many bytes were actually
@ -300,12 +302,13 @@ FilePipeInputProc(instanceData, inFile, buf, toRead, errorCodePtr)
/* ARGSUSED */ /* ARGSUSED */
static int static int
FilePipeOutputProc(instanceData, outFile, buf, toWrite, errorCodePtr) FilePipeOutputProc(
ClientData instanceData; /* Unused. */ ClientData instanceData, /* Unused. */
Tcl_File outFile; /* Output device for channel. */ Tcl_File outFile, /* Output device for channel. */
char *buf; /* The data buffer. */ char *buf, /* The data buffer. */
int toWrite; /* How many bytes to write? */ int toWrite, /* How many bytes to write? */
int *errorCodePtr; /* Where to store error code. */ int *errorCodePtr /* Where to store error code. */
)
{ {
int written; int written;
int fd; int fd;
@ -339,11 +342,12 @@ FilePipeOutputProc(instanceData, outFile, buf, toWrite, errorCodePtr)
/* ARGSUSED */ /* ARGSUSED */
static int static int
FileCloseProc(instanceData, interp, inFile, outFile) FileCloseProc(
ClientData instanceData; /* Unused. */ ClientData instanceData, /* Unused. */
Tcl_Interp *interp; /* For error reporting - unused. */ Tcl_Interp *interp, /* For error reporting - unused. */
Tcl_File inFile; /* Input file to close. */ Tcl_File inFile, /* Input file to close. */
Tcl_File outFile; /* Output file to close. */ Tcl_File outFile /* Output file to close. */
)
{ {
int fd, errorCode = 0; int fd, errorCode = 0;
@ -396,16 +400,17 @@ FileCloseProc(instanceData, interp, inFile, outFile)
/* ARGSUSED */ /* ARGSUSED */
static int static int
FileSeekProc(instanceData, inFile, outFile, offset, mode, errorCodePtr) FileSeekProc(
ClientData instanceData; /* Unused. */ ClientData instanceData, /* Unused. */
Tcl_File inFile, outFile; /* Input and output Tcl_File inFile, Tcl_File outFile, /* Input and output
* files for channel. */ * files for channel. */
long offset; /* Offset to seek to. */ long offset, /* Offset to seek to. */
int mode; /* Relative to where int mode, /* Relative to where
* should we seek? Can be * should we seek? Can be
* one of SEEK_START, * one of SEEK_START,
* SEEK_SET or SEEK_END. */ * SEEK_SET or SEEK_END. */
int *errorCodePtr; /* To store error code. */ int *errorCodePtr /* To store error code. */
)
{ {
int newLoc; int newLoc;
int fd; int fd;
@ -447,9 +452,10 @@ FileSeekProc(instanceData, inFile, outFile, offset, mode, errorCodePtr)
*/ */
void void
TclGetAndDetachPids(interp, chan) TclGetAndDetachPids(
Tcl_Interp *interp; Tcl_Interp *interp,
Tcl_Channel chan; Tcl_Channel chan
)
{ {
PipeState *pipePtr; PipeState *pipePtr;
Tcl_ChannelType *chanTypePtr; Tcl_ChannelType *chanTypePtr;
@ -497,10 +503,11 @@ TclGetAndDetachPids(interp, chan)
/* ARGSUSED */ /* ARGSUSED */
static int static int
PipeCloseProc(instanceData, interp, inFile, outFile) PipeCloseProc(
ClientData instanceData; /* The pipe to close. */ ClientData instanceData, /* The pipe to close. */
Tcl_Interp *interp; /* For error reporting. */ Tcl_Interp *interp, /* For error reporting. */
Tcl_File inFile, outFile; /* Unused. */ Tcl_File inFile, Tcl_File outFile /* Unused. */
)
{ {
PipeState *pipePtr; PipeState *pipePtr;
Tcl_Channel errChan; Tcl_Channel errChan;
@ -566,15 +573,16 @@ PipeCloseProc(instanceData, interp, inFile, outFile)
*/ */
Tcl_Channel Tcl_Channel
Tcl_OpenFileChannel(interp, fileName, modeString, permissions) Tcl_OpenFileChannel(
Tcl_Interp *interp; /* Interpreter for error reporting; Tcl_Interp *interp, /* Interpreter for error reporting;
* can be NULL. */ * can be NULL. */
char *fileName; /* Name of file to open. */ char *fileName, /* Name of file to open. */
char *modeString; /* A list of POSIX open modes or char *modeString, /* A list of POSIX open modes or
* a string such as "rw". */ * a string such as "rw". */
int permissions; /* If the open involves creating a int permissions /* If the open involves creating a
* file, with what modes to create * file, with what modes to create
* it? */ * it? */
)
{ {
int fd, seekFlag, mode, channelPermissions; int fd, seekFlag, mode, channelPermissions;
Tcl_File file; Tcl_File file;
@ -680,12 +688,13 @@ Tcl_OpenFileChannel(interp, fileName, modeString, permissions)
*/ */
Tcl_Channel Tcl_Channel
Tcl_MakeFileChannel(inFd, outFd, mode) Tcl_MakeFileChannel(
ClientData inFd; /* OS level handle used for input. */ ClientData inFd, /* OS level handle used for input. */
ClientData outFd; /* OS level handle used for output. */ ClientData outFd, /* OS level handle used for output. */
int mode; /* ORed combination of TCL_READABLE and int mode /* ORed combination of TCL_READABLE and
* TCL_WRITABLE to indicate whether inFile * TCL_WRITABLE to indicate whether inFile
* and/or outFile are valid. */ * and/or outFile are valid. */
)
{ {
Tcl_File inFile, outFile; Tcl_File inFile, outFile;
char channelName[20]; char channelName[20];
@ -730,16 +739,17 @@ Tcl_MakeFileChannel(inFd, outFd, mode)
*/ */
Tcl_Channel Tcl_Channel
TclCreateCommandChannel(readFile, writeFile, errorFile, numPids, pidPtr) TclCreateCommandChannel(
Tcl_File readFile; /* If non-null, gives the file for reading. */ Tcl_File readFile, /* If non-null, gives the file for reading. */
Tcl_File writeFile; /* If non-null, gives the file for writing. */ Tcl_File writeFile, /* If non-null, gives the file for writing. */
Tcl_File errorFile; /* If non-null, gives the file where errors Tcl_File errorFile, /* If non-null, gives the file where errors
* can be read. */ * can be read. */
int numPids; /* The number of pids in the pid array. */ int numPids, /* The number of pids in the pid array. */
pid_t *pidPtr; /* An array of process identifiers. pid_t *pidPtr /* An array of process identifiers.
* Allocated by the caller, freed when * Allocated by the caller, freed when
* the channel is closed or the processes * the channel is closed or the processes
* are detached (in a background exec). */ * are detached (in a background exec). */
)
{ {
Tcl_Channel channel; Tcl_Channel channel;
char channelName[20]; char channelName[20];
@ -807,11 +817,12 @@ TclCreateCommandChannel(readFile, writeFile, errorFile, numPids, pidPtr)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_PidCmd(dummy, interp, argc, argv) Tcl_PidCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
Tcl_Channel chan; /* The channel to get pids for. */ Tcl_Channel chan; /* The channel to get pids for. */
Tcl_ChannelType *chanTypePtr; /* The type of that channel. */ Tcl_ChannelType *chanTypePtr; /* The type of that channel. */
@ -865,12 +876,13 @@ Tcl_PidCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
static int static int
TcpBlockModeProc(instanceData, inFile, outFile, mode) TcpBlockModeProc(
ClientData instanceData; /* Socket state. */ ClientData instanceData, /* Socket state. */
Tcl_File inFile, outFile; /* Input, output files for channel. */ Tcl_File inFile, Tcl_File outFile, /* Input, output files for channel. */
int mode; /* The mode to set. Can be one of int mode /* The mode to set. Can be one of
* TCL_MODE_BLOCKING or * TCL_MODE_BLOCKING or
* TCL_MODE_NONBLOCKING. */ * TCL_MODE_NONBLOCKING. */
)
{ {
TcpState *statePtr; TcpState *statePtr;
@ -901,10 +913,11 @@ TcpBlockModeProc(instanceData, inFile, outFile, mode)
*/ */
static int static int
WaitForConnect(statePtr, fileToWaitFor, errorCodePtr) WaitForConnect(
TcpState *statePtr; /* State of the socket. */ TcpState *statePtr, /* State of the socket. */
Tcl_File fileToWaitFor; /* File to wait on to become connected. */ Tcl_File fileToWaitFor, /* File to wait on to become connected. */
int *errorCodePtr; /* Where to store errors? */ int *errorCodePtr /* Where to store errors? */
)
{ {
int sock; /* The socket itself. */ int sock; /* The socket itself. */
int timeOut; /* How long to wait. */ int timeOut; /* How long to wait. */
@ -968,13 +981,14 @@ WaitForConnect(statePtr, fileToWaitFor, errorCodePtr)
/* ARGSUSED */ /* ARGSUSED */
static int static int
TcpInputProc(instanceData, inFile, buf, bufSize, errorCodePtr) TcpInputProc(
ClientData instanceData; /* Socket state. */ ClientData instanceData, /* Socket state. */
Tcl_File inFile; /* Input device for channel. */ Tcl_File inFile, /* Input device for channel. */
char *buf; /* Where to store data read. */ char *buf, /* Where to store data read. */
int bufSize; /* How much space is available int bufSize, /* How much space is available
* in the buffer? */ * in the buffer? */
int *errorCodePtr; /* Where to store error code. */ int *errorCodePtr /* Where to store error code. */
)
{ {
TcpState *statePtr; /* The state of the socket. */ TcpState *statePtr; /* The state of the socket. */
int sock; /* The OS handle. */ int sock; /* The OS handle. */
@ -1027,12 +1041,13 @@ TcpInputProc(instanceData, inFile, buf, bufSize, errorCodePtr)
*/ */
static int static int
TcpOutputProc(instanceData, outFile, buf, toWrite, errorCodePtr) TcpOutputProc(
ClientData instanceData; /* Socket state. */ ClientData instanceData, /* Socket state. */
Tcl_File outFile; /* Output device for channel. */ Tcl_File outFile, /* Output device for channel. */
char *buf; /* The data buffer. */ char *buf, /* The data buffer. */
int toWrite; /* How many bytes to write? */ int toWrite, /* How many bytes to write? */
int *errorCodePtr; /* Where to store error code. */ int *errorCodePtr /* Where to store error code. */
)
{ {
TcpState *statePtr; TcpState *statePtr;
int written; int written;
@ -1074,10 +1089,11 @@ TcpOutputProc(instanceData, outFile, buf, toWrite, errorCodePtr)
/* ARGSUSED */ /* ARGSUSED */
static int static int
TcpCloseProc(instanceData, interp, inFile, outFile) TcpCloseProc(
ClientData instanceData; /* The socket to close. */ ClientData instanceData, /* The socket to close. */
Tcl_Interp *interp; /* For error reporting - unused. */ Tcl_Interp *interp, /* For error reporting - unused. */
Tcl_File inFile, outFile; /* Unused. */ Tcl_File inFile, Tcl_File outFile /* Unused. */
)
{ {
TcpState *statePtr; TcpState *statePtr;
Tcl_File sockFile; Tcl_File sockFile;
@ -1137,14 +1153,15 @@ TcpCloseProc(instanceData, interp, inFile, outFile)
*/ */
static int static int
TcpGetOptionProc(instanceData, optionName, dsPtr) TcpGetOptionProc(
ClientData instanceData; /* Socket state. */ ClientData instanceData, /* Socket state. */
char *optionName; /* Name of the option to char *optionName, /* Name of the option to
* retrieve the value for, or * retrieve the value for, or
* NULL to get all options and * NULL to get all options and
* their values. */ * their values. */
Tcl_DString *dsPtr; /* Where to store the computed Tcl_DString *dsPtr /* Where to store the computed
* value; initialized by caller. */ * value; initialized by caller. */
)
{ {
TcpState *statePtr; TcpState *statePtr;
struct sockaddr_in sockname; struct sockaddr_in sockname;
@ -1240,18 +1257,19 @@ TcpGetOptionProc(instanceData, optionName, dsPtr)
*/ */
static TcpState * static TcpState *
CreateSocket(interp, port, host, server, myaddr, myport, async) CreateSocket(
Tcl_Interp *interp; /* For error reporting; can be NULL. */ Tcl_Interp *interp, /* For error reporting; can be NULL. */
int port; /* Port number to open. */ int port, /* Port number to open. */
char *host; /* Name of host on which to open port. char *host, /* Name of host on which to open port.
* NULL implies INADDR_ANY */ * NULL implies INADDR_ANY */
int server; /* 1 if socket should be a server socket, int server, /* 1 if socket should be a server socket,
* else 0 for a client socket. */ * else 0 for a client socket. */
char *myaddr; /* Optional client-side address */ char *myaddr, /* Optional client-side address */
int myport; /* Optional client-side port */ int myport, /* Optional client-side port */
int async; /* If nonzero and creating a client socket, int async /* If nonzero and creating a client socket,
* attempt to do an async connect. Otherwise * attempt to do an async connect. Otherwise
* do a synchronous connect or bind. */ * do a synchronous connect or bind. */
)
{ {
int status, sock, asyncConnect, curState, origState; int status, sock, asyncConnect, curState, origState;
struct sockaddr_in sockaddr; /* socket address */ struct sockaddr_in sockaddr; /* socket address */
@ -1388,10 +1406,11 @@ addressError:
*/ */
static int static int
CreateSocketAddress(sockaddrPtr, host, port) CreateSocketAddress(
struct sockaddr_in *sockaddrPtr; /* Socket address */ struct sockaddr_in *sockaddrPtr, /* Socket address */
char *host; /* Host. NULL implies INADDR_ANY */ char *host, /* Host. NULL implies INADDR_ANY */
int port; /* Port number */ int port /* Port number */
)
{ {
struct hostent *hostent; /* Host database entry */ struct hostent *hostent; /* Host database entry */
struct in_addr addr; /* For 64/32 bit madness */ struct in_addr addr; /* For 64/32 bit madness */
@ -1451,15 +1470,16 @@ CreateSocketAddress(sockaddrPtr, host, port)
*/ */
Tcl_Channel Tcl_Channel
Tcl_OpenTcpClient(interp, port, host, myaddr, myport, async) Tcl_OpenTcpClient(
Tcl_Interp *interp; /* For error reporting; can be NULL. */ Tcl_Interp *interp, /* For error reporting; can be NULL. */
int port; /* Port number to open. */ int port, /* Port number to open. */
char *host; /* Host on which to open port. */ char *host, /* Host on which to open port. */
char *myaddr; /* Client-side address */ char *myaddr, /* Client-side address */
int myport; /* Client-side port */ int myport, /* Client-side port */
int async; /* If nonzero, attempt to do an int async /* If nonzero, attempt to do an
* asynchronous connect. Otherwise * asynchronous connect. Otherwise
* we do a blocking connect. */ * we do a blocking connect. */
)
{ {
Tcl_Channel chan; Tcl_Channel chan;
TcpState *statePtr; TcpState *statePtr;
@ -1507,8 +1527,9 @@ Tcl_OpenTcpClient(interp, port, host, myaddr, myport, async)
*/ */
Tcl_Channel Tcl_Channel
Tcl_MakeTcpClientChannel(sock) Tcl_MakeTcpClientChannel(
ClientData sock; /* The socket to wrap up into a channel. */ ClientData sock /* The socket to wrap up into a channel. */
)
{ {
TcpState *statePtr; TcpState *statePtr;
Tcl_File sockFile; Tcl_File sockFile;
@ -1552,14 +1573,15 @@ Tcl_MakeTcpClientChannel(sock)
*/ */
Tcl_Channel Tcl_Channel
Tcl_OpenTcpServer(interp, port, myHost, acceptProc, acceptProcData) Tcl_OpenTcpServer(
Tcl_Interp *interp; /* For error reporting - may be Tcl_Interp *interp, /* For error reporting - may be
* NULL. */ * NULL. */
int port; /* Port number to open. */ int port, /* Port number to open. */
char *myHost; /* Name of local host. */ char *myHost, /* Name of local host. */
Tcl_TcpAcceptProc *acceptProc; /* Callback for accepting connections Tcl_TcpAcceptProc *acceptProc, /* Callback for accepting connections
* from new clients. */ * from new clients. */
ClientData acceptProcData; /* Data for the callback. */ ClientData acceptProcData /* Data for the callback. */
)
{ {
Tcl_Channel chan; Tcl_Channel chan;
TcpState *statePtr; TcpState *statePtr;
@ -1609,9 +1631,10 @@ Tcl_OpenTcpServer(interp, port, myHost, acceptProc, acceptProcData)
/* ARGSUSED */ /* ARGSUSED */
static void static void
TcpAccept(data, mask) TcpAccept(
ClientData data; /* Callback token. */ ClientData data, /* Callback token. */
int mask; /* Not used. */ int mask /* Not used. */
)
{ {
TcpState *sockState; /* Client data of server socket. */ TcpState *sockState; /* Client data of server socket. */
int newsock; /* The new client socket */ int newsock; /* The new client socket */
@ -1679,8 +1702,9 @@ TcpAccept(data, mask)
*/ */
Tcl_Channel Tcl_Channel
TclGetDefaultStdChannel(type) TclGetDefaultStdChannel(
int type; /* One of TCL_STDIN, TCL_STDOUT, TCL_STDERR. */ int type /* One of TCL_STDIN, TCL_STDOUT, TCL_STDERR. */
)
{ {
Tcl_Channel channel = NULL; Tcl_Channel channel = NULL;
int fd = 0; /* Initializations needed to prevent */ int fd = 0; /* Initializations needed to prevent */
@ -1752,8 +1776,9 @@ TclGetDefaultStdChannel(type)
*/ */
void void
TclClosePipeFile(file) TclClosePipeFile(
Tcl_File file; Tcl_File file
)
{ {
int fd = (int) (intptr_t) Tcl_GetFileInfo(file, NULL); int fd = (int) (intptr_t) Tcl_GetFileInfo(file, NULL);
close(fd); close(fd);
@ -1783,17 +1808,18 @@ TclClosePipeFile(file)
*/ */
int int
Tcl_GetOpenFile(interp, string, forWriting, checkUsage, filePtr) Tcl_GetOpenFile(
Tcl_Interp *interp; /* Interpreter in which to find file. */ Tcl_Interp *interp, /* Interpreter in which to find file. */
char *string; /* String that identifies file. */ char *string, /* String that identifies file. */
int forWriting; /* 1 means the file is going to be used int forWriting, /* 1 means the file is going to be used
* for writing, 0 means for reading. */ * for writing, 0 means for reading. */
int checkUsage; /* 1 means verify that the file was opened int checkUsage, /* 1 means verify that the file was opened
* in a mode that allows the access specified * in a mode that allows the access specified
* by "forWriting". Ignored, we always * by "forWriting". Ignored, we always
* check that the channel is open for the * check that the channel is open for the
* requested mode. */ * requested mode. */
ClientData *filePtr; /* Store pointer to FILE structure here. */ ClientData *filePtr /* Store pointer to FILE structure here. */
)
{ {
Tcl_Channel chan; Tcl_Channel chan;
int chanMode; int chanMode;

View file

@ -80,10 +80,11 @@ static void FreeExecutableName _ANSI_ARGS_((ClientData clientData));
*/ */
int int
Tcl_WaitPid(pid, statPtr, options) Tcl_WaitPid(
pid_t pid; pid_t pid,
int *statPtr; int *statPtr,
int options; int options
)
{ {
int result; int result;
pid_t real_pid; pid_t real_pid;
@ -116,8 +117,9 @@ Tcl_WaitPid(pid, statPtr, options)
/* ARGSUSED */ /* ARGSUSED */
static void static void
FreeCurrentDir(clientData) FreeCurrentDir(
ClientData clientData; /* Not used. */ ClientData clientData /* Not used. */
)
{ {
if (currentDir != (char *) NULL) { if (currentDir != (char *) NULL) {
ckfree(currentDir); ckfree(currentDir);
@ -145,8 +147,9 @@ FreeCurrentDir(clientData)
/* ARGSUSED */ /* ARGSUSED */
static void static void
FreeExecutableName(clientData) FreeExecutableName(
ClientData clientData; /* Not used. */ ClientData clientData /* Not used. */
)
{ {
if (tclExecutableName != (char *) NULL) { if (tclExecutableName != (char *) NULL) {
ckfree(tclExecutableName); ckfree(tclExecutableName);
@ -174,9 +177,10 @@ FreeExecutableName(clientData)
*/ */
int int
TclChdir(interp, dirName) TclChdir(
Tcl_Interp *interp; /* If non NULL, used for error reporting. */ Tcl_Interp *interp, /* If non NULL, used for error reporting. */
char *dirName; /* Path to new working directory. */ char *dirName /* Path to new working directory. */
)
{ {
if (currentDir != NULL) { if (currentDir != NULL) {
ckfree(currentDir); ckfree(currentDir);
@ -215,8 +219,9 @@ TclChdir(interp, dirName)
*/ */
char * char *
TclGetCwd(interp) TclGetCwd(
Tcl_Interp *interp; /* If non NULL, used for error reporting. */ Tcl_Interp *interp /* If non NULL, used for error reporting. */
)
{ {
char buffer[MAXPATHLEN+1]; char buffer[MAXPATHLEN+1];
@ -260,9 +265,10 @@ TclGetCwd(interp)
*/ */
Tcl_File Tcl_File
TclOpenFile(fname, mode) TclOpenFile(
char *fname; /* The name of the file to open. */ char *fname, /* The name of the file to open. */
int mode; /* In what mode to open the file? */ int mode /* In what mode to open the file? */
)
{ {
int fd; int fd;
@ -291,8 +297,9 @@ TclOpenFile(fname, mode)
*/ */
int int
TclCloseFile(file) TclCloseFile(
Tcl_File file; /* The file to close. */ Tcl_File file /* The file to close. */
)
{ {
int type; int type;
int fd; int fd;
@ -335,11 +342,12 @@ TclCloseFile(file)
*/ */
/* ARGSUSED */ /* ARGSUSED */
int int
TclReadFile(file, shouldBlock, buf, toRead) TclReadFile(
Tcl_File file; /* The file to read from. */ Tcl_File file, /* The file to read from. */
int shouldBlock; /* Not used. */ int shouldBlock, /* Not used. */
char *buf; /* The buffer to store input in. */ char *buf, /* The buffer to store input in. */
int toRead; /* Number of characters to read. */ int toRead /* Number of characters to read. */
)
{ {
int type, fd; int type, fd;
@ -369,11 +377,12 @@ TclReadFile(file, shouldBlock, buf, toRead)
/* ARGSUSED */ /* ARGSUSED */
int int
TclWriteFile(file, shouldBlock, buf, toWrite) TclWriteFile(
Tcl_File file; /* The file to write to. */ Tcl_File file, /* The file to write to. */
int shouldBlock; /* Not used. */ int shouldBlock, /* Not used. */
char *buf; /* Where output is stored. */ char *buf, /* Where output is stored. */
int toWrite; /* Number of characters to write. */ int toWrite /* Number of characters to write. */
)
{ {
int type, fd; int type, fd;
@ -403,10 +412,11 @@ TclWriteFile(file, shouldBlock, buf, toWrite)
*/ */
int int
TclSeekFile(file, offset, whence) TclSeekFile(
Tcl_File file; /* The file to seek on. */ Tcl_File file, /* The file to seek on. */
int offset; /* How far to seek? */ int offset, /* How far to seek? */
int whence; /* And from where to seek? */ int whence /* And from where to seek? */
)
{ {
int type, fd; int type, fd;
@ -437,8 +447,9 @@ TclSeekFile(file, offset, whence)
*/ */
Tcl_File Tcl_File
TclCreateTempFile(contents) TclCreateTempFile(
char *contents; /* String to write into temp file, or NULL. */ char *contents /* String to write into temp file, or NULL. */
)
{ {
char fileName[L_tmpnam]; char fileName[L_tmpnam];
Tcl_File file; Tcl_File file;
@ -484,8 +495,9 @@ TclCreateTempFile(contents)
*/ */
void void
Tcl_FindExecutable(argv0) Tcl_FindExecutable(
char *argv0; /* The value of the application's argv[0]. */ char *argv0 /* The value of the application's argv[0]. */
)
{ {
char *name, *p, *cwd; char *name, *p, *cwd;
Tcl_DString buffer; Tcl_DString buffer;
@ -612,11 +624,12 @@ Tcl_FindExecutable(argv0)
*/ */
char * char *
TclGetUserHome(name, bufferPtr) TclGetUserHome(
char *name; /* User name to use to find home directory. */ char *name, /* User name to use to find home directory. */
Tcl_DString *bufferPtr; /* May be used to hold result. Must not hold Tcl_DString *bufferPtr /* May be used to hold result. Must not hold
* anything at the time of the call, and need * anything at the time of the call, and need
* not even be initialized. */ * not even be initialized. */
)
{ {
struct passwd *pwPtr; struct passwd *pwPtr;
@ -652,12 +665,13 @@ TclGetUserHome(name, bufferPtr)
*---------------------------------------------------------------------- */ *---------------------------------------------------------------------- */
int int
TclMatchFiles(interp, separators, dirPtr, pattern, tail) TclMatchFiles(
Tcl_Interp *interp; /* Interpreter to receive results. */ Tcl_Interp *interp, /* Interpreter to receive results. */
char *separators; /* Path separators to pass to TclDoGlob. */ char *separators, /* Path separators to pass to TclDoGlob. */
Tcl_DString *dirPtr; /* Contains path to directory to search. */ Tcl_DString *dirPtr, /* Contains path to directory to search. */
char *pattern; /* Pattern to match against. */ char *pattern, /* Pattern to match against. */
char *tail; /* Pointer to end of pattern. */ char *tail /* Pointer to end of pattern. */
)
{ {
char *dirName, *patternEnd = tail; char *dirName, *patternEnd = tail;
char savedChar = 0; /* Initialization needed only to prevent char savedChar = 0; /* Initialization needed only to prevent

View file

@ -106,8 +106,9 @@ init";
*/ */
void void
TclPlatformInit(interp) TclPlatformInit(
Tcl_Interp *interp; Tcl_Interp *interp
)
{ {
#ifndef NO_UNAME #ifndef NO_UNAME
struct utsname name; struct utsname name;
@ -179,8 +180,9 @@ TclPlatformInit(interp)
*/ */
int int
Tcl_Init(interp) Tcl_Init(
Tcl_Interp *interp; /* Interpreter to initialize. */ Tcl_Interp *interp /* Interpreter to initialize. */
)
{ {
return Tcl_Eval(interp, initScript); return Tcl_Eval(interp, initScript);
} }

View file

@ -91,12 +91,13 @@ static int MaskEmpty _ANSI_ARGS_((long *maskPtr));
*/ */
void void
Tcl_WatchFile(file, mask) Tcl_WatchFile(
Tcl_File file; /* Generic file handle for a stream. */ Tcl_File file, /* Generic file handle for a stream. */
int mask; /* OR'ed combination of TCL_READABLE, int mask /* OR'ed combination of TCL_READABLE,
* TCL_WRITABLE, and TCL_EXCEPTION: * TCL_WRITABLE, and TCL_EXCEPTION:
* indicates conditions to wait for * indicates conditions to wait for
* in select. */ * in select. */
)
{ {
int fd, type, index; int fd, type, index;
fd_mask bit; fd_mask bit;
@ -150,11 +151,12 @@ Tcl_WatchFile(file, mask)
*/ */
int int
Tcl_FileReady(file, mask) Tcl_FileReady(
Tcl_File file; /* Generic file handle for a stream. */ Tcl_File file, /* Generic file handle for a stream. */
int mask; /* OR'ed combination of TCL_READABLE, int mask /* OR'ed combination of TCL_READABLE,
* TCL_WRITABLE, and TCL_EXCEPTION: * TCL_WRITABLE, and TCL_EXCEPTION:
* indicates conditions caller cares about. */ * indicates conditions caller cares about. */
)
{ {
int index, result, type, fd; int index, result, type, fd;
fd_mask bit; fd_mask bit;
@ -196,8 +198,9 @@ Tcl_FileReady(file, mask)
*/ */
static int static int
MaskEmpty(maskPtr) MaskEmpty(
long *maskPtr; long *maskPtr
)
{ {
long *runPtr, *tailPtr; long *runPtr, *tailPtr;
int found, sz; int found, sz;
@ -238,12 +241,13 @@ MaskEmpty(maskPtr)
*/ */
int int
Tcl_WaitForEvent(timePtr) Tcl_WaitForEvent(
Tcl_Time *timePtr; /* Specifies the maximum amount of time Tcl_Time *timePtr /* Specifies the maximum amount of time
* that this procedure should block before * that this procedure should block before
* returning. The time is given as an * returning. The time is given as an
* interval, not an absolute wakeup time. * interval, not an absolute wakeup time.
* NULL means block forever. */ * NULL means block forever. */
)
{ {
struct timeval timeout, *timeoutPtr; struct timeval timeout, *timeoutPtr;
int numFound; int numFound;
@ -300,8 +304,9 @@ Tcl_WaitForEvent(timePtr)
*/ */
void void
Tcl_Sleep(ms) Tcl_Sleep(
int ms; /* Number of milliseconds to sleep. */ int ms /* Number of milliseconds to sleep. */
)
{ {
static struct timeval delay; static struct timeval delay;
Tcl_Time before, after; Tcl_Time before, after;

View file

@ -63,7 +63,7 @@ static int SetupStdFile _ANSI_ARGS_((Tcl_File file, int type));
*/ */
static void static void
RestoreSignals() RestoreSignals(void)
{ {
#ifdef SIGABRT #ifdef SIGABRT
signal(SIGABRT, SIG_DFL); signal(SIGABRT, SIG_DFL);
@ -138,9 +138,10 @@ RestoreSignals()
*/ */
static int static int
SetupStdFile(file, type) SetupStdFile(
Tcl_File file; /* File to dup, or NULL. */ Tcl_File file, /* File to dup, or NULL. */
int type; /* One of TCL_STDIN, TCL_STDOUT, TCL_STDERR */ int type /* One of TCL_STDIN, TCL_STDOUT, TCL_STDERR */
)
{ {
Tcl_Channel channel; Tcl_Channel channel;
int fd; int fd;
@ -216,26 +217,26 @@ SetupStdFile(file, type)
*---------------------------------------------------------------------- *----------------------------------------------------------------------
*/ */
int int
TclSpawnPipeline(interp, pidPtr, numPids, argc, argv, inputFile, TclSpawnPipeline(
outputFile, errorFile, intIn, finalOut) Tcl_Interp *interp, /* Interpreter in which to process pipeline. */
Tcl_Interp *interp; /* Interpreter in which to process pipeline. */ pid_t *pidPtr, /* Array of pids which are created. */
pid_t *pidPtr; /* Array of pids which are created. */ int *numPids, /* Number of pids created. */
int *numPids; /* Number of pids created. */ int argc, /* Number of entries in argv. */
int argc; /* Number of entries in argv. */ char **argv, /* Array of strings describing commands in
char **argv; /* Array of strings describing commands in
* pipeline plus I/O redirection with <, * pipeline plus I/O redirection with <,
* <<, >, etc. argv[argc] must be NULL. */ * <<, >, etc. argv[argc] must be NULL. */
Tcl_File inputFile; /* If >=0, gives file id to use as input for Tcl_File inputFile, /* If >=0, gives file id to use as input for
* first process in pipeline (specified via < * first process in pipeline (specified via <
* or <@). */ * or <@). */
Tcl_File outputFile; /* Writable file id for output from last Tcl_File outputFile, /* Writable file id for output from last
* command in pipeline (could be file or * command in pipeline (could be file or
* pipe). NULL means use stdout. */ * pipe). NULL means use stdout. */
Tcl_File errorFile; /* Writable file id for error output from all Tcl_File errorFile, /* Writable file id for error output from all
* commands in the pipeline. NULL means use * commands in the pipeline. NULL means use
* stderr */ * stderr */
char *intIn; /* File name for initial input (for Win32s). */ char *intIn, /* File name for initial input (for Win32s). */
char *finalOut; /* File name for final output (for Win32s). */ char *finalOut /* File name for final output (for Win32s). */
)
{ {
int firstArg, lastArg; int firstArg, lastArg;
pid_t pid; pid_t pid;
@ -435,11 +436,12 @@ error:
*---------------------------------------------------------------------- *----------------------------------------------------------------------
*/ */
int int
TclCreatePipe(readPipe, writePipe) TclCreatePipe(
Tcl_File *readPipe; /* Location to store file handle for Tcl_File *readPipe, /* Location to store file handle for
* read side of pipe. */ * read side of pipe. */
Tcl_File *writePipe; /* Location to store file handle for Tcl_File *writePipe /* Location to store file handle for
* write side of pipe. */ * write side of pipe. */
)
{ {
int pipeIds[2]; int pipeIds[2];
@ -474,15 +476,15 @@ TclCreatePipe(readPipe, writePipe)
*/ */
int int
Tcl_CreatePipeline(interp, argc, argv, pidArrayPtr, inPipePtr, Tcl_CreatePipeline(
outPipePtr, errFilePtr) Tcl_Interp *interp,
Tcl_Interp *interp; int argc,
int argc; char **argv,
char **argv; pid_t **pidArrayPtr,
pid_t **pidArrayPtr; int *inPipePtr,
int *inPipePtr; int *outPipePtr,
int *outPipePtr; int *errFilePtr
int *errFilePtr; )
{ {
Tcl_File inFile, outFile, errFile; Tcl_File inFile, outFile, errFile;
int result; int result;

View file

@ -65,7 +65,7 @@ static int hostnameInited = 0;
*/ */
char * char *
Tcl_GetHostName() Tcl_GetHostName(void)
{ {
struct utsname u; struct utsname u;
struct hostent *hp; struct hostent *hp;

View file

@ -57,7 +57,7 @@
*/ */
unsigned long unsigned long
TclGetSeconds() TclGetSeconds(void)
{ {
return time((time_t *) NULL); return time((time_t *) NULL);
} }
@ -82,7 +82,7 @@ TclGetSeconds()
*/ */
unsigned long unsigned long
TclGetClicks() TclGetClicks(void)
{ {
unsigned long now; unsigned long now;
#ifdef NO_GETTOD #ifdef NO_GETTOD
@ -121,8 +121,9 @@ TclGetClicks()
*/ */
int int
TclGetTimeZone (currentTime) TclGetTimeZone (
unsigned long currentTime; unsigned long currentTime
)
{ {
/* /*
* Determine how a timezone is obtained from "struct tm". If there is no * Determine how a timezone is obtained from "struct tm". If there is no
@ -229,8 +230,9 @@ TclGetTimeZone (currentTime)
*/ */
void void
TclGetTime(timePtr) TclGetTime(
Tcl_Time *timePtr; /* Location to store time information. */ Tcl_Time *timePtr /* Location to store time information. */
)
{ {
struct timeval tv; struct timeval tv;
struct timezone tz; struct timezone tz;

View file

@ -102,23 +102,24 @@ static void SetupAppendBuffer _ANSI_ARGS_((Interp *iPtr,
*/ */
int int
TclFindElement(interp, list, elementPtr, nextPtr, sizePtr, bracePtr) TclFindElement(
Tcl_Interp *interp; /* Interpreter to use for error reporting. Tcl_Interp *interp, /* Interpreter to use for error reporting.
* If NULL, then no error message is left * If NULL, then no error message is left
* after errors. */ * after errors. */
register char *list; /* String containing Tcl list with zero register char *list, /* String containing Tcl list with zero
* or more elements (possibly in braces). */ * or more elements (possibly in braces). */
char **elementPtr; /* Fill in with location of first significant char **elementPtr, /* Fill in with location of first significant
* character in first element of list. */ * character in first element of list. */
char **nextPtr; /* Fill in with location of character just char **nextPtr, /* Fill in with location of character just
* after all white space following end of * after all white space following end of
* argument (i.e. next argument or end of * argument (i.e. next argument or end of
* list). */ * list). */
int *sizePtr; /* If non-zero, fill in with size of int *sizePtr, /* If non-zero, fill in with size of
* element. */ * element. */
int *bracePtr; /* If non-zero fill in with non-zero/zero int *bracePtr /* If non-zero fill in with non-zero/zero
* to indicate that arg was/wasn't * to indicate that arg was/wasn't
* in braces. */ * in braces. */
)
{ {
register char *p; register char *p;
int openBraces = 0; int openBraces = 0;
@ -312,11 +313,12 @@ TclFindElement(interp, list, elementPtr, nextPtr, sizePtr, bracePtr)
*/ */
void void
TclCopyAndCollapse(count, src, dst) TclCopyAndCollapse(
int count; /* Total number of characters to copy int count, /* Total number of characters to copy
* from src. */ * from src. */
register char *src; /* Copy from here... */ register char *src, /* Copy from here... */
register char *dst; /* ... to here. */ register char *dst /* ... to here. */
)
{ {
register char c; register char c;
int numRead; int numRead;
@ -366,14 +368,15 @@ TclCopyAndCollapse(count, src, dst)
*/ */
int int
Tcl_SplitList(interp, list, argcPtr, argvPtr) Tcl_SplitList(
Tcl_Interp *interp; /* Interpreter to use for error reporting. Tcl_Interp *interp, /* Interpreter to use for error reporting.
* If NULL, then no error message is left. */ * If NULL, then no error message is left. */
char *list; /* Pointer to string with list structure. */ char *list, /* Pointer to string with list structure. */
int *argcPtr; /* Pointer to location to fill in with int *argcPtr, /* Pointer to location to fill in with
* the number of elements in the list. */ * the number of elements in the list. */
char ***argvPtr; /* Pointer to place to store pointer to array char ***argvPtr /* Pointer to place to store pointer to array
* of pointers to list elements. */ * of pointers to list elements. */
)
{ {
char **argv; char **argv;
register char *p; register char *p;
@ -455,10 +458,11 @@ Tcl_SplitList(interp, list, argcPtr, argvPtr)
*/ */
int int
Tcl_ScanElement(string, flagPtr) Tcl_ScanElement(
char *string; /* String to convert to Tcl list element. */ char *string, /* String to convert to Tcl list element. */
int *flagPtr; /* Where to store information to guide int *flagPtr /* Where to store information to guide
* Tcl_ConvertElement. */ * Tcl_ConvertElement. */
)
{ {
int flags, nestingLevel; int flags, nestingLevel;
register char *p; register char *p;
@ -577,10 +581,11 @@ Tcl_ScanElement(string, flagPtr)
*/ */
int int
Tcl_ConvertElement(src, dst, flags) Tcl_ConvertElement(
register char *src; /* Source information for list element. */ register char *src, /* Source information for list element. */
char *dst; /* Place to put list-ified element. */ char *dst, /* Place to put list-ified element. */
int flags; /* Flags produced by Tcl_ScanElement. */ int flags /* Flags produced by Tcl_ScanElement. */
)
{ {
register char *p = dst; register char *p = dst;
@ -707,9 +712,10 @@ Tcl_ConvertElement(src, dst, flags)
*/ */
char * char *
Tcl_Merge(argc, argv) Tcl_Merge(
int argc; /* How many strings to merge. */ int argc, /* How many strings to merge. */
char **argv; /* Array of string values. */ char **argv /* Array of string values. */
)
{ {
# define LOCAL_SIZE 20 # define LOCAL_SIZE 20
int localFlags[LOCAL_SIZE], *flagPtr; int localFlags[LOCAL_SIZE], *flagPtr;
@ -776,9 +782,10 @@ Tcl_Merge(argc, argv)
*/ */
char * char *
Tcl_Concat(argc, argv) Tcl_Concat(
int argc; /* Number of strings to concatenate. */ int argc, /* Number of strings to concatenate. */
char **argv; /* Array of strings to concatenate. */ char **argv /* Array of strings to concatenate. */
)
{ {
int totalSize, i; int totalSize, i;
register char *p; register char *p;
@ -847,10 +854,11 @@ Tcl_Concat(argc, argv)
*/ */
int int
Tcl_StringMatch(string, pattern) Tcl_StringMatch(
register char *string; /* String. */ register char *string, /* String. */
register char *pattern; /* Pattern, which may contain register char *pattern /* Pattern, which may contain
* special characters. */ * special characters. */
)
{ {
char c2; char c2;
@ -982,14 +990,15 @@ Tcl_StringMatch(string, pattern)
*/ */
void void
Tcl_SetResult(interp, string, freeProc) Tcl_SetResult(
Tcl_Interp *interp; /* Interpreter with which to associate the Tcl_Interp *interp, /* Interpreter with which to associate the
* return value. */ * return value. */
char *string; /* Value to be returned. If NULL, char *string, /* Value to be returned. If NULL,
* the result is set to an empty string. */ * the result is set to an empty string. */
Tcl_FreeProc *freeProc; /* Gives information about the string: Tcl_FreeProc *freeProc /* Gives information about the string:
* TCL_STATIC, TCL_VOLATILE, or the address * TCL_STATIC, TCL_VOLATILE, or the address
* of a Tcl_FreeProc such as free. */ * of a Tcl_FreeProc such as free. */
)
{ {
register Interp *iPtr = (Interp *) interp; register Interp *iPtr = (Interp *) interp;
int length; int length;
@ -1129,11 +1138,12 @@ Tcl_AppendResult TCL_VARARGS_DEF(Tcl_Interp *,arg1)
*/ */
void void
Tcl_AppendElement(interp, string) Tcl_AppendElement(
Tcl_Interp *interp; /* Interpreter whose result is to be Tcl_Interp *interp, /* Interpreter whose result is to be
* extended. */ * extended. */
char *string; /* String to convert to list element and char *string /* String to convert to list element and
* add to result. */ * add to result. */
)
{ {
register Interp *iPtr = (Interp *) interp; register Interp *iPtr = (Interp *) interp;
int size, flags; int size, flags;
@ -1184,10 +1194,11 @@ Tcl_AppendElement(interp, string)
*/ */
static void static void
SetupAppendBuffer(iPtr, newSpace) SetupAppendBuffer(
register Interp *iPtr; /* Interpreter whose result is being set up. */ register Interp *iPtr, /* Interpreter whose result is being set up. */
int newSpace; /* Make sure that at least this many bytes int newSpace /* Make sure that at least this many bytes
* of new information may be added. */ * of new information may be added. */
)
{ {
int totalSpace; int totalSpace;
@ -1262,8 +1273,9 @@ SetupAppendBuffer(iPtr, newSpace)
*/ */
void void
Tcl_ResetResult(interp) Tcl_ResetResult(
Tcl_Interp *interp; /* Interpreter for which to clear result. */ Tcl_Interp *interp /* Interpreter for which to clear result. */
)
{ {
register Interp *iPtr = (Interp *) interp; register Interp *iPtr = (Interp *) interp;
@ -1348,10 +1360,11 @@ Tcl_SetErrorCode TCL_VARARGS_DEF(Tcl_Interp *,arg1)
*/ */
int int
TclGetListIndex(interp, string, indexPtr) TclGetListIndex(
Tcl_Interp *interp; /* Interpreter for error reporting. */ Tcl_Interp *interp, /* Interpreter for error reporting. */
char *string; /* String containing list index. */ char *string, /* String containing list index. */
int *indexPtr; /* Where to store index. */ int *indexPtr /* Where to store index. */
)
{ {
if (isdigit(UCHAR(*string)) || (*string == '-')) { if (isdigit(UCHAR(*string)) || (*string == '-')) {
if (Tcl_GetInt(interp, string, indexPtr) != TCL_OK) { if (Tcl_GetInt(interp, string, indexPtr) != TCL_OK) {
@ -1397,10 +1410,11 @@ TclGetListIndex(interp, string, indexPtr)
*/ */
Tcl_RegExp Tcl_RegExp
Tcl_RegExpCompile(interp, string) Tcl_RegExpCompile(
Tcl_Interp *interp; /* For use in error reporting. */ Tcl_Interp *interp, /* For use in error reporting. */
char *string; /* String for which to produce char *string /* String for which to produce
* compiled regular expression. */ * compiled regular expression. */
)
{ {
register Interp *iPtr = (Interp *) interp; register Interp *iPtr = (Interp *) interp;
int i, length; int i, length;
@ -1485,15 +1499,16 @@ Tcl_RegExpCompile(interp, string)
*/ */
int int
Tcl_RegExpExec(interp, re, string, start) Tcl_RegExpExec(
Tcl_Interp *interp; /* Interpreter to use for error reporting. */ Tcl_Interp *interp, /* Interpreter to use for error reporting. */
Tcl_RegExp re; /* Compiled regular expression; must have Tcl_RegExp re, /* Compiled regular expression; must have
* been returned by previous call to * been returned by previous call to
* Tcl_RegExpCompile. */ * Tcl_RegExpCompile. */
char *string; /* String against which to match re. */ char *string, /* String against which to match re. */
char *start; /* If string is part of a larger string, char *start /* If string is part of a larger string,
* this identifies beginning of larger * this identifies beginning of larger
* string, so that "^" won't match. */ * string, so that "^" won't match. */
)
{ {
int match; int match;
@ -1529,17 +1544,18 @@ Tcl_RegExpExec(interp, re, string, start)
*/ */
void void
Tcl_RegExpRange(re, index, startPtr, endPtr) Tcl_RegExpRange(
Tcl_RegExp re; /* Compiled regular expression that has Tcl_RegExp re, /* Compiled regular expression that has
* been passed to Tcl_RegExpExec. */ * been passed to Tcl_RegExpExec. */
int index; /* 0 means give the range of the entire int index, /* 0 means give the range of the entire
* match, > 0 means give the range of * match, > 0 means give the range of
* a matching subrange. Must be no greater * a matching subrange. Must be no greater
* than NSUBEXP. */ * than NSUBEXP. */
char **startPtr; /* Store address of first character in char **startPtr, /* Store address of first character in
* (sub-) range here. */ * (sub-) range here. */
char **endPtr; /* Store address of character just after last char **endPtr /* Store address of character just after last
* in (sub-) range here. */ * in (sub-) range here. */
)
{ {
regexp *regexpPtr = (regexp *) re; regexp *regexpPtr = (regexp *) re;
@ -1571,11 +1587,12 @@ Tcl_RegExpRange(re, index, startPtr, endPtr)
*/ */
int int
Tcl_RegExpMatch(interp, string, pattern) Tcl_RegExpMatch(
Tcl_Interp *interp; /* Used for error reporting. */ Tcl_Interp *interp, /* Used for error reporting. */
char *string; /* String. */ char *string, /* String. */
char *pattern; /* Regular expression to match against char *pattern /* Regular expression to match against
* string. */ * string. */
)
{ {
Tcl_RegExp re; Tcl_RegExp re;
@ -1605,9 +1622,10 @@ Tcl_RegExpMatch(interp, string, pattern)
*/ */
void void
Tcl_DStringInit(dsPtr) Tcl_DStringInit(
register Tcl_DString *dsPtr; /* Pointer to structure for register Tcl_DString *dsPtr /* Pointer to structure for
* dynamic string. */ * dynamic string. */
)
{ {
dsPtr->string = dsPtr->staticSpace; dsPtr->string = dsPtr->staticSpace;
dsPtr->length = 0; dsPtr->length = 0;
@ -1634,15 +1652,16 @@ Tcl_DStringInit(dsPtr)
*/ */
char * char *
Tcl_DStringAppend(dsPtr, string, length) Tcl_DStringAppend(
register Tcl_DString *dsPtr; /* Structure describing dynamic register Tcl_DString *dsPtr, /* Structure describing dynamic
* string. */ * string. */
char *string; /* String to append. If length is char *string, /* String to append. If length is
* -1 then this must be * -1 then this must be
* null-terminated. */ * null-terminated. */
int length; /* Number of characters from string int length /* Number of characters from string
* to append. If < 0, then append all * to append. If < 0, then append all
* of string, up to null at end. */ * of string, up to null at end. */
)
{ {
int newSize; int newSize;
char *newString, *dst, *end; char *newString, *dst, *end;
@ -1702,11 +1721,12 @@ Tcl_DStringAppend(dsPtr, string, length)
*/ */
char * char *
Tcl_DStringAppendElement(dsPtr, string) Tcl_DStringAppendElement(
register Tcl_DString *dsPtr; /* Structure describing dynamic register Tcl_DString *dsPtr, /* Structure describing dynamic
* string. */ * string. */
char *string; /* String to append. Must be char *string /* String to append. Must be
* null-terminated. */ * null-terminated. */
)
{ {
int newSize, flags; int newSize, flags;
char *dst, *newString; char *dst, *newString;
@ -1769,10 +1789,11 @@ Tcl_DStringAppendElement(dsPtr, string)
*/ */
void void
Tcl_DStringSetLength(dsPtr, length) Tcl_DStringSetLength(
register Tcl_DString *dsPtr; /* Structure describing dynamic register Tcl_DString *dsPtr, /* Structure describing dynamic
* string. */ * string. */
int length; /* New length for dynamic string. */ int length /* New length for dynamic string. */
)
{ {
if (length < 0) { if (length < 0) {
length = 0; length = 0;
@ -1819,9 +1840,10 @@ Tcl_DStringSetLength(dsPtr, length)
*/ */
void void
Tcl_DStringFree(dsPtr) Tcl_DStringFree(
register Tcl_DString *dsPtr; /* Structure describing dynamic register Tcl_DString *dsPtr /* Structure describing dynamic
* string. */ * string. */
)
{ {
if (dsPtr->string != dsPtr->staticSpace) { if (dsPtr->string != dsPtr->staticSpace) {
ckfree(dsPtr->string); ckfree(dsPtr->string);
@ -1853,11 +1875,12 @@ Tcl_DStringFree(dsPtr)
*/ */
void void
Tcl_DStringResult(interp, dsPtr) Tcl_DStringResult(
Tcl_Interp *interp; /* Interpreter whose result is to be Tcl_Interp *interp, /* Interpreter whose result is to be
* reset. */ * reset. */
Tcl_DString *dsPtr; /* Dynamic string that is to become Tcl_DString *dsPtr /* Dynamic string that is to become
* the result of interp. */ * the result of interp. */
)
{ {
Tcl_ResetResult(interp); Tcl_ResetResult(interp);
if (dsPtr->string != dsPtr->staticSpace) { if (dsPtr->string != dsPtr->staticSpace) {
@ -1894,11 +1917,12 @@ Tcl_DStringResult(interp, dsPtr)
*/ */
void void
Tcl_DStringGetResult(interp, dsPtr) Tcl_DStringGetResult(
Tcl_Interp *interp; /* Interpreter whose result is to be Tcl_Interp *interp, /* Interpreter whose result is to be
* reset. */ * reset. */
Tcl_DString *dsPtr; /* Dynamic string that is to become Tcl_DString *dsPtr /* Dynamic string that is to become
* the result of interp. */ * the result of interp. */
)
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
if (dsPtr->string != dsPtr->staticSpace) { if (dsPtr->string != dsPtr->staticSpace) {
@ -1950,8 +1974,9 @@ Tcl_DStringGetResult(interp, dsPtr)
*/ */
void void
Tcl_DStringStartSublist(dsPtr) Tcl_DStringStartSublist(
Tcl_DString *dsPtr; /* Dynamic string. */ Tcl_DString *dsPtr /* Dynamic string. */
)
{ {
if (TclNeedSpace(dsPtr->string, dsPtr->string + dsPtr->length)) { if (TclNeedSpace(dsPtr->string, dsPtr->string + dsPtr->length)) {
Tcl_DStringAppend(dsPtr, " {", -1); Tcl_DStringAppend(dsPtr, " {", -1);
@ -1980,8 +2005,9 @@ Tcl_DStringStartSublist(dsPtr)
*/ */
void void
Tcl_DStringEndSublist(dsPtr) Tcl_DStringEndSublist(
Tcl_DString *dsPtr; /* Dynamic string. */ Tcl_DString *dsPtr /* Dynamic string. */
)
{ {
Tcl_DStringAppend(dsPtr, "}", -1); Tcl_DStringAppend(dsPtr, "}", -1);
} }
@ -2007,13 +2033,14 @@ Tcl_DStringEndSublist(dsPtr)
*/ */
void void
Tcl_PrintDouble(interp, value, dst) Tcl_PrintDouble(
Tcl_Interp *interp; /* Interpreter whose tcl_precision Tcl_Interp *interp, /* Interpreter whose tcl_precision
* variable controls printing. */ * variable controls printing. */
double value; /* Value to print as string. */ double value, /* Value to print as string. */
char *dst; /* Where to store converted value; char *dst /* Where to store converted value;
* must have at least TCL_DOUBLE_SPACE * must have at least TCL_DOUBLE_SPACE
* characters. */ * characters. */
)
{ {
register char *p; register char *p;
sprintf(dst, ((Interp *) interp)->pdFormat, value); sprintf(dst, ((Interp *) interp)->pdFormat, value);
@ -2056,12 +2083,13 @@ Tcl_PrintDouble(interp, value, dst)
/* ARGSUSED */ /* ARGSUSED */
char * char *
TclPrecTraceProc(clientData, interp, name1, name2, flags) TclPrecTraceProc(
ClientData clientData; /* Not used. */ ClientData clientData, /* Not used. */
Tcl_Interp *interp; /* Interpreter containing variable. */ Tcl_Interp *interp, /* Interpreter containing variable. */
char *name1; /* Name of variable. */ char *name1, /* Name of variable. */
char *name2; /* Second part of variable name. */ char *name2, /* Second part of variable name. */
int flags; /* Information about what happened. */ int flags /* Information about what happened. */
)
{ {
register Interp *iPtr = (Interp *) interp; register Interp *iPtr = (Interp *) interp;
char *value, *end; char *value, *end;
@ -2120,10 +2148,11 @@ TclPrecTraceProc(clientData, interp, name1, name2, flags)
*/ */
int int
TclNeedSpace(start, end) TclNeedSpace(
char *start; /* First character in string. */ char *start, /* First character in string. */
char *end; /* End of string (place where space will char *end /* End of string (place where space will
* be added, if appropriate). */ * be added, if appropriate). */
)
{ {
/* /*
* A space is needed unless either * A space is needed unless either

View file

@ -125,28 +125,29 @@ static void VarErrMsg _ANSI_ARGS_((Tcl_Interp *interp,
*/ */
static Var * static Var *
LookupVar(interp, part1, part2, flags, msg, create, arrayPtrPtr) LookupVar(
Tcl_Interp *interp; /* Interpreter to use for lookup. */ Tcl_Interp *interp, /* Interpreter to use for lookup. */
char *part1; /* If part2 isn't NULL, this is the name char *part1, /* If part2 isn't NULL, this is the name
* of an array. Otherwise, if the * of an array. Otherwise, if the
* PART1_NOT_PARSED flag bit is set this * PART1_NOT_PARSED flag bit is set this
* is a full variable name that could * is a full variable name that could
* include a parenthesized array elemnt. * include a parenthesized array elemnt.
* If PART1_NOT_PARSED isn't present, then * If PART1_NOT_PARSED isn't present, then
* this is the name of a scalar variable. */ * this is the name of a scalar variable. */
char *part2; /* Name of an element within array, or NULL. */ char *part2, /* Name of an element within array, or NULL. */
int flags; /* Only the TCL_GLOBAL_ONLY, TCL_LEAVE_ERR_MSG, int flags, /* Only the TCL_GLOBAL_ONLY, TCL_LEAVE_ERR_MSG,
* and PART1_NOT_PARSED bits matter. */ * and PART1_NOT_PARSED bits matter. */
char *msg; /* Verb to use in error messages, e.g. char *msg, /* Verb to use in error messages, e.g.
* "read" or "set". Only needed if * "read" or "set". Only needed if
* TCL_LEAVE_ERR_MSG is set in flags. */ * TCL_LEAVE_ERR_MSG is set in flags. */
int create; /* OR'ed combination of CRT_PART1 and int create, /* OR'ed combination of CRT_PART1 and
* CRT_PART2. Tells which entries to create * CRT_PART2. Tells which entries to create
* if they don't already exist. */ * if they don't already exist. */
Var **arrayPtrPtr; /* If the name refers to an element of an Var **arrayPtrPtr /* If the name refers to an element of an
* array, *arrayPtrPtr gets filled in with * array, *arrayPtrPtr gets filled in with
* address of array variable. Otherwise * address of array variable. Otherwise
* this is set to NULL. */ * this is set to NULL. */
)
{ {
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
Tcl_HashTable *tablePtr; Tcl_HashTable *tablePtr;
@ -315,12 +316,13 @@ LookupVar(interp, part1, part2, flags, msg, create, arrayPtrPtr)
*/ */
char * char *
Tcl_GetVar(interp, varName, flags) Tcl_GetVar(
Tcl_Interp *interp; /* Command interpreter in which varName is Tcl_Interp *interp, /* Command interpreter in which varName is
* to be looked up. */ * to be looked up. */
char *varName; /* Name of a variable in interp. */ char *varName, /* Name of a variable in interp. */
int flags; /* OR-ed combination of TCL_GLOBAL_ONLY int flags /* OR-ed combination of TCL_GLOBAL_ONLY
* or TCL_LEAVE_ERR_MSG bits. */ * or TCL_LEAVE_ERR_MSG bits. */
)
{ {
return Tcl_GetVar2(interp, varName, (char *) NULL, return Tcl_GetVar2(interp, varName, (char *) NULL,
flags | PART1_NOT_PARSED); flags | PART1_NOT_PARSED);
@ -351,16 +353,17 @@ Tcl_GetVar(interp, varName, flags)
*/ */
char * char *
Tcl_GetVar2(interp, part1, part2, flags) Tcl_GetVar2(
Tcl_Interp *interp; /* Command interpreter in which variable is Tcl_Interp *interp, /* Command interpreter in which variable is
* to be looked up. */ * to be looked up. */
char *part1; /* Name of array (if part2 is NULL) or char *part1, /* Name of array (if part2 is NULL) or
* name of variable. */ * name of variable. */
char *part2; /* If non-null, gives name of element in char *part2, /* If non-null, gives name of element in
* array. */ * array. */
int flags; /* OR-ed combination of TCL_GLOBAL_ONLY, int flags /* OR-ed combination of TCL_GLOBAL_ONLY,
* TCL_LEAVE_ERR_MSG, and PART1_NOT_PARSED * TCL_LEAVE_ERR_MSG, and PART1_NOT_PARSED
* bits. */ * bits. */
)
{ {
Var *varPtr, *arrayPtr; Var *varPtr, *arrayPtr;
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
@ -438,14 +441,15 @@ Tcl_GetVar2(interp, part1, part2, flags)
*/ */
char * char *
Tcl_SetVar(interp, varName, newValue, flags) Tcl_SetVar(
Tcl_Interp *interp; /* Command interpreter in which varName is Tcl_Interp *interp, /* Command interpreter in which varName is
* to be looked up. */ * to be looked up. */
char *varName; /* Name of a variable in interp. */ char *varName, /* Name of a variable in interp. */
char *newValue; /* New value for varName. */ char *newValue, /* New value for varName. */
int flags; /* Various flags that tell how to set value: int flags /* Various flags that tell how to set value:
* any of TCL_GLOBAL_ONLY, TCL_APPEND_VALUE, * any of TCL_GLOBAL_ONLY, TCL_APPEND_VALUE,
* TCL_LIST_ELEMENT, or TCL_LEAVE_ERR_MSG. */ * TCL_LIST_ELEMENT, or TCL_LEAVE_ERR_MSG. */
)
{ {
return Tcl_SetVar2(interp, varName, (char *) NULL, newValue, return Tcl_SetVar2(interp, varName, (char *) NULL, newValue,
flags | PART1_NOT_PARSED); flags | PART1_NOT_PARSED);
@ -477,17 +481,18 @@ Tcl_SetVar(interp, varName, newValue, flags)
*/ */
char * char *
Tcl_SetVar2(interp, part1, part2, newValue, flags) Tcl_SetVar2(
Tcl_Interp *interp; /* Command interpreter in which variable is Tcl_Interp *interp, /* Command interpreter in which variable is
* to be looked up. */ * to be looked up. */
char *part1; /* If part2 is NULL, this is name of scalar char *part1, /* If part2 is NULL, this is name of scalar
* variable. Otherwise it is name of array. */ * variable. Otherwise it is name of array. */
char *part2; /* Name of an element within array, or NULL. */ char *part2, /* Name of an element within array, or NULL. */
char *newValue; /* New value for variable. */ char *newValue, /* New value for variable. */
int flags; /* Various flags that tell how to set value: int flags /* Various flags that tell how to set value:
* any of TCL_GLOBAL_ONLY, TCL_APPEND_VALUE, * any of TCL_GLOBAL_ONLY, TCL_APPEND_VALUE,
* TCL_LIST_ELEMENT, TCL_LEAVE_ERR_MSG, or * TCL_LIST_ELEMENT, TCL_LEAVE_ERR_MSG, or
* PART1_NOT_PARSED. */ * PART1_NOT_PARSED. */
)
{ {
register Var *varPtr; register Var *varPtr;
register Interp *iPtr = (Interp *) interp; register Interp *iPtr = (Interp *) interp;
@ -667,14 +672,15 @@ Tcl_SetVar2(interp, part1, part2, newValue, flags)
*/ */
int int
Tcl_UnsetVar(interp, varName, flags) Tcl_UnsetVar(
Tcl_Interp *interp; /* Command interpreter in which varName is Tcl_Interp *interp, /* Command interpreter in which varName is
* to be looked up. */ * to be looked up. */
char *varName; /* Name of a variable in interp. May be char *varName, /* Name of a variable in interp. May be
* either a scalar name or an array name * either a scalar name or an array name
* or an element in an array. */ * or an element in an array. */
int flags; /* OR-ed combination of any of int flags /* OR-ed combination of any of
* TCL_GLOBAL_ONLY or TCL_LEAVE_ERR_MSG. */ * TCL_GLOBAL_ONLY or TCL_LEAVE_ERR_MSG. */
)
{ {
return Tcl_UnsetVar2(interp, varName, (char *) NULL, return Tcl_UnsetVar2(interp, varName, (char *) NULL,
flags | PART1_NOT_PARSED); flags | PART1_NOT_PARSED);
@ -702,14 +708,15 @@ Tcl_UnsetVar(interp, varName, flags)
*/ */
int int
Tcl_UnsetVar2(interp, part1, part2, flags) Tcl_UnsetVar2(
Tcl_Interp *interp; /* Command interpreter in which varName is Tcl_Interp *interp, /* Command interpreter in which varName is
* to be looked up. */ * to be looked up. */
char *part1; /* Name of variable or array. */ char *part1, /* Name of variable or array. */
char *part2; /* Name of element within array or NULL. */ char *part2, /* Name of element within array or NULL. */
int flags; /* OR-ed combination of any of int flags /* OR-ed combination of any of
* TCL_GLOBAL_ONLY, TCL_LEAVE_ERR_MSG, * TCL_GLOBAL_ONLY, TCL_LEAVE_ERR_MSG,
* or PART1_NOT_PARSED. */ * or PART1_NOT_PARSED. */
)
{ {
Var *varPtr, dummyVar; Var *varPtr, dummyVar;
Interp *iPtr = (Interp *) interp; Interp *iPtr = (Interp *) interp;
@ -828,17 +835,18 @@ Tcl_UnsetVar2(interp, part1, part2, flags)
*/ */
int int
Tcl_TraceVar(interp, varName, flags, proc, clientData) Tcl_TraceVar(
Tcl_Interp *interp; /* Interpreter in which variable is Tcl_Interp *interp, /* Interpreter in which variable is
* to be traced. */ * to be traced. */
char *varName; /* Name of variable; may end with "(index)" char *varName, /* Name of variable; may end with "(index)"
* to signify an array reference. */ * to signify an array reference. */
int flags; /* OR-ed collection of bits, including any int flags, /* OR-ed collection of bits, including any
* of TCL_TRACE_READS, TCL_TRACE_WRITES, * of TCL_TRACE_READS, TCL_TRACE_WRITES,
* TCL_TRACE_UNSETS, and TCL_GLOBAL_ONLY. */ * TCL_TRACE_UNSETS, and TCL_GLOBAL_ONLY. */
Tcl_VarTraceProc *proc; /* Procedure to call when specified ops are Tcl_VarTraceProc *proc, /* Procedure to call when specified ops are
* invoked upon varName. */ * invoked upon varName. */
ClientData clientData; /* Arbitrary argument to pass to proc. */ ClientData clientData /* Arbitrary argument to pass to proc. */
)
{ {
return Tcl_TraceVar2(interp, varName, (char *) NULL, return Tcl_TraceVar2(interp, varName, (char *) NULL,
flags | PART1_NOT_PARSED, proc, clientData); flags | PART1_NOT_PARSED, proc, clientData);
@ -866,20 +874,21 @@ Tcl_TraceVar(interp, varName, flags, proc, clientData)
*/ */
int int
Tcl_TraceVar2(interp, part1, part2, flags, proc, clientData) Tcl_TraceVar2(
Tcl_Interp *interp; /* Interpreter in which variable is Tcl_Interp *interp, /* Interpreter in which variable is
* to be traced. */ * to be traced. */
char *part1; /* Name of scalar variable or array. */ char *part1, /* Name of scalar variable or array. */
char *part2; /* Name of element within array; NULL means char *part2, /* Name of element within array; NULL means
* trace applies to scalar variable or array * trace applies to scalar variable or array
* as-a-whole. */ * as-a-whole. */
int flags; /* OR-ed collection of bits, including any int flags, /* OR-ed collection of bits, including any
* of TCL_TRACE_READS, TCL_TRACE_WRITES, * of TCL_TRACE_READS, TCL_TRACE_WRITES,
* TCL_TRACE_UNSETS, TCL_GLOBAL_ONLY, and * TCL_TRACE_UNSETS, TCL_GLOBAL_ONLY, and
* PART1_NOT_PARSED. */ * PART1_NOT_PARSED. */
Tcl_VarTraceProc *proc; /* Procedure to call when specified ops are Tcl_VarTraceProc *proc, /* Procedure to call when specified ops are
* invoked upon varName. */ * invoked upon varName. */
ClientData clientData; /* Arbitrary argument to pass to proc. */ ClientData clientData /* Arbitrary argument to pass to proc. */
)
{ {
Var *varPtr, *arrayPtr; Var *varPtr, *arrayPtr;
register VarTrace *tracePtr; register VarTrace *tracePtr;
@ -923,16 +932,17 @@ Tcl_TraceVar2(interp, part1, part2, flags, proc, clientData)
*/ */
void void
Tcl_UntraceVar(interp, varName, flags, proc, clientData) Tcl_UntraceVar(
Tcl_Interp *interp; /* Interpreter containing traced variable. */ Tcl_Interp *interp, /* Interpreter containing traced variable. */
char *varName; /* Name of variable; may end with "(index)" char *varName, /* Name of variable; may end with "(index)"
* to signify an array reference. */ * to signify an array reference. */
int flags; /* OR-ed collection of bits describing int flags, /* OR-ed collection of bits describing
* current trace, including any of * current trace, including any of
* TCL_TRACE_READS, TCL_TRACE_WRITES, * TCL_TRACE_READS, TCL_TRACE_WRITES,
* TCL_TRACE_UNSETS, and TCL_GLOBAL_ONLY. */ * TCL_TRACE_UNSETS, and TCL_GLOBAL_ONLY. */
Tcl_VarTraceProc *proc; /* Procedure assocated with trace. */ Tcl_VarTraceProc *proc, /* Procedure assocated with trace. */
ClientData clientData; /* Arbitrary argument to pass to proc. */ ClientData clientData /* Arbitrary argument to pass to proc. */
)
{ {
Tcl_UntraceVar2(interp, varName, (char *) NULL, flags | PART1_NOT_PARSED, Tcl_UntraceVar2(interp, varName, (char *) NULL, flags | PART1_NOT_PARSED,
proc, clientData); proc, clientData);
@ -957,19 +967,20 @@ Tcl_UntraceVar(interp, varName, flags, proc, clientData)
*/ */
void void
Tcl_UntraceVar2(interp, part1, part2, flags, proc, clientData) Tcl_UntraceVar2(
Tcl_Interp *interp; /* Interpreter containing traced variable. */ Tcl_Interp *interp, /* Interpreter containing traced variable. */
char *part1; /* Name of variable or array. */ char *part1, /* Name of variable or array. */
char *part2; /* Name of element within array; NULL means char *part2, /* Name of element within array; NULL means
* trace applies to scalar variable or array * trace applies to scalar variable or array
* as-a-whole. */ * as-a-whole. */
int flags; /* OR-ed collection of bits describing int flags, /* OR-ed collection of bits describing
* current trace, including any of * current trace, including any of
* TCL_TRACE_READS, TCL_TRACE_WRITES, * TCL_TRACE_READS, TCL_TRACE_WRITES,
* TCL_TRACE_UNSETS, TCL_GLOBAL_ONLY, and * TCL_TRACE_UNSETS, TCL_GLOBAL_ONLY, and
* PART1_NOT_PARSED. */ * PART1_NOT_PARSED. */
Tcl_VarTraceProc *proc; /* Procedure assocated with trace. */ Tcl_VarTraceProc *proc, /* Procedure assocated with trace. */
ClientData clientData; /* Arbitrary argument to pass to proc. */ ClientData clientData /* Arbitrary argument to pass to proc. */
)
{ {
register VarTrace *tracePtr; register VarTrace *tracePtr;
VarTrace *prevPtr; VarTrace *prevPtr;
@ -1052,17 +1063,18 @@ Tcl_UntraceVar2(interp, part1, part2, flags, proc, clientData)
*/ */
ClientData ClientData
Tcl_VarTraceInfo(interp, varName, flags, proc, prevClientData) Tcl_VarTraceInfo(
Tcl_Interp *interp; /* Interpreter containing variable. */ Tcl_Interp *interp, /* Interpreter containing variable. */
char *varName; /* Name of variable; may end with "(index)" char *varName, /* Name of variable; may end with "(index)"
* to signify an array reference. */ * to signify an array reference. */
int flags; /* 0 or TCL_GLOBAL_ONLY. */ int flags, /* 0 or TCL_GLOBAL_ONLY. */
Tcl_VarTraceProc *proc; /* Procedure assocated with trace. */ Tcl_VarTraceProc *proc, /* Procedure assocated with trace. */
ClientData prevClientData; /* If non-NULL, gives last value returned ClientData prevClientData /* If non-NULL, gives last value returned
* by this procedure, so this call will * by this procedure, so this call will
* return the next trace after that one. * return the next trace after that one.
* If NULL, this call will return the * If NULL, this call will return the
* first trace. */ * first trace. */
)
{ {
return Tcl_VarTraceInfo2(interp, varName, (char *) NULL, return Tcl_VarTraceInfo2(interp, varName, (char *) NULL,
flags | PART1_NOT_PARSED, proc, prevClientData); flags | PART1_NOT_PARSED, proc, prevClientData);
@ -1086,20 +1098,21 @@ Tcl_VarTraceInfo(interp, varName, flags, proc, prevClientData)
*/ */
ClientData ClientData
Tcl_VarTraceInfo2(interp, part1, part2, flags, proc, prevClientData) Tcl_VarTraceInfo2(
Tcl_Interp *interp; /* Interpreter containing variable. */ Tcl_Interp *interp, /* Interpreter containing variable. */
char *part1; /* Name of variable or array. */ char *part1, /* Name of variable or array. */
char *part2; /* Name of element within array; NULL means char *part2, /* Name of element within array; NULL means
* trace applies to scalar variable or array * trace applies to scalar variable or array
* as-a-whole. */ * as-a-whole. */
int flags; /* OR-ed combination of TCL_GLOBAL_ONLY and int flags, /* OR-ed combination of TCL_GLOBAL_ONLY and
* PART1_NOT_PARSED. */ * PART1_NOT_PARSED. */
Tcl_VarTraceProc *proc; /* Procedure assocated with trace. */ Tcl_VarTraceProc *proc, /* Procedure assocated with trace. */
ClientData prevClientData; /* If non-NULL, gives last value returned ClientData prevClientData /* If non-NULL, gives last value returned
* by this procedure, so this call will * by this procedure, so this call will
* return the next trace after that one. * return the next trace after that one.
* If NULL, this call will return the * If NULL, this call will return the
* first trace. */ * first trace. */
)
{ {
register VarTrace *tracePtr; register VarTrace *tracePtr;
Var *varPtr, *arrayPtr; Var *varPtr, *arrayPtr;
@ -1152,11 +1165,12 @@ Tcl_VarTraceInfo2(interp, part1, part2, flags, proc, prevClientData)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_SetCmd(dummy, interp, argc, argv) Tcl_SetCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
register Tcl_Interp *interp; /* Current interpreter. */ register Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
if (argc == 2) { if (argc == 2) {
char *value; char *value;
@ -1204,11 +1218,12 @@ Tcl_SetCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_UnsetCmd(dummy, interp, argc, argv) Tcl_UnsetCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
register Tcl_Interp *interp; /* Current interpreter. */ register Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int i; int i;
@ -1245,11 +1260,12 @@ Tcl_UnsetCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_AppendCmd(dummy, interp, argc, argv) Tcl_AppendCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
register Tcl_Interp *interp; /* Current interpreter. */ register Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int i; int i;
char *result = NULL; /* (Initialization only needed to keep char *result = NULL; /* (Initialization only needed to keep
@ -1300,11 +1316,12 @@ Tcl_AppendCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_LappendCmd(dummy, interp, argc, argv) Tcl_LappendCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
register Tcl_Interp *interp; /* Current interpreter. */ register Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int i; int i;
char *result = NULL; /* (Initialization only needed to keep char *result = NULL; /* (Initialization only needed to keep
@ -1356,11 +1373,12 @@ Tcl_LappendCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_ArrayCmd(dummy, interp, argc, argv) Tcl_ArrayCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
register Tcl_Interp *interp; /* Current interpreter. */ register Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
int c, notArray; int c, notArray;
size_t length; size_t length;
@ -1674,17 +1692,18 @@ Tcl_ArrayCmd(dummy, interp, argc, argv)
*/ */
static int static int
MakeUpvar(iPtr, framePtr, otherP1, otherP2, myName, flags) MakeUpvar(
Interp *iPtr; /* Interpreter containing variables. Used Interp *iPtr, /* Interpreter containing variables. Used
* for error messages, too. */ * for error messages, too. */
CallFrame *framePtr; /* Call frame containing "other" variable. CallFrame *framePtr, /* Call frame containing "other" variable.
* NULL means use global context. */ * NULL means use global context. */
char *otherP1, *otherP2; /* Two-part name of variable in framePtr. */ char *otherP1, char *otherP2,/* Two-part name of variable in framePtr. */
char *myName; /* Name of variable in local table, which char *myName, /* Name of variable in local table, which
* will refer to otherP1/P2. Must be a * will refer to otherP1/P2. Must be a
* scalar. */ * scalar. */
int flags; /* 0 or TCL_GLOBAL_ONLY: indicates scope of int flags /* 0 or TCL_GLOBAL_ONLY: indicates scope of
* myName. */ * myName. */
)
{ {
Tcl_HashEntry *hPtr; Tcl_HashEntry *hPtr;
Var *otherPtr, *varPtr, *arrayPtr; Var *otherPtr, *varPtr, *arrayPtr;
@ -1774,17 +1793,18 @@ MakeUpvar(iPtr, framePtr, otherP1, otherP2, myName, flags)
*/ */
int int
Tcl_UpVar(interp, frameName, varName, localName, flags) Tcl_UpVar(
Tcl_Interp *interp; /* Command interpreter in which varName is Tcl_Interp *interp, /* Command interpreter in which varName is
* to be looked up. */ * to be looked up. */
char *frameName; /* Name of the frame containing the source char *frameName, /* Name of the frame containing the source
* variable, such as "1" or "#0". */ * variable, such as "1" or "#0". */
char *varName; /* Name of a variable in interp. May be char *varName, /* Name of a variable in interp. May be
* either a scalar name or an element * either a scalar name or an element
* in an array. */ * in an array. */
char *localName; /* Destination variable name. */ char *localName, /* Destination variable name. */
int flags; /* Either 0 or TCL_GLOBAL_ONLY; indicates int flags /* Either 0 or TCL_GLOBAL_ONLY; indicates
* whether localName is local or global. */ * whether localName is local or global. */
)
{ {
int result; int result;
CallFrame *framePtr; CallFrame *framePtr;
@ -1848,14 +1868,15 @@ Tcl_UpVar(interp, frameName, varName, localName, flags)
*/ */
int int
Tcl_UpVar2(interp, frameName, part1, part2, localName, flags) Tcl_UpVar2(
Tcl_Interp *interp; /* Interpreter containing variables. Used Tcl_Interp *interp, /* Interpreter containing variables. Used
* for error messages too. */ * for error messages too. */
char *frameName; /* Name of the frame containing the source char *frameName, /* Name of the frame containing the source
* variable, such as "1" or "#0". */ * variable, such as "1" or "#0". */
char *part1, *part2; /* Two parts of source variable name. */ char *part1, char *part2, /* Two parts of source variable name. */
char *localName; /* Destination variable name. */ char *localName, /* Destination variable name. */
int flags; /* TCL_GLOBAL_ONLY or 0. */ int flags /* TCL_GLOBAL_ONLY or 0. */
)
{ {
int result; int result;
CallFrame *framePtr; CallFrame *framePtr;
@ -1887,11 +1908,12 @@ Tcl_UpVar2(interp, frameName, part1, part2, localName, flags)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_GlobalCmd(dummy, interp, argc, argv) Tcl_GlobalCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
register Interp *iPtr = (Interp *) interp; register Interp *iPtr = (Interp *) interp;
@ -1932,11 +1954,12 @@ Tcl_GlobalCmd(dummy, interp, argc, argv)
/* ARGSUSED */ /* ARGSUSED */
int int
Tcl_UpvarCmd(dummy, interp, argc, argv) Tcl_UpvarCmd(
ClientData dummy; /* Not used. */ ClientData dummy, /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */ Tcl_Interp *interp, /* Current interpreter. */
int argc; /* Number of arguments. */ int argc, /* Number of arguments. */
char **argv; /* Argument strings. */ char **argv /* Argument strings. */
)
{ {
register Interp *iPtr = (Interp *) interp; register Interp *iPtr = (Interp *) interp;
int result; int result;
@ -2030,16 +2053,16 @@ Tcl_UpvarCmd(dummy, interp, argc, argv)
*/ */
static char * static char *
CallTraces(iPtr, arrayPtr, varPtr, part1, part2, flags) CallTraces(
Interp *iPtr; /* Interpreter containing variable. */ Interp *iPtr, /* Interpreter containing variable. */
register Var *arrayPtr; /* Pointer to array variable that register Var *arrayPtr, /* Pointer to array variable that
* contains the variable, or NULL if * contains the variable, or NULL if
* the variable isn't an element of an * the variable isn't an element of an
* array. */ * array. */
Var *varPtr; /* Variable whose traces are to be Var *varPtr, /* Variable whose traces are to be
* invoked. */ * invoked. */
char *part1, *part2; /* Variable's two-part name. */ char *part1, char *part2, /* Variable's two-part name. */
int flags; /* Flags to pass to trace procedures: int flags /* Flags to pass to trace procedures:
* indicates what's happening to * indicates what's happening to
* variable, plus other stuff like * variable, plus other stuff like
* TCL_GLOBAL_ONLY and * TCL_GLOBAL_ONLY and
@ -2047,6 +2070,7 @@ CallTraces(iPtr, arrayPtr, varPtr, part1, part2, flags)
* contain PART1_NOT_PARSEd, which * contain PART1_NOT_PARSEd, which
* should not be passed through * should not be passed through
* to callbacks. */ * to callbacks. */
)
{ {
register VarTrace *tracePtr; register VarTrace *tracePtr;
ActiveVarTrace active; ActiveVarTrace active;
@ -2192,7 +2216,7 @@ CallTraces(iPtr, arrayPtr, varPtr, part1, part2, flags)
*/ */
static Var * static Var *
NewVar() NewVar(void)
{ {
register Var *varPtr; register Var *varPtr;
@ -2228,15 +2252,16 @@ NewVar()
*/ */
static ArraySearch * static ArraySearch *
ParseSearchId(interp, varPtr, varName, string) ParseSearchId(
Tcl_Interp *interp; /* Interpreter containing variable. */ Tcl_Interp *interp, /* Interpreter containing variable. */
Var *varPtr; /* Array variable search is for. */ Var *varPtr, /* Array variable search is for. */
char *varName; /* Name of array variable that search is char *varName, /* Name of array variable that search is
* supposed to be for. */ * supposed to be for. */
char *string; /* String containing id of search. Must have char *string /* String containing id of search. Must have
* form "search-num-var" where "num" is a * form "search-num-var" where "num" is a
* decimal number and "var" is a variable * decimal number and "var" is a variable
* name. */ * name. */
)
{ {
char *end; char *end;
int id; int id;
@ -2296,9 +2321,10 @@ ParseSearchId(interp, varPtr, varName, string)
*/ */
static void static void
DeleteSearches(arrayVarPtr) DeleteSearches(
register Var *arrayVarPtr; /* Variable whose searches are register Var *arrayVarPtr /* Variable whose searches are
* to be deleted. */ * to be deleted. */
)
{ {
ArraySearch *searchPtr; ArraySearch *searchPtr;
@ -2331,10 +2357,11 @@ DeleteSearches(arrayVarPtr)
*/ */
void void
TclDeleteVars(iPtr, tablePtr) TclDeleteVars(
Interp *iPtr; /* Interpreter to which variables belong. */ Interp *iPtr, /* Interpreter to which variables belong. */
Tcl_HashTable *tablePtr; /* Hash table containing variables to Tcl_HashTable *tablePtr /* Hash table containing variables to
* delete. */ * delete. */
)
{ {
Tcl_HashSearch search; Tcl_HashSearch search;
Tcl_HashEntry *hPtr; Tcl_HashEntry *hPtr;
@ -2454,15 +2481,16 @@ TclDeleteVars(iPtr, tablePtr)
*/ */
static void static void
DeleteArray(iPtr, arrayName, varPtr, flags) DeleteArray(
Interp *iPtr; /* Interpreter containing array. */ Interp *iPtr, /* Interpreter containing array. */
char *arrayName; /* Name of array (used for trace char *arrayName, /* Name of array (used for trace
* callbacks). */ * callbacks). */
Var *varPtr; /* Pointer to variable structure. */ Var *varPtr, /* Pointer to variable structure. */
int flags; /* Flags to pass to CallTraces: int flags /* Flags to pass to CallTraces:
* TCL_TRACE_UNSETS and sometimes * TCL_TRACE_UNSETS and sometimes
* TCL_INTERP_DESTROYED and/or * TCL_INTERP_DESTROYED and/or
* TCL_GLOBAL_ONLY. */ * TCL_GLOBAL_ONLY. */
)
{ {
Tcl_HashSearch search; Tcl_HashSearch search;
register Tcl_HashEntry *hPtr; register Tcl_HashEntry *hPtr;
@ -2536,12 +2564,13 @@ DeleteArray(iPtr, arrayName, varPtr, flags)
*/ */
static void static void
CleanupVar(varPtr, arrayPtr) CleanupVar(
Var *varPtr; /* Pointer to variable that may be a Var *varPtr, /* Pointer to variable that may be a
* candidate for being expunged. */ * candidate for being expunged. */
Var *arrayPtr; /* Array that contains the variable, or Var *arrayPtr /* Array that contains the variable, or
* NULL if this variable isn't an array * NULL if this variable isn't an array
* element. */ * element. */
)
{ {
if ((varPtr->flags & VAR_UNDEFINED) && (varPtr->refCount == 0) if ((varPtr->flags & VAR_UNDEFINED) && (varPtr->refCount == 0)
&& (varPtr->tracePtr == NULL)) { && (varPtr->tracePtr == NULL)) {
@ -2582,12 +2611,13 @@ CleanupVar(varPtr, arrayPtr)
*/ */
static void static void
VarErrMsg(interp, part1, part2, operation, reason) VarErrMsg(
Tcl_Interp *interp; /* Interpreter in which to record message. */ Tcl_Interp *interp, /* Interpreter in which to record message. */
char *part1, *part2; /* Variable's two-part name. */ char *part1, char *part2, /* Variable's two-part name. */
char *operation; /* String describing operation that failed, char *operation, /* String describing operation that failed,
* e.g. "read", "set", or "unset". */ * e.g. "read", "set", or "unset". */
char *reason; /* String describing why operation failed. */ char *reason /* String describing why operation failed. */
)
{ {
Tcl_ResetResult(interp); Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "can't ", operation, " \"", part1, (char *) NULL); Tcl_AppendResult(interp, "can't ", operation, " \"", part1, (char *) NULL);

View file

@ -26,7 +26,7 @@
#include "XlationSvc.h" #include "XlationSvc.h"
int int
main() main(void)
{ {
_DtXlateDb myDb = NULL; _DtXlateDb myDb = NULL;
char myPlatform[_DtPLATFORM_MAX_LEN+1]; char myPlatform[_DtPLATFORM_MAX_LEN+1];