diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tcl.decls | 74 | ||||
-rw-r--r-- | generic/tcl.h | 33 | ||||
-rw-r--r-- | generic/tclBasic.c | 63 | ||||
-rw-r--r-- | generic/tclCmdAH.c | 20 | ||||
-rw-r--r-- | generic/tclCmdMZ.c | 14 | ||||
-rw-r--r-- | generic/tclEncoding.c | 91 | ||||
-rw-r--r-- | generic/tclEvent.c | 6 | ||||
-rw-r--r-- | generic/tclFCmd.c | 23 | ||||
-rw-r--r-- | generic/tclFileName.c | 36 | ||||
-rw-r--r-- | generic/tclIO.c | 93 | ||||
-rw-r--r-- | generic/tclIOCmd.c | 66 | ||||
-rw-r--r-- | generic/tclIOGT.c | 22 | ||||
-rw-r--r-- | generic/tclIOUtil.c | 34 | ||||
-rw-r--r-- | generic/tclInt.decls | 98 | ||||
-rw-r--r-- | generic/tclInterp.c | 169 | ||||
-rw-r--r-- | generic/tclLoad.c | 16 | ||||
-rw-r--r-- | generic/tclLoadNone.c | 6 | ||||
-rw-r--r-- | generic/tclMain.c | 13 | ||||
-rw-r--r-- | generic/tclPipe.c | 13 | ||||
-rw-r--r-- | generic/tclStubInit.c | 358 | ||||
-rw-r--r-- | generic/tclUtil.c | 12 |
21 files changed, 1135 insertions, 125 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls index fe85d31..de18321 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: tcl.decls,v 1.33.2.2 2001/08/28 00:12:43 hobbs Exp $ +# RCS: @(#) $Id: tcl.decls,v 1.33.2.2.2.1 2001/11/28 17:58:35 andreas_kupries Exp $ library tcl @@ -60,11 +60,11 @@ declare 8 generic { # but they are part of the old generic interface, so we include them here for # compatibility reasons. -declare 9 unix { +declare 9 unix {TCL_NO_FILEEVENTS} { void Tcl_CreateFileHandler(int fd, int mask, Tcl_FileProc *proc, \ ClientData clientData) } -declare 10 unix { +declare 10 unix {TCL_NO_FILEEVENTS} { void Tcl_DeleteFileHandler(int fd) } @@ -310,11 +310,11 @@ declare 85 generic { int Tcl_ConvertCountedElement(CONST char *src, int length, char *dst, \ int flags) } -declare 86 generic { +declare 86 generic {TCL_NO_CMDALIASES} { int Tcl_CreateAlias(Tcl_Interp *slave, char *slaveCmd, \ Tcl_Interp *target, char *targetCmd, int argc, char **argv) } -declare 87 generic { +declare 87 generic {TCL_NO_CMDALIASES} { int Tcl_CreateAliasObj(Tcl_Interp *slave, char *slaveCmd, \ Tcl_Interp *target, char *targetCmd, int objc, \ Tcl_Obj *CONST objv[]) @@ -323,7 +323,7 @@ declare 88 generic { Tcl_Channel Tcl_CreateChannel(Tcl_ChannelType *typePtr, char *chanName, \ ClientData instanceData, int mask) } -declare 89 generic { +declare 89 generic {TCL_NO_FILEEVENTS} { void Tcl_CreateChannelHandler(Tcl_Channel chan, int mask, \ Tcl_ChannelProc *proc, ClientData clientData) } @@ -355,7 +355,7 @@ declare 96 generic { Tcl_ObjCmdProc *proc, ClientData clientData, \ Tcl_CmdDeleteProc *deleteProc) } -declare 97 generic { +declare 97 generic {TCL_NO_SLAVEINTERP} { Tcl_Interp * Tcl_CreateSlave(Tcl_Interp *interp, char *slaveName, \ int isSafe) } @@ -370,7 +370,7 @@ declare 99 generic { declare 100 generic { void Tcl_DeleteAssocData(Tcl_Interp *interp, char *name) } -declare 101 generic { +declare 101 generic {TCL_NO_FILEEVENTS} { void Tcl_DeleteChannelHandler(Tcl_Channel chan, Tcl_ChannelProc *proc, \ ClientData clientData) } @@ -403,7 +403,7 @@ declare 109 generic { declare 110 generic { void Tcl_DeleteInterp(Tcl_Interp *interp) } -declare 111 {unix win} { +declare 111 {unix win} {TCL_NO_PIPES} { void Tcl_DetachPids(int numPids, Tcl_Pid *pidPtr) } declare 112 generic { @@ -461,7 +461,7 @@ declare 128 generic { declare 129 generic { int Tcl_Eval(Tcl_Interp *interp, char *string) } -declare 130 generic { +declare 130 generic {TCL_NO_FILESYSTEM TCL_NO_NONSTDCHAN} { int Tcl_EvalFile(Tcl_Interp *interp, char *fileName) } declare 131 generic { @@ -518,12 +518,12 @@ declare 146 generic { declare 147 generic { void Tcl_FreeResult(Tcl_Interp *interp) } -declare 148 generic { +declare 148 generic {TCL_NO_CMDALIASES} { int Tcl_GetAlias(Tcl_Interp *interp, char *slaveCmd, \ Tcl_Interp **targetInterpPtr, char **targetCmdPtr, int *argcPtr, \ char ***argvPtr) } -declare 149 generic { +declare 149 generic {TCL_NO_CMDALIASES} { int Tcl_GetAliasObj(Tcl_Interp *interp, char *slaveCmd, \ Tcl_Interp **targetInterpPtr, char **targetCmdPtr, int *objcPtr, \ Tcl_Obj ***objv) @@ -552,7 +552,7 @@ declare 155 generic { declare 156 generic { char * Tcl_GetChannelName(Tcl_Channel chan) } -declare 157 generic { +declare 157 generic {TCL_NO_CHANNEL_CONFIG} { int Tcl_GetChannelOption(Tcl_Interp *interp, Tcl_Channel chan, \ char *optionName, Tcl_DString *dsPtr) } @@ -572,10 +572,10 @@ declare 161 generic { declare 162 generic { char * Tcl_GetHostName(void) } -declare 163 generic { +declare 163 generic {{TCL_NO_SLAVEINTERP TCL_NO_CMDALIASES}} { int Tcl_GetInterpPath(Tcl_Interp *askInterp, Tcl_Interp *slaveInterp) } -declare 164 generic { +declare 164 generic {{TCL_NO_SLAVEINTERP TCL_NO_CMDALIASES}} { Tcl_Interp * Tcl_GetMaster(Tcl_Interp *interp) } declare 165 generic { @@ -593,7 +593,7 @@ declare 167 unix { int checkUsage, ClientData *filePtr) } -declare 168 generic { +declare 168 generic {TCL_NO_FILESYSTEM} { Tcl_PathType Tcl_GetPathType(char *path) } declare 169 generic { @@ -605,7 +605,7 @@ declare 170 generic { declare 171 generic { int Tcl_GetServiceMode(void) } -declare 172 generic { +declare 172 generic {{TCL_NO_SLAVEINTERP TCL_NO_CMDALIASES}} { Tcl_Interp * Tcl_GetSlave(Tcl_Interp *interp, char *slaveName) } declare 173 generic { @@ -648,7 +648,7 @@ declare 184 generic { declare 185 generic { int Tcl_IsSafe(Tcl_Interp *interp) } -declare 186 generic { +declare 186 generic {TCL_NO_FILESYSTEM} { char * Tcl_JoinPath(int argc, char **argv, Tcl_DString *resultPtr) } declare 187 generic { @@ -666,7 +666,7 @@ declare 189 generic { declare 190 generic { int Tcl_MakeSafe(Tcl_Interp *interp) } -declare 191 generic { +declare 191 generic {TCL_NO_SOCKETS} { Tcl_Channel Tcl_MakeTcpClientChannel(ClientData tcpSocket) } declare 192 generic { @@ -675,7 +675,7 @@ declare 192 generic { declare 193 generic { Tcl_HashEntry * Tcl_NextHashEntry(Tcl_HashSearch *searchPtr) } -declare 194 generic { +declare 194 generic {TCL_NO_FILEEVENTS} { void Tcl_NotifyChannel(Tcl_Channel channel, int mask) } declare 195 generic { @@ -686,19 +686,19 @@ declare 196 generic { Tcl_Obj * Tcl_ObjSetVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, \ Tcl_Obj *part2Ptr, Tcl_Obj *newValuePtr, int flags) } -declare 197 {unix win} { +declare 197 {unix win} {TCL_NO_FILESYSTEM TCL_NO_PIPES} { Tcl_Channel Tcl_OpenCommandChannel(Tcl_Interp *interp, int argc, \ char **argv, int flags) } -declare 198 generic { +declare 198 generic {TCL_NO_FILESYSTEM TCL_NO_FILEEVENTS} { Tcl_Channel Tcl_OpenFileChannel(Tcl_Interp *interp, char *fileName, \ char *modeString, int permissions) } -declare 199 generic { +declare 199 generic {TCL_NO_SOCKETS} { Tcl_Channel Tcl_OpenTcpClient(Tcl_Interp *interp, int port, \ char *address, char *myaddr, int myport, int async) } -declare 200 generic { +declare 200 generic {TCL_NO_SOCKETS TCL_NO_FILEEVENTS} { Tcl_Channel Tcl_OpenTcpServer(Tcl_Interp *interp, int port, char *host, \ Tcl_TcpAcceptProc *acceptProc, ClientData callbackData) } @@ -720,7 +720,7 @@ declare 205 generic { declare 206 generic { int Tcl_Read(Tcl_Channel chan, char *bufPtr, int toRead) } -declare 207 {unix win} { +declare 207 {unix win} {TCL_NO_PIPES} { void Tcl_ReapDetachedProcs(void) } declare 208 generic { @@ -729,7 +729,7 @@ declare 208 generic { declare 209 generic { int Tcl_RecordAndEvalObj(Tcl_Interp *interp, Tcl_Obj *cmdPtr, int flags) } -declare 210 generic { +declare 210 generic {TCL_NO_NONSTDCHAN} { void Tcl_RegisterChannel(Tcl_Interp *interp, Tcl_Channel chan) } declare 211 generic { @@ -761,7 +761,7 @@ declare 218 generic { declare 219 generic { int Tcl_ScanCountedElement(CONST char *str, int length, int *flagPtr) } -declare 220 generic { +declare 220 generic {TCL_NO_NONSTDCHAN} { int Tcl_Seek(Tcl_Channel chan, int offset, int mode) } declare 221 generic { @@ -837,7 +837,7 @@ declare 242 generic { int Tcl_SplitList(Tcl_Interp *interp, CONST char *listStr, int *argcPtr, \ char ***argvPtr) } -declare 243 generic { +declare 243 generic {TCL_NO_FILESYSTEM} { void Tcl_SplitPath(CONST char *path, int *argcPtr, char ***argvPtr) } declare 244 generic { @@ -858,7 +858,7 @@ declare 248 generic { int Tcl_TraceVar2(Tcl_Interp *interp, char *part1, char *part2, \ int flags, Tcl_VarTraceProc *proc, ClientData clientData) } -declare 249 generic { +declare 249 generic {TCL_NO_FILESYSTEM} { char * Tcl_TranslateFileName(Tcl_Interp *interp, char *name, \ Tcl_DString *bufferPtr) } @@ -954,7 +954,7 @@ declare 275 generic { declare 276 generic { int Tcl_VarEvalVA(Tcl_Interp *interp, va_list argList) } -declare 277 generic { +declare 277 generic {TCL_NO_PIPES} { Tcl_Pid Tcl_WaitPid(Tcl_Pid pid, int *statPtr, int options) } declare 278 {unix win} { @@ -1094,7 +1094,7 @@ declare 311 generic { declare 312 generic { int Tcl_NumUtfChars(CONST char *src, int len) } -declare 313 generic { +declare 313 generic {{TCL_NO_CHANNEL_READ TCL_NO_PIPES}} { int Tcl_ReadChars(Tcl_Channel channel, Tcl_Obj *objPtr, int charsToRead, \ int appendFlag) } @@ -1185,10 +1185,10 @@ declare 339 generic { declare 340 generic { char * Tcl_GetString(Tcl_Obj *objPtr) } -declare 341 generic { +declare 341 generic {TCL_NO_FILESYSTEM} { char * Tcl_GetDefaultEncodingDir(void) } -declare 342 generic { +declare 342 generic {TCL_NO_FILESYSTEM} { void Tcl_SetDefaultEncodingDir(char *path) } declare 343 generic { @@ -1268,16 +1268,16 @@ declare 364 generic { int Tcl_ParseVarName (Tcl_Interp *interp, char *string, \ int numBytes, Tcl_Parse *parsePtr, int append) } -declare 365 generic { +declare 365 generic {TCL_NO_FILESYSTEM} { char *Tcl_GetCwd(Tcl_Interp *interp, Tcl_DString *cwdPtr) } -declare 366 generic { +declare 366 generic {TCL_NO_FILESYSTEM} { int Tcl_Chdir(CONST char *dirName) } -declare 367 generic { +declare 367 generic {TCL_NO_FILESYSTEM} { int Tcl_Access(CONST char *path, int mode) } -declare 368 generic { +declare 368 generic {TCL_NO_FILESYSTEM} { int Tcl_Stat(CONST char *path, struct stat *bufPtr) } declare 369 generic { diff --git a/generic/tcl.h b/generic/tcl.h index 357bdbb..c662d08 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tcl.h,v 1.70.2.9 2001/10/17 19:29:24 das Exp $ + * RCS: @(#) $Id: tcl.h,v 1.70.2.9.2.1 2001/11/28 17:58:35 andreas_kupries Exp $ */ #ifndef _TCL @@ -25,7 +25,36 @@ #ifdef __cplusplus extern "C" { #endif - + +/* The following are + * - a clause to activate all macros cutting features out of the core. + * - feature dependencies + */ + +#ifdef MODULAR_TCL +#define TCL_NO_SOCKETS /* Disable "tcp" channel driver */ +#define TCL_NO_TTY /* Disable "tty" channel driver */ +#define TCL_NO_PIPES /* Disable "pipe" channel driver */ +#define TCL_NO_PIDCMD /* Disable "pid" command */ +#define TCL_NO_NONSTDCHAN /* Disable creation of channels beyond std* */ +#define TCL_NO_CHANNELCOPY /* Disable channel copying, C/Tcl [fcopy] */ +#define TCL_NO_CHANNEL_READ /* Disable Tcl_ReadChars, [read] */ +#define TCL_NO_CHANNEL_EOF /* Disable [eof] */ +#define TCL_NO_CHANNEL_CONFIG /* Disable [fconfigure] and Tcl_GetChannelOption */ +#define TCL_NO_CHANNEL_BLOCKED /* Disable [fblocked] */ +#define TCL_NO_FILEEVENTS /* Disable [fileevent] and underlying APIs */ +#define TCL_NO_FILESYSTEM /* Disable everything related to the filesystem */ +#define TCL_NO_LOADCMD /* Disable [load] and machinery below */ +#define TCL_NO_SLAVEINTERP /* No slave interp's */ +#define TCL_NO_CMDALIASES /* No command aliases */ +#endif + +#ifdef TCL_NO_NONSTDCHAN +#define TCL_NO_SOCKETS /* Disable "tcp" channel driver */ +#define TCL_NO_TTY /* Disable "tty" channel driver */ +#define TCL_NO_PIPES /* Disable "pipe" channel driver */ +#endif + /* * The following defines are used to indicate the various release levels. */ diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 9a73e94..7938399 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBasic.c,v 1.27 2000/04/15 17:34:09 hobbs Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.27.6.1 2001/11/28 17:58:35 andreas_kupries Exp $ */ #include "tclInt.h" @@ -89,10 +89,14 @@ static CmdInfo builtInCmds[] = { (CompileProc *) NULL, 0}, {"expr", (Tcl_CmdProc *) NULL, Tcl_ExprObjCmd, TclCompileExprCmd, 1}, +#ifndef TCL_NO_CHANNELCOPY {"fcopy", (Tcl_CmdProc *) NULL, Tcl_FcopyObjCmd, (CompileProc *) NULL, 1}, +#endif +#ifndef TCL_NO_FILEEVENTS {"fileevent", (Tcl_CmdProc *) NULL, Tcl_FileEventObjCmd, (CompileProc *) NULL, 1}, +#endif {"for", (Tcl_CmdProc *) NULL, Tcl_ForObjCmd, TclCompileForCmd, 1}, {"foreach", (Tcl_CmdProc *) NULL, Tcl_ForeachObjCmd, @@ -119,8 +123,12 @@ static CmdInfo builtInCmds[] = { (CompileProc *) NULL, 1}, {"llength", (Tcl_CmdProc *) NULL, Tcl_LlengthObjCmd, (CompileProc *) NULL, 1}, +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_LOADCMD {"load", (Tcl_CmdProc *) NULL, Tcl_LoadObjCmd, (CompileProc *) NULL, 0}, +#endif +#endif {"lrange", (Tcl_CmdProc *) NULL, Tcl_LrangeObjCmd, (CompileProc *) NULL, 1}, {"lreplace", (Tcl_CmdProc *) NULL, Tcl_LreplaceObjCmd, @@ -175,38 +183,66 @@ static CmdInfo builtInCmds[] = { #ifndef TCL_GENERIC_ONLY {"after", (Tcl_CmdProc *) NULL, Tcl_AfterObjCmd, (CompileProc *) NULL, 1}, +#ifndef TCL_NO_FILESYSTEM {"cd", (Tcl_CmdProc *) NULL, Tcl_CdObjCmd, (CompileProc *) NULL, 0}, +#endif +#ifndef TCL_NO_NONSTDCHAN {"close", (Tcl_CmdProc *) NULL, Tcl_CloseObjCmd, (CompileProc *) NULL, 1}, +#endif +#ifndef TCL_NO_CHANNEL_EOF {"eof", (Tcl_CmdProc *) NULL, Tcl_EofObjCmd, (CompileProc *) NULL, 1}, +#endif +#ifndef TCL_NO_CHANNEL_BLOCKED {"fblocked", (Tcl_CmdProc *) NULL, Tcl_FblockedObjCmd, (CompileProc *) NULL, 1}, +#endif +#ifndef TCL_NO_CHANNEL_CONFIG {"fconfigure", (Tcl_CmdProc *) NULL, Tcl_FconfigureObjCmd, (CompileProc *) NULL, 0}, +#endif +#ifndef TCL_NO_FILESYSTEM {"file", (Tcl_CmdProc *) NULL, Tcl_FileObjCmd, (CompileProc *) NULL, 0}, +#endif {"flush", (Tcl_CmdProc *) NULL, Tcl_FlushObjCmd, (CompileProc *) NULL, 1}, {"gets", (Tcl_CmdProc *) NULL, Tcl_GetsObjCmd, (CompileProc *) NULL, 1}, +#ifndef TCL_NO_FILESYSTEM {"glob", (Tcl_CmdProc *) NULL, Tcl_GlobObjCmd, (CompileProc *) NULL, 0}, +#endif +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN {"open", (Tcl_CmdProc *) NULL, Tcl_OpenObjCmd, (CompileProc *) NULL, 0}, +#endif +#endif +#ifndef TCL_NO_PIDCMD {"pid", (Tcl_CmdProc *) NULL, Tcl_PidObjCmd, (CompileProc *) NULL, 1}, +#endif {"puts", (Tcl_CmdProc *) NULL, Tcl_PutsObjCmd, (CompileProc *) NULL, 1}, +#ifndef TCL_NO_FILESYSTEM {"pwd", (Tcl_CmdProc *) NULL, Tcl_PwdObjCmd, (CompileProc *) NULL, 0}, +#endif +#ifndef TCL_NO_CHANNEL_READ {"read", (Tcl_CmdProc *) NULL, Tcl_ReadObjCmd, (CompileProc *) NULL, 1}, +#endif +#ifndef TCL_NO_NONSTDCHAN {"seek", (Tcl_CmdProc *) NULL, Tcl_SeekObjCmd, (CompileProc *) NULL, 1}, +#endif +#ifndef TCL_NO_SOCKETS {"socket", (Tcl_CmdProc *) NULL, Tcl_SocketObjCmd, (CompileProc *) NULL, 0}, +#endif {"tell", (Tcl_CmdProc *) NULL, Tcl_TellObjCmd, (CompileProc *) NULL, 1}, {"time", (Tcl_CmdProc *) NULL, Tcl_TimeObjCmd, @@ -225,13 +261,29 @@ static CmdInfo builtInCmds[] = { (CompileProc *) NULL, 0}, {"resource", (Tcl_CmdProc *) NULL, Tcl_ResourceObjCmd, (CompileProc *) NULL, 1}, +#ifndef TCL_NO_FILESYSTEM {"source", (Tcl_CmdProc *) NULL, Tcl_MacSourceObjCmd, (CompileProc *) NULL, 0}, +#endif #else +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_PIPES {"exec", (Tcl_CmdProc *) NULL, Tcl_ExecObjCmd, (CompileProc *) NULL, 0}, +#endif +#endif +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN + /* IOS FIXME : in the generic case this functionality can be made + * available, it just has to read the file directly instead of using + * the channel system. This makes the code platform dependent. + * + * => See Tcl_EvalFile + */ {"source", (Tcl_CmdProc *) NULL, Tcl_SourceObjCmd, (CompileProc *) NULL, 0}, +#endif +#endif /* TCL_NO_FILESYSTEM */ #endif /* MAC_TCL */ #endif /* TCL_GENERIC_ONLY */ @@ -475,11 +527,13 @@ Tcl_CreateInterp() } iPtr->flags |= EXPR_INITIALIZED; +#if !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) /* * Do Multiple/Safe Interps Tcl init stuff */ TclInterpInit(interp); +#endif /* !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) */ /* * We used to create the "errorInfo" and "errorCode" global vars at this @@ -1891,7 +1945,10 @@ TclRenameCommand(interp, oldName, newName) Tcl_Command cmd; Command *cmdPtr; Tcl_HashEntry *hPtr, *oldHPtr; - int new, result; + int new; +#ifndef TCL_NO_CMDALIASES + int result; +#endif /* * Find the existing command. An error is returned if cmdName can't @@ -1962,6 +2019,7 @@ TclRenameCommand(interp, oldName, newName) cmdPtr->nsPtr = newNsPtr; TclResetShadowedCmdRefs(interp, cmdPtr); +#ifndef TCL_NO_CMDALIASES /* * Now check for an alias loop. If we detect one, put everything back * the way it was and report the error. @@ -1974,6 +2032,7 @@ TclRenameCommand(interp, oldName, newName) cmdPtr->nsPtr = cmdNsPtr; return result; } +#endif /* * The new command name is okay, so remove the command from its diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 370d545..5df1b08 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdAH.c,v 1.12.2.2 2001/10/17 19:29:24 das Exp $ + * RCS: @(#) $Id: tclCmdAH.c,v 1.12.2.2.2.1 2001/11/28 17:58:35 andreas_kupries Exp $ */ #include "tclInt.h" @@ -27,6 +27,7 @@ typedef int (StatProc)_ANSI_ARGS_((CONST char *path, struct stat *buf)); * Prototypes for local procedures defined in this file: */ +#ifndef TCL_NO_FILESYSTEM static int CheckAccess _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr, int mode)); static int GetStatBuf _ANSI_ARGS_((Tcl_Interp *interp, @@ -39,6 +40,7 @@ static int StoreStatData _ANSI_ARGS_((Tcl_Interp *interp, char *varName, struct stat *statPtr)); static char ** StringifyObjects _ANSI_ARGS_((int objc, Tcl_Obj *CONST objv[])); +#endif /* *---------------------------------------------------------------------- @@ -302,6 +304,7 @@ Tcl_CatchObjCmd(dummy, interp, objc, objv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM /* ARGSUSED */ int Tcl_CdObjCmd(dummy, interp, objc, objv) @@ -338,6 +341,7 @@ Tcl_CdObjCmd(dummy, interp, objc, objv) } return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -778,6 +782,7 @@ Tcl_ExprObjCmd(dummy, interp, objc, objv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM /* ARGSUSED */ int Tcl_FileObjCmd(dummy, interp, objc, objv) @@ -1305,6 +1310,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv) Tcl_WrongNumArgs(interp, 2, objv, "name"); return TCL_ERROR; } +#endif /* *--------------------------------------------------------------------------- @@ -1331,6 +1337,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int SplitPath(interp, objPtr, argcPtr, argvPtr) Tcl_Interp *interp; /* Interp for error return. May be NULL. */ @@ -1362,6 +1369,7 @@ SplitPath(interp, objPtr, argcPtr, argvPtr) } return TCL_OK; } +#endif /* *--------------------------------------------------------------------------- @@ -1381,6 +1389,7 @@ SplitPath(interp, objPtr, argcPtr, argvPtr) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int CheckAccess(interp, objPtr, mode) Tcl_Interp *interp; /* Interp for status return. Must not be @@ -1405,6 +1414,7 @@ CheckAccess(interp, objPtr, mode) return TCL_OK; } +#endif /* *--------------------------------------------------------------------------- @@ -1426,6 +1436,7 @@ CheckAccess(interp, objPtr, mode) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int GetStatBuf(interp, objPtr, statProc, statPtr) Tcl_Interp *interp; /* Interp for error return. May be NULL. */ @@ -1458,6 +1469,7 @@ GetStatBuf(interp, objPtr, statProc, statPtr) } return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -1478,6 +1490,7 @@ GetStatBuf(interp, objPtr, statProc, statPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int StoreStatData(interp, varName, statPtr) Tcl_Interp *interp; /* Interpreter for error reports. */ @@ -1545,6 +1558,7 @@ StoreStatData(interp, varName, statPtr) } return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -1563,6 +1577,7 @@ StoreStatData(interp, varName, statPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static char * GetTypeFromMode(mode) int mode; @@ -1588,6 +1603,7 @@ GetTypeFromMode(mode) } return "unknown"; } +#endif /* *---------------------------------------------------------------------- @@ -2390,6 +2406,7 @@ Tcl_FormatObjCmd(dummy, interp, objc, objv) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static char ** StringifyObjects(objc, objv) int objc; /* Number of arguments. */ @@ -2405,3 +2422,4 @@ StringifyObjects(objc, objv) argv[i] = NULL; return argv; } +#endif diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 3fe8199..3af4aad 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdMZ.c,v 1.26.2.5 2001/11/20 15:14:09 kennykb Exp $ + * RCS: @(#) $Id: tclCmdMZ.c,v 1.26.2.5.2.1 2001/11/28 17:58:35 andreas_kupries Exp $ */ #include "tclInt.h" @@ -62,6 +62,7 @@ static char * TraceVarProc _ANSI_ARGS_((ClientData clientData, *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM /* ARGSUSED */ int Tcl_PwdObjCmd(dummy, interp, objc, objv) @@ -83,6 +84,7 @@ Tcl_PwdObjCmd(dummy, interp, objc, objv) Tcl_DStringResult(interp, &ds); return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -831,6 +833,14 @@ Tcl_ReturnObjCmd(dummy, interp, objc, objv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN +/* IOS FIXME : in the generic case this functionality can be made + * available, it just has to read the file directly instead of using + * the channel system. This makes the code platform dependent. + * + * => See Tcl_EvalFile + */ /* ARGSUSED */ int Tcl_SourceObjCmd(dummy, interp, objc, objv) @@ -851,6 +861,8 @@ Tcl_SourceObjCmd(dummy, interp, objc, objv) result = Tcl_EvalFile(interp, bytes); return result; } +#endif +#endif /* TCL_NO_FILESYSTEM */ /* *---------------------------------------------------------------------- diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 1ceebe2..03fa24f 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclEncoding.c,v 1.5.2.1 2001/04/03 22:54:36 hobbs Exp $ + * RCS: @(#) $Id: tclEncoding.c,v 1.5.2.1.2.1 2001/11/28 17:58:35 andreas_kupries Exp $ */ #include "tclInt.h" @@ -162,12 +162,16 @@ TCL_DECLARE_MUTEX(encodingMutex) static Tcl_Encoding defaultEncoding; static Tcl_Encoding systemEncoding; +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN /* * The following variable is used in the sparse matrix code for a * TableEncoding to represent a page in the table that has no entries. */ static unsigned short emptyPage[256]; +#endif +#endif /* TCL_NO_FILESYSTEM */ /* * Procedures used only in this module. @@ -178,6 +182,8 @@ static int BinaryProc _ANSI_ARGS_((ClientData clientData, Tcl_EncodingState *statePtr, char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr)); +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN static void EscapeFreeProc _ANSI_ARGS_((ClientData clientData)); static int EscapeFromUtfProc _ANSI_ARGS_((ClientData clientData, CONST char *src, int srcLen, int flags, @@ -189,11 +195,21 @@ static int EscapeToUtfProc _ANSI_ARGS_((ClientData clientData, Tcl_EncodingState *statePtr, char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr)); +#endif +#endif /* TCL_NO_FILESYSTEM */ static void FreeEncoding _ANSI_ARGS_((Tcl_Encoding encoding)); +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN static Encoding * GetTableEncoding _ANSI_ARGS_(( EscapeEncodingData *dataPtr, int state)); static Tcl_Encoding LoadEncodingFile _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name)); + +/* IOS FIXME : in the generic case this functionality can be made + * available, it just has to read the file directly instead of using + * the channel system. This makes the code platform dependent. + * See also LoadEncodingFile. + */ static Tcl_Encoding LoadTableEncoding _ANSI_ARGS_((Tcl_Interp *interp, CONST char *name, int type, Tcl_Channel chan)); static Tcl_Encoding LoadEscapeEncoding _ANSI_ARGS_((CONST char *name, @@ -211,6 +227,8 @@ static int TableToUtfProc _ANSI_ARGS_((ClientData clientData, Tcl_EncodingState *statePtr, char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr)); +#endif /* TCL_NO_NONSTDCHAN */ +#endif /* TCL_NO_FILESYSTEM */ static size_t unilen _ANSI_ARGS_((CONST char *src)); static int UnicodeToUtfProc _ANSI_ARGS_((ClientData clientData, CONST char *src, int srcLen, int flags, @@ -341,11 +359,13 @@ TclFinalizeEncodingSubsystem() *------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM char * Tcl_GetDefaultEncodingDir() { return tclDefaultEncodingDir; } +#endif /* *------------------------------------------------------------------------- @@ -360,6 +380,7 @@ Tcl_GetDefaultEncodingDir() *------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM void Tcl_SetDefaultEncodingDir(path) char *path; @@ -367,6 +388,7 @@ Tcl_SetDefaultEncodingDir(path) tclDefaultEncodingDir = (char *)ckalloc((unsigned) strlen(path) + 1); strcpy(tclDefaultEncodingDir, path); } +#endif /* *------------------------------------------------------------------------- @@ -417,7 +439,11 @@ Tcl_GetEncoding(interp, name) return (Tcl_Encoding) encodingPtr; } Tcl_MutexUnlock(&encodingMutex); +#if defined(TCL_NO_FILESYSTEM) || defined(TCL_NO_NONSTDCHAN) + return NULL; +#else return LoadEncodingFile(interp, name); +#endif } /* @@ -542,7 +568,10 @@ Tcl_GetEncodingNames(interp) { Tcl_HashSearch search; Tcl_HashEntry *hPtr; - Tcl_Obj *pathPtr, *resultPtr; +#ifndef TCL_NO_FILESYSTEM + Tcl_Obj *pathPtr; +#endif + Tcl_Obj *resultPtr; int dummy; Tcl_HashTable table; @@ -559,6 +588,7 @@ Tcl_GetEncodingNames(interp) } Tcl_MutexUnlock(&encodingMutex); +#ifndef TCL_NO_FILESYSTEM pathPtr = TclGetLibraryPath(); if (pathPtr != NULL) { int i, objc; @@ -608,6 +638,7 @@ Tcl_GetEncodingNames(interp) } Tcl_DStringFree(&pwdString); } +#endif /* * Clear any values placed in the result by globbing. @@ -1102,8 +1133,10 @@ Tcl_FindExecutable(argv0) CONST char *argv0; /* The value of the application's argv[0] * (native). */ { +#ifndef TCL_NO_FILESYSTEM CONST char *name; Tcl_DString buffer, nameString; +#endif TclInitSubsystems(argv0); @@ -1114,6 +1147,7 @@ Tcl_FindExecutable(argv0) ckfree(tclExecutableName); tclExecutableName = NULL; } +#ifndef TCL_NO_FILESYSTEM if ((name = TclpFindExecutable(argv0)) == NULL) { goto done; } @@ -1144,6 +1178,7 @@ Tcl_FindExecutable(argv0) Tcl_DStringFree(&nameString); return; +#endif done: TclFindEncodings(argv0); } @@ -1168,6 +1203,11 @@ Tcl_FindExecutable(argv0) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN + /* IOS FIXME: Add error message + * Also see OpenEncodingFile below. + */ static Tcl_Encoding LoadEncodingFile(interp, name) Tcl_Interp *interp; /* Interp for error reporting, if not NULL. */ @@ -1247,6 +1287,8 @@ LoadEncodingFile(interp, name) } return NULL; } +#endif +#endif /* TCL_NO_FILESYSTEM */ /* *---------------------------------------------------------------------- @@ -1265,6 +1307,15 @@ LoadEncodingFile(interp, name) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN + +/* IOS FIXME : in the generic case this functionality can be made + * available, it just has to read the file directly instead of using + * the channel system. This makes the code platform dependent. + * See also LoadEncodingFile. + */ + static Tcl_Channel OpenEncodingFile(dir, name) CONST char *dir; @@ -1640,6 +1691,8 @@ LoadEscapeEncoding(name, chan) return Tcl_CreateEncoding(&type); } +#endif /* TCL_NO_NONSTDCHAN */ +#endif /* TCL_NO_FILESYSTEM */ /* *------------------------------------------------------------------------- @@ -1970,6 +2023,8 @@ UtfToUnicodeProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, *------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN static int TableToUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr, dstCharsPtr) @@ -2054,6 +2109,8 @@ TableToUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, *dstCharsPtr = numChars; return result; } +#endif +#endif /* *------------------------------------------------------------------------- @@ -2072,6 +2129,8 @@ TableToUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, *------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN static int TableFromUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr, dstCharsPtr) @@ -2166,6 +2225,8 @@ TableFromUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, *dstCharsPtr = numChars; return result; } +#endif +#endif /* *--------------------------------------------------------------------------- @@ -2184,6 +2245,8 @@ TableFromUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN static void TableFreeProc(clientData) ClientData clientData; /* TableEncodingData that specifies @@ -2196,6 +2259,8 @@ TableFreeProc(clientData) ckfree((char *) dataPtr->fromUnicode); ckfree((char *) dataPtr); } +#endif +#endif /* *------------------------------------------------------------------------- @@ -2214,6 +2279,8 @@ TableFreeProc(clientData) *------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN static int EscapeToUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr, dstCharsPtr) @@ -2406,6 +2473,8 @@ EscapeToUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, *dstCharsPtr = numChars; return result; } +#endif +#endif /* *------------------------------------------------------------------------- @@ -2424,6 +2493,8 @@ EscapeToUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, *------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN static int EscapeFromUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr, dstCharsPtr) @@ -2591,6 +2662,8 @@ EscapeFromUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, *dstCharsPtr = numChars; return result; } +#endif +#endif /* *--------------------------------------------------------------------------- @@ -2609,6 +2682,8 @@ EscapeFromUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen, *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN static void EscapeFreeProc(clientData) ClientData clientData; /* EscapeEncodingData that specifies encoding. */ @@ -2628,6 +2703,8 @@ EscapeFreeProc(clientData) } ckfree((char *) dataPtr); } +#endif +#endif /* TCL_NO_FILESYSTEM */ /* *--------------------------------------------------------------------------- @@ -2649,6 +2726,8 @@ EscapeFreeProc(clientData) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN static Encoding * GetTableEncoding(dataPtr, state) EscapeEncodingData *dataPtr;/* Contains names of encodings. */ @@ -2669,6 +2748,8 @@ GetTableEncoding(dataPtr, state) } return encodingPtr; } +#endif +#endif /* TCL_NO_FILESYSTEM */ /* *--------------------------------------------------------------------------- @@ -2726,9 +2807,11 @@ TclFindEncodings(argv0) CONST char *argv0; /* Name of executable from argv[0] to main() * in native multi-byte encoding. */ { +#ifndef TCL_NO_FILESYSTEM char *native; Tcl_Obj *pathPtr; Tcl_DString libPath, buffer; +#endif if (encodingsInitialized == 0) { /* @@ -2745,6 +2828,7 @@ TclFindEncodings(argv0) encodingsInitialized = 1; +#ifndef TCL_NO_FILESYSTEM native = TclpFindExecutable(argv0); TclpInitLibraryPath(native); @@ -2760,9 +2844,11 @@ TclFindEncodings(argv0) Tcl_UtfToExternalDString(NULL, Tcl_GetString(pathPtr), -1, &libPath); } +#endif TclpSetInitialEncodings(); +#ifndef TCL_NO_FILESYSTEM /* * Now convert the native string back to UTF. */ @@ -2776,6 +2862,7 @@ TclFindEncodings(argv0) Tcl_DStringFree(&libPath); Tcl_DStringFree(&buffer); } +#endif } TclpInitUnlock(); } diff --git a/generic/tclEvent.c b/generic/tclEvent.c index 144f5c7..c72317d 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclEvent.c,v 1.8.2.5 2001/10/03 18:30:45 hobbs Exp $ + * RCS: @(#) $Id: tclEvent.c,v 1.8.2.5.2.1 2001/11/28 17:58:35 andreas_kupries Exp $ */ #include "tclInt.h" @@ -587,6 +587,7 @@ Tcl_Exit(status) *------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM void TclSetLibraryPath(pathPtr) Tcl_Obj *pathPtr; /* A Tcl list object whose elements are @@ -608,6 +609,7 @@ TclSetLibraryPath(pathPtr) */ tclLibraryPathStr = Tcl_GetStringFromObj(pathPtr, NULL); } +#endif /* *------------------------------------------------------------------------- @@ -626,6 +628,7 @@ TclSetLibraryPath(pathPtr) *------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM Tcl_Obj * TclGetLibraryPath() { @@ -643,6 +646,7 @@ TclGetLibraryPath() } return tsdPtr->tclLibraryPath; } +#endif /* *------------------------------------------------------------------------- diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index d975cc6..9b44b1d 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclFCmd.c,v 1.6 1999/07/01 23:21:07 redman Exp $ + * RCS: @(#) $Id: tclFCmd.c,v 1.6.20.1 2001/11/28 17:58:36 andreas_kupries Exp $ */ #include "tclInt.h" @@ -19,6 +19,7 @@ * Declarations for local procedures defined in this file: */ +#ifndef TCL_NO_FILESYSTEM static int CopyRenameOneFile _ANSI_ARGS_((Tcl_Interp *interp, char *source, char *dest, int copyFlag, int force)); @@ -28,6 +29,7 @@ static int FileCopyRename _ANSI_ARGS_((Tcl_Interp *interp, int argc, char **argv, int copyFlag)); static int FileForceOption _ANSI_ARGS_((Tcl_Interp *interp, int argc, char **argv, int *forcePtr)); +#endif /* *--------------------------------------------------------------------------- @@ -48,6 +50,7 @@ static int FileForceOption _ANSI_ARGS_((Tcl_Interp *interp, *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclFileRenameCmd(interp, argc, argv) Tcl_Interp *interp; /* Interp for error reporting. */ @@ -56,6 +59,7 @@ TclFileRenameCmd(interp, argc, argv) { return FileCopyRename(interp, argc, argv, 0); } +#endif /* *--------------------------------------------------------------------------- @@ -76,6 +80,7 @@ TclFileRenameCmd(interp, argc, argv) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclFileCopyCmd(interp, argc, argv) Tcl_Interp *interp; /* Used for error reporting */ @@ -84,6 +89,7 @@ TclFileCopyCmd(interp, argc, argv) { return FileCopyRename(interp, argc, argv, 1); } +#endif /* *--------------------------------------------------------------------------- @@ -102,6 +108,7 @@ TclFileCopyCmd(interp, argc, argv) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int FileCopyRename(interp, argc, argv, copyFlag) Tcl_Interp *interp; /* Used for error reporting. */ @@ -199,6 +206,7 @@ FileCopyRename(interp, argc, argv, copyFlag) Tcl_DStringFree(&targetBuffer); return result; } +#endif /* *--------------------------------------------------------------------------- @@ -218,6 +226,8 @@ FileCopyRename(interp, argc, argv, copyFlag) * *---------------------------------------------------------------------- */ + +#ifndef TCL_NO_FILESYSTEM int TclFileMakeDirsCmd(interp, argc, argv) Tcl_Interp *interp; /* Used for error reporting. */ @@ -290,6 +300,7 @@ TclFileMakeDirsCmd(interp, argc, argv) } return result; } +#endif /* *---------------------------------------------------------------------- @@ -308,6 +319,7 @@ TclFileMakeDirsCmd(interp, argc, argv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclFileDeleteCmd(interp, argc, argv) Tcl_Interp *interp; /* Used for error reporting */ @@ -395,6 +407,7 @@ TclFileDeleteCmd(interp, argc, argv) Tcl_DStringFree(&nameBuffer); return result; } +#endif /* *--------------------------------------------------------------------------- @@ -415,6 +428,7 @@ TclFileDeleteCmd(interp, argc, argv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int CopyRenameOneFile(interp, source, target, copyFlag, force) Tcl_Interp *interp; /* Used for error reporting. */ @@ -594,6 +608,7 @@ CopyRenameOneFile(interp, source, target, copyFlag, force) Tcl_DStringFree(&targetPath); return result; } +#endif /* *--------------------------------------------------------------------------- @@ -615,6 +630,7 @@ CopyRenameOneFile(interp, source, target, copyFlag, force) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int FileForceOption(interp, argc, argv, forcePtr) Tcl_Interp *interp; /* Interp, for error return. */ @@ -645,6 +661,7 @@ FileForceOption(interp, argc, argv, forcePtr) *forcePtr = force; return i; } +#endif /* *--------------------------------------------------------------------------- * @@ -667,6 +684,7 @@ FileForceOption(interp, argc, argv, forcePtr) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static char * FileBasename(interp, path, bufferPtr) Tcl_Interp *interp; /* Interp, for error return. */ @@ -709,6 +727,7 @@ FileBasename(interp, path, bufferPtr) ckfree((char *) argv); return Tcl_DStringValue(bufferPtr); } +#endif /* *---------------------------------------------------------------------- @@ -745,6 +764,7 @@ FileBasename(interp, path, bufferPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclFileAttrsCmd(interp, objc, objv) Tcl_Interp *interp; /* The interpreter for error reporting. */ @@ -839,3 +859,4 @@ TclFileAttrsCmd(interp, objc, objv) Tcl_DStringFree(&buffer); return result; } +#endif diff --git a/generic/tclFileName.c b/generic/tclFileName.c index c0843af..29d4424 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -10,13 +10,14 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclFileName.c,v 1.13.2.2 2001/10/10 00:47:41 hobbs Exp $ + * RCS: @(#) $Id: tclFileName.c,v 1.13.2.2.2.1 2001/11/28 17:58:36 andreas_kupries Exp $ */ #include "tclInt.h" #include "tclPort.h" #include "tclRegexp.h" +#ifndef TCL_NO_FILESYSTEM /* * The following regular expression matches the root portion of a Macintosh * absolute path. It will match degenerate Unix-style paths, tilde paths, @@ -71,6 +72,7 @@ static char * SplitWinPath _ANSI_ARGS_((CONST char *path, Tcl_DString *bufPtr)); static char * SplitUnixPath _ANSI_ARGS_((CONST char *path, Tcl_DString *bufPtr)); +#endif /* *---------------------------------------------------------------------- @@ -88,6 +90,7 @@ static char * SplitUnixPath _ANSI_ARGS_((CONST char *path, *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static void FileNameInit() { @@ -98,6 +101,7 @@ FileNameInit() Tcl_CreateThreadExitHandler(FileNameCleanup, NULL); } } +#endif /* *---------------------------------------------------------------------- @@ -116,6 +120,7 @@ FileNameInit() *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static void FileNameCleanup(clientData) ClientData clientData; /* Not used. */ @@ -124,6 +129,7 @@ FileNameCleanup(clientData) Tcl_DecrRefCount(tsdPtr->macRootPatternPtr); tsdPtr->initialized = 0; } +#endif /* *---------------------------------------------------------------------- @@ -145,6 +151,7 @@ FileNameCleanup(clientData) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static CONST char * ExtractWinRoot(path, resultPtr, offset, typePtr) CONST char *path; /* Path to parse. */ @@ -236,6 +243,7 @@ ExtractWinRoot(path, resultPtr, offset, typePtr) return path; } } +#endif /* *---------------------------------------------------------------------- @@ -255,6 +263,7 @@ ExtractWinRoot(path, resultPtr, offset, typePtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM Tcl_PathType Tcl_GetPathType(path) char *path; @@ -314,6 +323,7 @@ Tcl_GetPathType(path) } return type; } +#endif /* *---------------------------------------------------------------------- @@ -341,6 +351,7 @@ Tcl_GetPathType(path) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM void Tcl_SplitPath(path, argcPtr, argvPtr) CONST char *path; /* Pointer to string containing a path. */ @@ -416,6 +427,7 @@ Tcl_SplitPath(path, argcPtr, argvPtr) Tcl_DStringFree(&buffer); } +#endif /* *---------------------------------------------------------------------- @@ -435,6 +447,7 @@ Tcl_SplitPath(path, argcPtr, argvPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static char * SplitUnixPath(path, bufPtr) CONST char *path; /* Pointer to string containing a path. */ @@ -491,6 +504,7 @@ SplitUnixPath(path, bufPtr) } return Tcl_DStringValue(bufPtr); } +#endif /* *---------------------------------------------------------------------- @@ -510,6 +524,7 @@ SplitUnixPath(path, bufPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static char * SplitWinPath(path, bufPtr) CONST char *path; /* Pointer to string containing a path. */ @@ -551,6 +566,7 @@ SplitWinPath(path, bufPtr) return Tcl_DStringValue(bufPtr); } +#endif /* *---------------------------------------------------------------------- @@ -569,6 +585,7 @@ SplitWinPath(path, bufPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static char * SplitMacPath(path, bufPtr) CONST char *path; /* Pointer to string containing a path. */ @@ -739,6 +756,7 @@ SplitMacPath(path, bufPtr) } return Tcl_DStringValue(bufPtr); } +#endif /* *---------------------------------------------------------------------- @@ -758,6 +776,7 @@ SplitMacPath(path, bufPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM char * Tcl_JoinPath(argc, argv, resultPtr) int argc; @@ -972,6 +991,7 @@ Tcl_JoinPath(argc, argv, resultPtr) Tcl_DStringFree(&buffer); return Tcl_DStringValue(resultPtr); } +#endif /* *--------------------------------------------------------------------------- @@ -999,6 +1019,7 @@ Tcl_JoinPath(argc, argv, resultPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM char * Tcl_TranslateFileName(interp, name, bufferPtr) Tcl_Interp *interp; /* Interpreter in which to store error @@ -1063,6 +1084,7 @@ Tcl_TranslateFileName(interp, name, bufferPtr) } return Tcl_DStringValue(bufferPtr); } +#endif /* *---------------------------------------------------------------------- @@ -1082,6 +1104,7 @@ Tcl_TranslateFileName(interp, name, bufferPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM char * TclGetExtension(name) char *name; /* File name to parse. */ @@ -1130,6 +1153,7 @@ TclGetExtension(name) return p; } +#endif /* *---------------------------------------------------------------------- @@ -1153,6 +1177,7 @@ TclGetExtension(name) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static char * DoTildeSubst(interp, user, resultPtr) Tcl_Interp *interp; /* Interpreter in which to store error @@ -1190,6 +1215,7 @@ DoTildeSubst(interp, user, resultPtr) } return resultPtr->string; } +#endif /* *---------------------------------------------------------------------- @@ -1208,6 +1234,7 @@ DoTildeSubst(interp, user, resultPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM /* ARGSUSED */ int Tcl_GlobObjCmd(dummy, interp, objc, objv) @@ -1588,6 +1615,7 @@ Tcl_GlobObjCmd(dummy, interp, objc, objv) } return result; } +#endif /* *---------------------------------------------------------------------- @@ -1611,6 +1639,7 @@ Tcl_GlobObjCmd(dummy, interp, objc, objv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM /* ARGSUSED */ int TclGlob(interp, pattern, unquotedPrefix, globFlags, types) @@ -1753,6 +1782,7 @@ TclGlob(interp, pattern, unquotedPrefix, globFlags, types) } return result; } +#endif /* *---------------------------------------------------------------------- @@ -1774,6 +1804,7 @@ TclGlob(interp, pattern, unquotedPrefix, globFlags, types) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int SkipToChar(stringPtr, match) char **stringPtr; /* Pointer string to check. */ @@ -1805,6 +1836,7 @@ SkipToChar(stringPtr, match) *stringPtr = p; return 0; } +#endif /* *---------------------------------------------------------------------- @@ -1833,6 +1865,7 @@ SkipToChar(stringPtr, match) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclDoGlob(interp, separators, headPtr, tail, types) Tcl_Interp *interp; /* Interpreter to use for error reporting @@ -2130,3 +2163,4 @@ TclDoGlob(interp, separators, headPtr, tail, types) return TCL_OK; } +#endif diff --git a/generic/tclIO.c b/generic/tclIO.c index c05682c..1854ca5 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIO.c,v 1.20.2.12 2001/11/07 04:48:14 andreas_kupries Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.20.2.12.2.1 2001/11/28 17:58:36 andreas_kupries Exp $ */ #include "tclInt.h" @@ -18,6 +18,13 @@ #include "tclIO.h" #include <assert.h> +#ifdef TCL_NO_NONSTDCHAN +static void Tcl_RegisterChannelInternal _ANSI_ARGS_((Tcl_Interp * interp, + Tcl_Channel chan)); + +#define Tcl_RegisterChannel Tcl_RegisterChannelInternal +#endif + /* * All static variables used in this file are collected into a single @@ -60,8 +67,10 @@ static Tcl_ThreadDataKey dataKey; */ static ChannelBuffer * AllocChannelBuffer _ANSI_ARGS_((int length)); +#ifndef TCL_NO_FILEEVENTS static void ChannelTimerProc _ANSI_ARGS_(( ClientData clientData)); +#endif static int CheckChannelErrors _ANSI_ARGS_((ChannelState *statePtr, int direction)); static int CheckFlush _ANSI_ARGS_((Channel *chanPtr, @@ -70,8 +79,10 @@ static int CheckForDeadChannel _ANSI_ARGS_((Tcl_Interp *interp, ChannelState *statePtr)); static void CheckForStdChannelsBeingClosed _ANSI_ARGS_(( Tcl_Channel chan)); +#ifndef TCL_NO_FILEEVENTS static void CleanupChannelHandlers _ANSI_ARGS_(( Tcl_Interp *interp, Channel *chanPtr)); +#endif static int CloseChannel _ANSI_ARGS_((Tcl_Interp *interp, Channel *chanPtr, int errorCode)); static void CommonGetsCleanup _ANSI_ARGS_((Channel *chanPtr, @@ -82,16 +93,24 @@ static int CopyAndTranslateBuffer _ANSI_ARGS_(( static int CopyBuffer _ANSI_ARGS_(( Channel *chanPtr, char *result, int space)); +#ifndef TCL_NO_CHANNELCOPY static int CopyData _ANSI_ARGS_((CopyState *csPtr, int mask)); +#ifndef TCL_NO_FILEEVENTS static void CopyEventProc _ANSI_ARGS_((ClientData clientData, int mask)); +#endif +#endif +#ifndef TCL_NO_FILEEVENTS static void CreateScriptRecord _ANSI_ARGS_(( Tcl_Interp *interp, Channel *chanPtr, int mask, Tcl_Obj *scriptPtr)); +#endif static void DeleteChannelTable _ANSI_ARGS_(( ClientData clientData, Tcl_Interp *interp)); +#ifndef TCL_NO_FILEEVENTS static void DeleteScriptRecord _ANSI_ARGS_((Tcl_Interp *interp, Channel *chanPtr, int mask)); +#endif static void DiscardInputQueued _ANSI_ARGS_((ChannelState *statePtr, int discardSavedBuffers)); static void DiscardOutputQueued _ANSI_ARGS_(( @@ -108,22 +127,28 @@ static Tcl_HashTable * GetChannelTable _ANSI_ARGS_((Tcl_Interp *interp)); static int GetInput _ANSI_ARGS_((Channel *chanPtr)); static void PeekAhead _ANSI_ARGS_((Channel *chanPtr, char **dstEndPtr, GetsState *gsPtr)); +#if !defined(TCL_NO_CHANNEL_READ) || !defined(TCL_NO_PIPES) static int ReadBytes _ANSI_ARGS_((ChannelState *statePtr, Tcl_Obj *objPtr, int charsLeft, int *offsetPtr)); static int ReadChars _ANSI_ARGS_((ChannelState *statePtr, Tcl_Obj *objPtr, int charsLeft, int *offsetPtr, int *factorPtr)); +#endif static void RecycleBuffer _ANSI_ARGS_((ChannelState *statePtr, ChannelBuffer *bufPtr, int mustDiscard)); static int StackSetBlockMode _ANSI_ARGS_((Channel *chanPtr, int mode)); static int SetBlockMode _ANSI_ARGS_((Tcl_Interp *interp, Channel *chanPtr, int mode)); +#ifndef TCL_NO_CHANNELCOPY static void StopCopy _ANSI_ARGS_((CopyState *csPtr)); +#endif +#if !defined(TCL_NO_CHANNEL_READ) || !defined(TCL_NO_PIPES) static int TranslateInputEOL _ANSI_ARGS_((ChannelState *statePtr, char *dst, CONST char *src, int *dstLenPtr, int *srcLenPtr)); +#endif static int TranslateOutputEOL _ANSI_ARGS_((ChannelState *statePtr, char *dst, CONST char *src, int *dstLenPtr, int *srcLenPtr)); @@ -553,10 +578,12 @@ DeleteChannelTable(clientData, interp) Tcl_HashEntry *hPtr; /* Search variable. */ Channel *chanPtr; /* Channel being deleted. */ ChannelState *statePtr; /* State of Channel being deleted. */ +#ifndef TCL_NO_FILEEVENTS EventScriptRecord *sPtr, *prevPtr, *nextPtr; /* Variables to loop over all channel events * registered, to delete the ones that refer * to the interpreter being deleted. */ +#endif /* * Delete all the registered channels - this will close channels whose @@ -571,6 +598,7 @@ DeleteChannelTable(clientData, interp) chanPtr = (Channel *) Tcl_GetHashValue(hPtr); statePtr = chanPtr->state; +#ifndef TCL_NO_FILEEVENTS /* * Remove any fileevents registered in this interpreter. */ @@ -596,6 +624,7 @@ DeleteChannelTable(clientData, interp) prevPtr = sPtr; } } +#endif /* * Cannot call Tcl_UnregisterChannel because that procedure calls @@ -742,6 +771,13 @@ Tcl_RegisterChannel(interp, chan) *---------------------------------------------------------------------- */ +#ifdef TCL_NO_NONSTDCHAN +/* IOS FIXME: Unregister is still required to make sub interpreters safe by + * removing the std* channels from them. + * This means that removal of sub interp functionality allows the removal of this + * functionality too. + */ +#endif int Tcl_UnregisterChannel(interp, chan) Tcl_Interp *interp; /* Interpreter in which channel is defined. */ @@ -774,6 +810,7 @@ Tcl_UnregisterChannel(interp, chan) } Tcl_DeleteHashEntry(hPtr); +#ifndef TCL_NO_FILEEVENTS /* * Remove channel handlers that refer to this interpreter, so that they * will not be present if the actual close is delayed and more events @@ -783,6 +820,7 @@ Tcl_UnregisterChannel(interp, chan) */ CleanupChannelHandlers(interp, chanPtr); +#endif } statePtr->refCount--; @@ -2179,7 +2217,6 @@ CloseChannel(interp, chanPtr, errorCode) * *---------------------------------------------------------------------- */ - /* ARGSUSED */ int Tcl_Close(interp, chan) @@ -2255,7 +2292,9 @@ Tcl_Close(interp, chan) * Cancel any pending copy operation. */ +#ifndef TCL_NO_CHANNELCOPY StopCopy(statePtr->csPtr); +#endif /* * Must set the interest mask now to 0, otherwise infinite loops @@ -3853,7 +3892,8 @@ done: * *--------------------------------------------------------------------------- */ - + +#if !defined(TCL_NO_CHANNEL_READ) || !defined(TCL_NO_PIPES) int Tcl_ReadChars(chan, objPtr, toRead, appendFlag) Tcl_Channel chan; /* The channel to read. */ @@ -3968,6 +4008,7 @@ Tcl_ReadChars(chan, objPtr, toRead, appendFlag) UpdateInterest(chanPtr); return copied; } +#endif /* *--------------------------------------------------------------------------- * @@ -3993,7 +4034,7 @@ Tcl_ReadChars(chan, objPtr, toRead, appendFlag) * *--------------------------------------------------------------------------- */ - +#if !defined(TCL_NO_CHANNEL_READ) || !defined(TCL_NO_PIPES) static int ReadBytes(statePtr, objPtr, bytesToRead, offsetPtr) ChannelState *statePtr; /* State of the channel to read. */ @@ -4468,6 +4509,7 @@ TranslateInputEOL(statePtr, dstStart, srcStart, dstLenPtr, srcLenPtr) *srcLenPtr = srcLen; return 0; } +#endif /* *---------------------------------------------------------------------- @@ -4840,7 +4882,7 @@ GetInput(chanPtr) * *---------------------------------------------------------------------- */ - +#ifndef TCL_NO_NONSTDCHAN int Tcl_Seek(chan, offset, mode) Tcl_Channel chan; /* The channel on which to seek. */ @@ -5009,6 +5051,7 @@ Tcl_Seek(chan, offset, mode) return curPos; } +#endif /* *---------------------------------------------------------------------- @@ -5506,6 +5549,7 @@ Tcl_BadChannelOption(interp, optionName, optionList) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_CHANNEL_CONFIG int Tcl_GetChannelOption(interp, chan, optionName, dsPtr) Tcl_Interp *interp; /* For error reporting - can be NULL. */ @@ -5712,6 +5756,7 @@ Tcl_GetChannelOption(interp, chan, optionName, dsPtr) return Tcl_BadChannelOption(interp, optionName, NULL); } } +#endif /* *--------------------------------------------------------------------------- @@ -6039,6 +6084,7 @@ Tcl_SetChannelOption(interp, chan, optionName, newValue) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILEEVENTS static void CleanupChannelHandlers(interp, chanPtr) Tcl_Interp *interp; @@ -6074,6 +6120,7 @@ CleanupChannelHandlers(interp, chanPtr) } } } +#endif /* *---------------------------------------------------------------------- @@ -6094,6 +6141,7 @@ CleanupChannelHandlers(interp, chanPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILEEVENTS void Tcl_NotifyChannel(channel, mask) Tcl_Channel channel; /* Channel that detected an event. */ @@ -6217,6 +6265,7 @@ Tcl_NotifyChannel(channel, mask) tsdPtr->nestedHandlerPtr = nh.nestedHandlerPtr; } +#endif /* *---------------------------------------------------------------------- @@ -6239,6 +6288,7 @@ static void UpdateInterest(chanPtr) Channel *chanPtr; /* Channel to update. */ { +#ifndef TCL_NO_FILEEVENTS ChannelState *statePtr = chanPtr->state; /* state info for channel */ int mask = statePtr->interestMask; @@ -6271,6 +6321,7 @@ UpdateInterest(chanPtr) } } (chanPtr->typePtr->watchProc)(chanPtr->instanceData, mask); +#endif } /* @@ -6290,6 +6341,7 @@ UpdateInterest(chanPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILEEVENTS static void ChannelTimerProc(clientData) ClientData clientData; @@ -6331,6 +6383,7 @@ ChannelTimerProc(clientData) UpdateInterest(chanPtr); } } +#endif /* *---------------------------------------------------------------------- @@ -6354,6 +6407,7 @@ ChannelTimerProc(clientData) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILEEVENTS void Tcl_CreateChannelHandler(chan, mask, proc, clientData) Tcl_Channel chan; /* The channel to create the handler for. */ @@ -6416,6 +6470,7 @@ Tcl_CreateChannelHandler(chan, mask, proc, clientData) UpdateInterest(statePtr->topChanPtr); } +#endif /* *---------------------------------------------------------------------- @@ -6436,6 +6491,7 @@ Tcl_CreateChannelHandler(chan, mask, proc, clientData) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILEEVENTS void Tcl_DeleteChannelHandler(chan, proc, clientData) Tcl_Channel chan; /* The channel for which to remove the @@ -6512,6 +6568,7 @@ Tcl_DeleteChannelHandler(chan, proc, clientData) UpdateInterest(statePtr->topChanPtr); } +#endif /* *---------------------------------------------------------------------- @@ -6530,6 +6587,7 @@ Tcl_DeleteChannelHandler(chan, proc, clientData) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILEEVENTS static void DeleteScriptRecord(interp, chanPtr, mask) Tcl_Interp *interp; /* Interpreter in which script was to be @@ -6563,6 +6621,7 @@ DeleteScriptRecord(interp, chanPtr, mask) } } } +#endif /* *---------------------------------------------------------------------- @@ -6581,6 +6640,7 @@ DeleteScriptRecord(interp, chanPtr, mask) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILEEVENTS static void CreateScriptRecord(interp, chanPtr, mask, scriptPtr) Tcl_Interp *interp; /* Interpreter in which to execute @@ -6617,6 +6677,7 @@ CreateScriptRecord(interp, chanPtr, mask, scriptPtr) Tcl_IncrRefCount(scriptPtr); esPtr->scriptPtr = scriptPtr; } +#endif /* *---------------------------------------------------------------------- @@ -6636,6 +6697,7 @@ CreateScriptRecord(interp, chanPtr, mask, scriptPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILEEVENTS void TclChannelEventScriptInvoker(clientData, mask) ClientData clientData; /* The script+interp record. */ @@ -6678,6 +6740,7 @@ TclChannelEventScriptInvoker(clientData, mask) } Tcl_Release((ClientData) interp); } +#endif /* *---------------------------------------------------------------------- @@ -6698,6 +6761,7 @@ TclChannelEventScriptInvoker(clientData, mask) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILEEVENTS /* ARGSUSED */ int Tcl_FileEventObjCmd(clientData, interp, objc, objv) @@ -6778,6 +6842,7 @@ Tcl_FileEventObjCmd(clientData, interp, objc, objv) return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -6800,6 +6865,7 @@ Tcl_FileEventObjCmd(clientData, interp, objc, objv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_CHANNELCOPY int TclCopyChannel(interp, inChan, outChan, toRead, cmdPtr) Tcl_Interp *interp; /* Current interpreter. */ @@ -6986,12 +7052,14 @@ CopyData(csPtr, mask) if (Tcl_Eof(inChan)) { break; } else if (!(mask & TCL_READABLE)) { +#ifndef TCL_NO_FILEEVENTS if (mask & TCL_WRITABLE) { Tcl_DeleteChannelHandler(outChan, CopyEventProc, (ClientData) csPtr); } Tcl_CreateChannelHandler(inChan, TCL_READABLE, CopyEventProc, (ClientData) csPtr); +#endif } return TCL_OK; } @@ -7028,6 +7096,7 @@ CopyData(csPtr, mask) */ if (outStatePtr->flags & BG_FLUSH_SCHEDULED) { +#ifndef TCL_NO_FILEEVENTS if (!(mask & TCL_WRITABLE)) { if (mask & TCL_READABLE) { Tcl_DeleteChannelHandler(inChan, CopyEventProc, @@ -7036,9 +7105,11 @@ CopyData(csPtr, mask) Tcl_CreateChannelHandler(outChan, TCL_WRITABLE, CopyEventProc, (ClientData) csPtr); } +#endif return TCL_OK; } +#ifndef TCL_NO_FILEEVENTS /* * For background copies, we only do one buffer per invocation so * we don't starve the rest of the system. @@ -7056,6 +7127,7 @@ CopyData(csPtr, mask) } return TCL_OK; } +#endif } /* @@ -7064,6 +7136,7 @@ CopyData(csPtr, mask) */ total = csPtr->total; +#ifndef TCL_NO_FILEEVENTS if (cmdPtr) { /* * Get a private copy of the command so we can mutate it @@ -7087,6 +7160,7 @@ CopyData(csPtr, mask) Tcl_DecrRefCount(cmdPtr); Tcl_Release((ClientData) interp); } else { +#endif StopCopy(csPtr); if (errObj) { Tcl_SetObjResult(interp, errObj); @@ -7095,9 +7169,12 @@ CopyData(csPtr, mask) Tcl_ResetResult(interp); Tcl_SetIntObj(Tcl_GetObjResult(interp), total); } +#ifndef TCL_NO_FILEEVENTS } +#endif return result; } +#endif /* *---------------------------------------------------------------------- @@ -7682,6 +7759,8 @@ DoWrite(chanPtr, src, srcLen) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_CHANNELCOPY +#ifndef TCL_NO_FILEEVENTS static void CopyEventProc(clientData, mask) ClientData clientData; @@ -7689,6 +7768,7 @@ CopyEventProc(clientData, mask) { (void) CopyData((CopyState *)clientData, mask); } +#endif /* *---------------------------------------------------------------------- @@ -7741,6 +7821,7 @@ StopCopy(csPtr) outStatePtr->flags |= csPtr->writeFlags & (CHANNEL_LINEBUFFERED | CHANNEL_UNBUFFERED); +#ifndef TCL_NO_FILEEVENTS if (csPtr->cmdPtr) { Tcl_DeleteChannelHandler((Tcl_Channel)csPtr->readPtr, CopyEventProc, (ClientData)csPtr); @@ -7750,10 +7831,12 @@ StopCopy(csPtr) } Tcl_DecrRefCount(csPtr->cmdPtr); } +#endif inStatePtr->csPtr = NULL; outStatePtr->csPtr = NULL; ckfree((char*) csPtr); } +#endif /* *---------------------------------------------------------------------- diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index 75b4db7..ebadea4 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -8,12 +8,13 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIOCmd.c,v 1.7.2.1 2001/08/06 22:24:11 andreas_kupries Exp $ + * RCS: @(#) $Id: tclIOCmd.c,v 1.7.2.1.2.1 2001/11/28 17:58:36 andreas_kupries Exp $ */ #include "tclInt.h" #include "tclPort.h" +#ifndef TCL_NO_SOCKETS /* * Callback structure for accept callback in a TCP server. */ @@ -27,6 +28,7 @@ typedef struct AcceptCallback { * Static functions for this file: */ +#ifndef TCL_NO_FILEEVENTS static void AcceptCallbackProc _ANSI_ARGS_((ClientData callbackData, Tcl_Channel chan, char *address, int port)); static void RegisterTcpServerInterpCleanup _ANSI_ARGS_((Tcl_Interp *interp, @@ -36,6 +38,8 @@ static void TcpAcceptCallbacksDeleteProc _ANSI_ARGS_(( static void TcpServerCloseProc _ANSI_ARGS_((ClientData callbackData)); static void UnregisterTcpServerInterpCleanupProc _ANSI_ARGS_(( Tcl_Interp *interp, AcceptCallback *acceptCallbackPtr)); +#endif /* TCL_NO_FILEEVENTS */ +#endif /* TCL_NO_SOCKETS */ /* *---------------------------------------------------------------------- @@ -282,6 +286,7 @@ Tcl_GetsObjCmd(dummy, interp, objc, objv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_CHANNEL_READ /* ARGSUSED */ int Tcl_ReadObjCmd(dummy, interp, objc, objv) @@ -380,6 +385,7 @@ Tcl_ReadObjCmd(dummy, interp, objc, objv) Tcl_DecrRefCount(resultPtr); return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -398,7 +404,7 @@ Tcl_ReadObjCmd(dummy, interp, objc, objv) * *---------------------------------------------------------------------- */ - +#ifndef TCL_NO_NONSTDCHAN /* ARGSUSED */ int Tcl_SeekObjCmd(clientData, interp, objc, objv) @@ -444,6 +450,7 @@ Tcl_SeekObjCmd(clientData, interp, objc, objv) } return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -507,7 +514,7 @@ Tcl_TellObjCmd(clientData, interp, objc, objv) * *---------------------------------------------------------------------- */ - +#ifndef TCL_NO_NONSTDCHAN /* ARGSUSED */ int Tcl_CloseObjCmd(clientData, interp, objc, objv) @@ -556,6 +563,7 @@ Tcl_CloseObjCmd(clientData, interp, objc, objv) return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -574,6 +582,7 @@ Tcl_CloseObjCmd(clientData, interp, objc, objv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_CHANNEL_CONFIG /* ARGSUSED */ int Tcl_FconfigureObjCmd(clientData, interp, objc, objv) @@ -627,6 +636,7 @@ Tcl_FconfigureObjCmd(clientData, interp, objc, objv) } return TCL_OK; } +#endif /* *--------------------------------------------------------------------------- @@ -646,6 +656,7 @@ Tcl_FconfigureObjCmd(clientData, interp, objc, objv) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_CHANNEL_EOF /* ARGSUSED */ int Tcl_EofObjCmd(unused, interp, objc, objv) @@ -672,6 +683,7 @@ Tcl_EofObjCmd(unused, interp, objc, objv) Tcl_SetBooleanObj(Tcl_GetObjResult(interp), Tcl_Eof(chan)); return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -690,6 +702,8 @@ Tcl_EofObjCmd(unused, interp, objc, objv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_PIPES /* ARGSUSED */ int Tcl_ExecObjCmd(dummy, interp, objc, objv) @@ -848,6 +862,8 @@ Tcl_ExecObjCmd(dummy, interp, objc, objv) return result; #endif /* !MAC_TCL */ } +#endif /* TCL_NO_PIPES */ +#endif /* TCL_NO_FILESYSTEM */ /* *--------------------------------------------------------------------------- @@ -867,6 +883,7 @@ Tcl_ExecObjCmd(dummy, interp, objc, objv) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_CHANNEL_BLOCKED /* ARGSUSED */ int Tcl_FblockedObjCmd(unused, interp, objc, objv) @@ -898,6 +915,7 @@ Tcl_FblockedObjCmd(unused, interp, objc, objv) Tcl_SetBooleanObj(Tcl_GetObjResult(interp), Tcl_InputBlocked(chan)); return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -916,6 +934,8 @@ Tcl_FblockedObjCmd(unused, interp, objc, objv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN /* ARGSUSED */ int Tcl_OpenObjCmd(notUsed, interp, objc, objv) @@ -963,6 +983,12 @@ Tcl_OpenObjCmd(notUsed, interp, objc, objv) (char *)NULL); return TCL_ERROR; #else +#ifdef TCL_NO_PIPES + Tcl_AppendResult(interp, + "command pipelines not supported (TCL_NO_PIPES)", + (char *)NULL); + return TCL_ERROR; +#else int mode, seekFlag, cmdObjc; char **cmdArgv; @@ -992,7 +1018,8 @@ Tcl_OpenObjCmd(notUsed, interp, objc, objv) chan = Tcl_OpenCommandChannel(interp, cmdObjc, cmdArgv, flags); } ckfree((char *) cmdArgv); -#endif +#endif /* TCL_NO_PIPES */ +#endif /* MAC_TCL */ } if (chan == (Tcl_Channel) NULL) { return TCL_ERROR; @@ -1001,7 +1028,10 @@ Tcl_OpenObjCmd(notUsed, interp, objc, objv) Tcl_AppendResult(interp, Tcl_GetChannelName(chan), (char *) NULL); return TCL_OK; } +#endif /* TCL_NO_NONSTDCHAN */ +#endif /* TCL_NO_FILESYSTEM */ +#ifndef TCL_NO_SOCKETS /* *---------------------------------------------------------------------- * @@ -1023,6 +1053,7 @@ Tcl_OpenObjCmd(notUsed, interp, objc, objv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILEEVENTS /* ARGSUSED */ static void TcpAcceptCallbacksDeleteProc(clientData, interp) @@ -1045,6 +1076,7 @@ TcpAcceptCallbacksDeleteProc(clientData, interp) Tcl_DeleteHashTable(hTblPtr); ckfree((char *) hTblPtr); } +#endif /* *---------------------------------------------------------------------- @@ -1066,6 +1098,7 @@ TcpAcceptCallbacksDeleteProc(clientData, interp) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILEEVENTS static void RegisterTcpServerInterpCleanup(interp, acceptCallbackPtr) Tcl_Interp *interp; /* Interpreter for which we want to be @@ -1096,6 +1129,7 @@ RegisterTcpServerInterpCleanup(interp, acceptCallbackPtr) } Tcl_SetHashValue(hPtr, (ClientData) acceptCallbackPtr); } +#endif /* *---------------------------------------------------------------------- @@ -1116,6 +1150,7 @@ RegisterTcpServerInterpCleanup(interp, acceptCallbackPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILEEVENTS static void UnregisterTcpServerInterpCleanupProc(interp, acceptCallbackPtr) Tcl_Interp *interp; /* Interpreter in which the accept callback @@ -1138,6 +1173,7 @@ UnregisterTcpServerInterpCleanupProc(interp, acceptCallbackPtr) } Tcl_DeleteHashEntry(hPtr); } +#endif /* *---------------------------------------------------------------------- @@ -1156,6 +1192,7 @@ UnregisterTcpServerInterpCleanupProc(interp, acceptCallbackPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILEEVENTS static void AcceptCallbackProc(callbackData, chan, address, port) ClientData callbackData; /* The data stored when the callback @@ -1225,6 +1262,7 @@ AcceptCallbackProc(callbackData, chan, address, port) Tcl_Close((Tcl_Interp *) NULL, chan); } } +#endif /* *---------------------------------------------------------------------- @@ -1247,6 +1285,7 @@ AcceptCallbackProc(callbackData, chan, address, port) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILEEVENTS static void TcpServerCloseProc(callbackData) ClientData callbackData; /* The data passed in the call to @@ -1263,6 +1302,7 @@ TcpServerCloseProc(callbackData) Tcl_EventuallyFree((ClientData) acceptCallbackPtr->script, TCL_DYNAMIC); ckfree((char *) acceptCallbackPtr); } +#endif /* *---------------------------------------------------------------------- @@ -1295,12 +1335,18 @@ Tcl_SocketObjCmd(notUsed, interp, objc, objv) SKT_ASYNC, SKT_MYADDR, SKT_MYPORT, SKT_SERVER }; int optionIndex, a, server, port; +#ifndef TCL_NO_FILEEVENTS char *arg, *copyScript, *host, *script; +#else + char *arg, *host, *script; +#endif char *myaddr = NULL; int myport = 0; int async = 0; Tcl_Channel chan; +#ifndef TCL_NO_FILEEVENTS AcceptCallback *acceptCallbackPtr; +#endif server = 0; script = NULL; @@ -1410,6 +1456,7 @@ wrongNumArgs: } if (server) { +#ifndef TCL_NO_FILEEVENTS acceptCallbackPtr = (AcceptCallback *) ckalloc((unsigned) sizeof(AcceptCallback)); copyScript = ckalloc((unsigned) strlen(script) + 1); @@ -1441,6 +1488,10 @@ wrongNumArgs: Tcl_CreateCloseHandler(chan, TcpServerCloseProc, (ClientData) acceptCallbackPtr); +#else + /* IOS FIXME: error message */ + return TCL_ERROR; +#endif } else { chan = Tcl_OpenTcpClient(interp, port, host, myaddr, myport, async); if (chan == (Tcl_Channel) NULL) { @@ -1452,6 +1503,7 @@ wrongNumArgs: return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -1471,6 +1523,7 @@ wrongNumArgs: *---------------------------------------------------------------------- */ +#ifndef TCL_NO_CHANNELCOPY int Tcl_FcopyObjCmd(dummy, interp, objc, objv) ClientData dummy; /* Not used. */ @@ -1534,10 +1587,15 @@ Tcl_FcopyObjCmd(dummy, interp, objc, objv) } break; case FcopyCommand: +#ifndef TCL_NO_FILEEVENTS cmdPtr = objv[i+1]; +#else + return TCL_ERROR; /* IOS FIXME: need error message */ +#endif break; } } return TclCopyChannel(interp, inChan, outChan, toRead, cmdPtr); } +#endif diff --git a/generic/tclIOGT.c b/generic/tclIOGT.c index 542b5d9..d8665e7 100644 --- a/generic/tclIOGT.c +++ b/generic/tclIOGT.c @@ -10,13 +10,14 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * CVS: $Id: tclIOGT.c,v 1.1.4.3 2001/04/03 22:54:37 hobbs Exp $ + * CVS: $Id: tclIOGT.c,v 1.1.4.3.2.1 2001/11/28 17:58:36 andreas_kupries Exp $ */ #include "tclInt.h" #include "tclPort.h" #include "tclIO.h" +#ifndef TCL_NO_CHANNEL_CONFIG /* * Forward declarations of internal procedures. @@ -55,8 +56,10 @@ static int TransformNotifyProc _ANSI_ARGS_ (( * Secondly the procedures for handling and generating fileeevents. */ +#ifndef TCL_NO_FILEEVENTS static void TransformChannelHandlerTimer _ANSI_ARGS_ (( ClientData clientData)); +#endif /* * Forward declarations of internal procedures. @@ -999,6 +1002,7 @@ TransformWatchProc (instanceData, mask) ClientData instanceData; /* Channel to watch */ int mask; /* Events of interest */ { +#ifndef TCL_NO_FILEEVENTS /* The caller expressed interest in events occuring for this * channel. We are forwarding the call to the underlying * channel now. @@ -1049,6 +1053,7 @@ TransformWatchProc (instanceData, mask) dataPtr->timer = Tcl_CreateTimerHandler (FLUSH_DELAY, TransformChannelHandlerTimer, (ClientData) dataPtr); } +#endif } /* @@ -1150,6 +1155,7 @@ TransformNotifyProc (clientData, mask) *------------------------------------------------------* */ +#ifndef TCL_NO_FILEEVENTS static void TransformChannelHandlerTimer (clientData) ClientData clientData; /* Transformation to query */ @@ -1170,6 +1176,7 @@ TransformChannelHandlerTimer (clientData) Tcl_NotifyChannel(dataPtr->self, TCL_READABLE); } +#endif /* *------------------------------------------------------* @@ -1357,3 +1364,16 @@ ResultAdd (r, buf, toWrite) memcpy(r->buf + r->used, buf, (size_t) toWrite); r->used += toWrite; } + +#else + +int +TclChannelTransform(interp, chan, cmdObjPtr) + Tcl_Interp *interp; /* Interpreter for result. */ + Tcl_Channel chan; /* Channel to transform. */ + Tcl_Obj *cmdObjPtr; /* Script to use for transform. */ +{ + return TCL_ERROR; +} +#endif + diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 65dca78..1823736 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIOUtil.c,v 1.9 1999/11/10 02:51:56 hobbs Exp $ + * RCS: @(#) $Id: tclIOUtil.c,v 1.9.6.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include "tclInt.h" @@ -26,6 +26,7 @@ * a linked list is defined. */ +#ifndef TCL_NO_FILESYSTEM typedef struct StatProc { TclStatProc_ *proc; /* Function to process a 'stat()' call */ struct StatProc *nextPtr; /* The next 'stat()' function to call */ @@ -70,12 +71,17 @@ static AccessProc defaultAccessProc = { static AccessProc *accessProcList = &defaultAccessProc; static OpenFileChannelProc defaultOpenFileChannelProc = { +#ifndef TCL_NO_NONSTDCHAN &TclpOpenFileChannel, NULL +#else + NULL +#endif }; static OpenFileChannelProc *openFileChannelProcList = &defaultOpenFileChannelProc; TCL_DECLARE_MUTEX(hookMutex) +#endif /* *--------------------------------------------------------------------------- @@ -270,6 +276,12 @@ TclGetOpenMode(interp, string, seekFlagPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN +/* IOS FIXME : in the generic case this functionality can be made + * available, it just has to read the file directly instead of using + * the channel system. This makes the code platform dependent. + */ int Tcl_EvalFile(interp, fileName) Tcl_Interp *interp; /* Interpreter in which to process file. */ @@ -342,6 +354,8 @@ Tcl_EvalFile(interp, fileName) Tcl_DStringFree(&nameString); return result; } +#endif /* TCL_NO_NONSTDCHAN */ +#endif /* TCL_NO_FILESYSTEM */ /* *---------------------------------------------------------------------- @@ -443,6 +457,7 @@ Tcl_PosixError(interp) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclStat(path, buf) CONST char *path; /* Path of file to stat (in current CP). */ @@ -466,6 +481,7 @@ TclStat(path, buf) return (retVal); } +#endif /* *---------------------------------------------------------------------- @@ -486,6 +502,7 @@ TclStat(path, buf) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclAccess(path, mode) CONST char *path; /* Path of file to access (in current CP). */ @@ -509,6 +526,7 @@ TclAccess(path, mode) return (retVal); } +#endif /* *---------------------------------------------------------------------- @@ -530,6 +548,7 @@ TclAccess(path, mode) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM Tcl_Channel Tcl_OpenFileChannel(interp, fileName, modeString, permissions) Tcl_Interp *interp; /* Interpreter for error reporting; @@ -561,6 +580,7 @@ Tcl_OpenFileChannel(interp, fileName, modeString, permissions) return (retVal); } +#endif /* TCL_NO_FILESYSTEM */ /* *---------------------------------------------------------------------- @@ -584,6 +604,7 @@ Tcl_OpenFileChannel(interp, fileName, modeString, permissions) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclStatInsertProc (proc) TclStatProc_ *proc; @@ -608,6 +629,7 @@ TclStatInsertProc (proc) return (retVal); } +#endif /* *---------------------------------------------------------------------- @@ -628,6 +650,7 @@ TclStatInsertProc (proc) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclStatDeleteProc (proc) TclStatProc_ *proc; @@ -664,6 +687,7 @@ TclStatDeleteProc (proc) Tcl_MutexUnlock(&hookMutex); return (retVal); } +#endif /* *---------------------------------------------------------------------- @@ -687,6 +711,7 @@ TclStatDeleteProc (proc) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclAccessInsertProc(proc) TclAccessProc_ *proc; @@ -711,6 +736,7 @@ TclAccessInsertProc(proc) return (retVal); } +#endif /* *---------------------------------------------------------------------- @@ -731,6 +757,7 @@ TclAccessInsertProc(proc) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclAccessDeleteProc(proc) TclAccessProc_ *proc; @@ -767,6 +794,7 @@ TclAccessDeleteProc(proc) return (retVal); } +#endif /* *---------------------------------------------------------------------- @@ -791,6 +819,7 @@ TclAccessDeleteProc(proc) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclOpenFileChannelInsertProc(proc) TclOpenFileChannelProc_ *proc; @@ -816,6 +845,7 @@ TclOpenFileChannelInsertProc(proc) return (retVal); } +#endif /* *---------------------------------------------------------------------- @@ -836,6 +866,7 @@ TclOpenFileChannelInsertProc(proc) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclOpenFileChannelDeleteProc(proc) TclOpenFileChannelProc_ *proc; @@ -874,3 +905,4 @@ TclOpenFileChannelDeleteProc(proc) return (retVal); } +#endif diff --git a/generic/tclInt.decls b/generic/tclInt.decls index 0aad6e9..c5bd690 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: tclInt.decls,v 1.20.2.6 2001/10/17 19:29:25 das Exp $ +# RCS: @(#) $Id: tclInt.decls,v 1.20.2.6.2.1 2001/11/28 17:58:37 andreas_kupries Exp $ library tcl @@ -23,13 +23,13 @@ interface tclInt # Use at your own risk. Note that the position of functions should not # be changed between versions to avoid gratuitous incompatibilities. -declare 0 generic { +declare 0 generic {TCL_NO_FILESYSTEM} { int TclAccess(CONST char *path, int mode) } -declare 1 generic { +declare 1 generic {TCL_NO_FILESYSTEM} { int TclAccessDeleteProc(TclAccessProc_ *proc) } -declare 2 generic { +declare 2 generic {TCL_NO_FILESYSTEM} { int TclAccessInsertProc(TclAccessProc_ *proc) } declare 3 generic { @@ -39,7 +39,7 @@ declare 3 generic { # declare 4 generic { # int TclChdir(Tcl_Interp *interp, char *dirName) # } -declare 5 {unix win} { +declare 5 {unix win} {TCL_NO_PIPES} { int TclCleanupChildren(Tcl_Interp *interp, int numPids, Tcl_Pid *pidPtr, \ Tcl_Channel errorChan) } @@ -49,14 +49,14 @@ declare 6 generic { declare 7 generic { int TclCopyAndCollapse(int count, CONST char *src, char *dst) } -declare 8 generic { +declare 8 generic {TCL_NO_CHANNELCOPY} { int TclCopyChannel(Tcl_Interp *interp, Tcl_Channel inChan, \ Tcl_Channel outChan, int toRead, Tcl_Obj *cmdPtr) } # TclCreatePipeline unofficially exported for use by BLT. -declare 9 {unix win} { +declare 9 {unix win} {TCL_NO_FILESYSTEM TCL_NO_PIPES} { int TclCreatePipeline(Tcl_Interp *interp, int argc, char **argv, \ Tcl_Pid **pidArrayPtr, TclFile *inPipePtr, TclFile *outPipePtr, \ TclFile *errFilePtr) @@ -71,7 +71,7 @@ declare 11 generic { declare 12 generic { void TclDeleteVars(Interp *iPtr, Tcl_HashTable *tablePtr) } -declare 13 generic { +declare 13 generic {TCL_NO_FILESYSTEM} { int TclDoGlob(Tcl_Interp *interp, char *separators, \ Tcl_DString *headPtr, char *tail, GlobTypeData *types) } @@ -85,19 +85,19 @@ declare 14 generic { declare 16 generic { void TclExprFloatError(Tcl_Interp *interp, double value) } -declare 17 generic { +declare 17 generic {TCL_NO_FILESYSTEM} { int TclFileAttrsCmd(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) } -declare 18 generic { +declare 18 generic {TCL_NO_FILESYSTEM} { int TclFileCopyCmd(Tcl_Interp *interp, int argc, char **argv) } -declare 19 generic { +declare 19 generic {TCL_NO_FILESYSTEM} { int TclFileDeleteCmd(Tcl_Interp *interp, int argc, char **argv) } -declare 20 generic { +declare 20 generic {TCL_NO_FILESYSTEM} { int TclFileMakeDirsCmd(Tcl_Interp *interp, int argc, char **argv) } -declare 21 generic { +declare 21 generic {TCL_NO_FILESYSTEM} { int TclFileRenameCmd(Tcl_Interp *interp, int argc, char **argv) } declare 22 generic { @@ -133,7 +133,7 @@ declare 29 generic { # declare 30 generic { # char * TclGetEnv(CONST char *name) # } -declare 31 generic { +declare 31 generic {TCL_NO_FILESYSTEM} { char * TclGetExtension(char *name) } declare 32 generic { @@ -171,7 +171,7 @@ declare 40 generic { declare 41 generic { Tcl_Command TclGetOriginalCommand(Tcl_Command command) } -declare 42 generic { +declare 42 generic {TCL_NO_FILESYSTEM} { char * TclpGetUserHome(CONST char *name, Tcl_DString *bufferPtr) } declare 43 generic { @@ -202,7 +202,7 @@ declare 50 generic { void TclInitCompiledLocals(Tcl_Interp *interp, CallFrame *framePtr, \ Namespace *nsPtr) } -declare 51 generic { +declare 51 generic {{TCL_NO_SLAVEINTERP TCL_NO_CMDALIASES}} { int TclInterpInit(Tcl_Interp *interp) } declare 52 generic { @@ -234,7 +234,7 @@ declare 58 generic { int flags, char *msg, int createPart1, int createPart2, \ Var **arrayPtrPtr) } -declare 59 generic { +declare 59 generic {TCL_NO_FILESYSTEM} { int TclpMatchFiles(Tcl_Interp *interp, char *separators, \ Tcl_DString *dirPtr, char *pattern, char *tail) } @@ -259,29 +259,29 @@ declare 65 generic { int TclObjInvokeGlobal(Tcl_Interp *interp, int objc, \ Tcl_Obj *CONST objv[], int flags) } -declare 66 generic { +declare 66 generic {TCL_NO_FILESYSTEM} { int TclOpenFileChannelDeleteProc(TclOpenFileChannelProc_ *proc) } -declare 67 generic { +declare 67 generic {TCL_NO_FILESYSTEM} { int TclOpenFileChannelInsertProc(TclOpenFileChannelProc_ *proc) } -declare 68 generic { +declare 68 generic {TCL_NO_FILESYSTEM} { int TclpAccess(CONST char *path, int mode) } declare 69 generic { char * TclpAlloc(unsigned int size) } -declare 70 generic { +declare 70 generic {TCL_NO_FILESYSTEM} { int TclpCopyFile(CONST char *source, CONST char *dest) } -declare 71 generic { +declare 71 generic {TCL_NO_FILESYSTEM} { int TclpCopyDirectory(CONST char *source, CONST char *dest, \ Tcl_DString *errorPtr) } -declare 72 generic { +declare 72 generic {TCL_NO_FILESYSTEM} { int TclpCreateDirectory(CONST char *path) } -declare 73 generic { +declare 73 generic {TCL_NO_FILESYSTEM} { int TclpDeleteFile(CONST char *path) } declare 74 generic { @@ -299,21 +299,21 @@ declare 77 generic { declare 78 generic { int TclpGetTimeZone(unsigned long time) } -declare 79 generic { +declare 79 generic {TCL_NO_FILESYSTEM} { int TclpListVolumes(Tcl_Interp *interp) } -declare 80 generic { +declare 80 generic {TCL_NO_FILESYSTEM TCL_NO_NONSTDCHAN} { Tcl_Channel TclpOpenFileChannel(Tcl_Interp *interp, char *fileName, \ char *modeString, int permissions) } declare 81 generic { char * TclpRealloc(char *ptr, unsigned int size) } -declare 82 generic { +declare 82 generic {TCL_NO_FILESYSTEM} { int TclpRemoveDirectory(CONST char *path, int recursive, \ Tcl_DString *errorPtr) } -declare 83 generic { +declare 83 generic {TCL_NO_FILESYSTEM} { int TclpRenameFile(CONST char *source, CONST char *dest) } # Removed in 8.1: @@ -336,7 +336,7 @@ declare 88 generic { char * TclPrecTraceProc(ClientData clientData, Tcl_Interp *interp, \ char *name1, char *name2, int flags) } -declare 89 generic { +declare 89 generic {TCL_NO_CMDALIASES} { int TclPreventAliasLoop(Tcl_Interp *interp, Tcl_Interp *cmdInterp, \ Tcl_Command cmd) } @@ -359,7 +359,7 @@ declare 94 generic { int TclProcInterpProc(ClientData clientData, Tcl_Interp *interp, \ int argc, char **argv) } -declare 95 generic { +declare 95 generic {TCL_NO_FILESYSTEM} { int TclpStat(CONST char *path, struct stat *buf) } declare 96 generic { @@ -392,13 +392,13 @@ declare 103 generic { declare 104 {unix win} { int TclSockMinimumBuffers(int sock, int size) } -declare 105 generic { +declare 105 generic {TCL_NO_FILESYSTEM} { int TclStat(CONST char *path, struct stat *buf) } -declare 106 generic { +declare 106 generic {TCL_NO_FILESYSTEM} { int TclStatDeleteProc(TclStatProc_ *proc) } -declare 107 generic { +declare 107 generic {TCL_NO_FILESYSTEM} { int TclStatInsertProc(TclStatProc_ *proc) } declare 108 generic { @@ -511,13 +511,13 @@ declare 135 generic { # Added in 8.1: -declare 137 generic { +declare 137 generic {TCL_NO_FILESYSTEM} { int TclpChdir(CONST char *dirName) } declare 138 generic { char * TclGetEnv(CONST char *name, Tcl_DString *valuePtr) } -declare 139 generic { +declare 139 generic {TCL_NO_FILESYSTEM TCL_NO_LOADCMD} { int TclpLoadFile(Tcl_Interp *interp, char *fileName, char *sym1, \ char *sym2, Tcl_PackageInitProc **proc1Ptr, \ Tcl_PackageInitProc **proc2Ptr, ClientData *clientDataPtr) @@ -525,7 +525,7 @@ declare 139 generic { declare 140 generic { int TclLooksLikeInt(char *bytes, int length) } -declare 141 generic { +declare 141 generic {TCL_NO_FILESYSTEM} { char *TclpGetCwd(Tcl_Interp *interp, Tcl_DString *cwdPtr) } declare 142 generic { @@ -570,10 +570,10 @@ declare 151 generic { int *endPtr) } -declare 152 generic { +declare 152 generic {TCL_NO_FILESYSTEM} { void TclSetLibraryPath(Tcl_Obj *pathPtr) } -declare 153 generic { +declare 153 generic {TCL_NO_FILESYSTEM} { Tcl_Obj *TclGetLibraryPath(void) } @@ -600,7 +600,7 @@ declare 158 generic { declare 159 generic { char *TclGetStartupScriptFileName(void) } -declare 160 generic { +declare 160 generic {TCL_NO_FILESYSTEM} { int TclpMatchFilesTypes(Tcl_Interp *interp, char *separators, \ Tcl_DString *dirPtr, char *pattern, char *tail, GlobTypeData *types) } @@ -610,7 +610,7 @@ declare 161 generic { int TclChannelTransform(Tcl_Interp *interp, Tcl_Channel chan, \ Tcl_Obj *cmdObjPtr) } -declare 162 generic { +declare 162 generic {TCL_NO_FILEEVENTS} { void TclChannelEventScriptInvoker(ClientData clientData, int flags) } @@ -791,7 +791,7 @@ declare 9 win { # Pipe channel functions -declare 11 win { +declare 11 win {TCL_NO_PIPES} { void TclGetAndDetachPids(Tcl_Interp *interp, Tcl_Channel chan) } declare 12 win { @@ -859,20 +859,20 @@ declare 27 win { # Pipe channel functions -declare 0 unix { +declare 0 unix {TCL_NO_PIPES} { void TclGetAndDetachPids(Tcl_Interp *interp, Tcl_Channel chan) } -declare 1 unix { +declare 1 unix {TCL_NO_PIPES} { int TclpCloseFile(TclFile file) } -declare 2 unix { +declare 2 unix {TCL_NO_PIPES} { Tcl_Channel TclpCreateCommandChannel(TclFile readFile, \ TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr) } -declare 3 unix { +declare 3 unix {TCL_NO_PIPES} { int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe) } -declare 4 unix { +declare 4 unix {TCL_NO_PIPES} { int TclpCreateProcess(Tcl_Interp *interp, int argc, char **argv, \ TclFile inputFile, TclFile outputFile, TclFile errorFile, \ Tcl_Pid *pidPtr) @@ -882,10 +882,10 @@ declare 4 unix { # TclFile TclpCreateTempFile(char *contents, # Tcl_DString *namePtr) # } -declare 6 unix { +declare 6 unix {TCL_NO_PIPES} { TclFile TclpMakeFile(Tcl_Channel channel, int direction) } -declare 7 unix { +declare 7 unix {TCL_NO_PIPES} { TclFile TclpOpenFile(CONST char *fname, int mode) } declare 8 unix { @@ -894,6 +894,6 @@ declare 8 unix { # Added in 8.1: -declare 9 unix { +declare 9 unix {TCL_NO_PIPES} { TclFile TclpCreateTempFile(CONST char *contents) } diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 96c0c7f..db7bb98 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -9,13 +9,14 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInterp.c,v 1.5.12.2 2001/09/11 00:53:27 hobbs Exp $ + * RCS: @(#) $Id: tclInterp.c,v 1.5.12.2.2.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include <stdio.h> #include "tclInt.h" #include "tclPort.h" +#ifndef TCL_NO_CMDALIASES /* * Counter for how many aliases were created (global) */ @@ -57,7 +58,9 @@ typedef struct Alias { * hash table is never required - we are using * a hash table only for convenience. */ } Alias; +#endif +#if !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) /* * * struct Slave: @@ -81,7 +84,9 @@ typedef struct Slave { * in slave interpreter to struct Alias * defined below. */ } Slave; +#endif /* !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) */ +#ifndef TCL_NO_CMDALIASES /* * struct Target: * @@ -100,7 +105,9 @@ typedef struct Target { Tcl_Command slaveCmd; /* Command for alias in slave interp. */ Tcl_Interp *slaveInterp; /* Slave Interpreter. */ } Target; +#endif +#if !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) /* * struct Master: * @@ -120,6 +127,7 @@ typedef struct Target { typedef struct Master { Tcl_HashTable slaveTable; /* Hash table for slave interpreters. * Maps from command names to Slave records. */ +#ifndef TCL_NO_CMDALIASES Tcl_HashTable targetTable; /* Hash table for Target Records. Contains * all Target records which denote aliases * from slaves or sibling interpreters that @@ -127,6 +135,7 @@ typedef struct Master { * table is used to remove dangling pointers * from the slave (or sibling) interpreters * when this interpreter is deleted. */ +#endif } Master; /* @@ -140,11 +149,13 @@ typedef struct InterpInfo { Slave slave; /* Information necessary for this interp to * function as a slave. */ } InterpInfo; +#endif /* !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) */ /* * Prototypes for local static procedures: */ +#ifndef TCL_NO_CMDALIASES static int AliasCreate _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Interp *slaveInterp, Tcl_Interp *masterInterp, Tcl_Obj *namePtr, Tcl_Obj *targetPtr, int objc, @@ -160,13 +171,17 @@ static int AliasObjCmd _ANSI_ARGS_((ClientData dummy, Tcl_Obj *CONST objv[])); static void AliasObjCmdDeleteProc _ANSI_ARGS_(( ClientData clientData)); +#endif +#if !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) static Tcl_Interp * GetInterp _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *pathPtr)); static Tcl_Interp * GetInterp2 _ANSI_ARGS_((Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static void InterpInfoDeleteProc _ANSI_ARGS_(( ClientData clientData, Tcl_Interp *interp)); +#endif /* !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) */ +#ifndef TCL_NO_SLAVEINTERP static Tcl_Interp * SlaveCreate _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *pathPtr, int safe)); static int SlaveEval _ANSI_ARGS_((Tcl_Interp *interp, @@ -190,6 +205,7 @@ static int SlaveObjCmd _ANSI_ARGS_((ClientData dummy, Tcl_Obj *CONST objv[])); static void SlaveObjCmdDeleteProc _ANSI_ARGS_(( ClientData clientData)); +#endif /* *--------------------------------------------------------------------------- @@ -210,6 +226,7 @@ static void SlaveObjCmdDeleteProc _ANSI_ARGS_(( *--------------------------------------------------------------------------- */ +#if !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) int TclInterpInit(interp) Tcl_Interp *interp; /* Interpreter to initialize. */ @@ -223,7 +240,9 @@ TclInterpInit(interp) masterPtr = &interpInfoPtr->master; Tcl_InitHashTable(&masterPtr->slaveTable, TCL_STRING_KEYS); +#ifndef TCL_NO_CMDALIASES Tcl_InitHashTable(&masterPtr->targetTable, TCL_ONE_WORD_KEYS); +#endif slavePtr = &interpInfoPtr->slave; slavePtr->masterInterp = NULL; @@ -237,6 +256,7 @@ TclInterpInit(interp) Tcl_CallWhenDeleted(interp, InterpInfoDeleteProc, NULL); return TCL_OK; } +#endif /* !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) */ /* *--------------------------------------------------------------------------- @@ -256,6 +276,7 @@ TclInterpInit(interp) *--------------------------------------------------------------------------- */ +#if !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) static void InterpInfoDeleteProc(clientData, interp) ClientData clientData; /* Ignored. */ @@ -265,9 +286,11 @@ InterpInfoDeleteProc(clientData, interp) InterpInfo *interpInfoPtr; Slave *slavePtr; Master *masterPtr; +#ifndef TCL_NO_CMDALIASES Tcl_HashSearch hSearch; Tcl_HashEntry *hPtr; Target *targetPtr; +#endif interpInfoPtr = (InterpInfo *) ((Interp *) interp)->interpInfo; @@ -281,6 +304,7 @@ InterpInfoDeleteProc(clientData, interp) } Tcl_DeleteHashTable(&masterPtr->slaveTable); +#ifndef TCL_NO_CMDALIASES /* * Tell any interps that have aliases to this interp that they should * delete those aliases. If the other interp was already dead, it @@ -295,6 +319,7 @@ InterpInfoDeleteProc(clientData, interp) hPtr = Tcl_NextHashEntry(&hSearch); } Tcl_DeleteHashTable(&masterPtr->targetTable); +#endif slavePtr = &interpInfoPtr->slave; if (slavePtr->interpCmd != NULL) { @@ -321,6 +346,7 @@ InterpInfoDeleteProc(clientData, interp) ckfree((char *) interpInfoPtr); } +#endif /* !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) */ /* *---------------------------------------------------------------------- @@ -338,6 +364,8 @@ InterpInfoDeleteProc(clientData, interp) * *---------------------------------------------------------------------- */ + +#if !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) /* ARGSUSED */ int Tcl_InterpObjCmd(clientData, interp, objc, objv) @@ -348,17 +376,58 @@ Tcl_InterpObjCmd(clientData, interp, objc, objv) { int index; static char *options[] = { - "alias", "aliases", "create", "delete", +#ifndef TCL_NO_CMDALIASES + "alias", "aliases", +#endif +#ifndef TCL_NO_SLAVEINTERP + "create", "delete", "eval", "exists", "expose", "hide", "hidden", "issafe", "invokehidden", "marktrusted", - "slaves", "share", "target", "transfer", + "slaves", +#endif +#ifndef TCL_NO_SLAVEINTERP +#ifndef TCL_NO_NONSTDCHAN + "share", +#endif +#endif +#ifndef TCL_NO_CMDALIASES + "target", +#endif +#ifndef TCL_NO_SLAVEINTERP +#ifndef TCL_NO_NONSTDCHAN + "transfer", +#endif +#endif NULL }; enum option { - OPT_ALIAS, OPT_ALIASES, OPT_CREATE, OPT_DELETE, - OPT_EVAL, OPT_EXISTS, OPT_EXPOSE, OPT_HIDE, - OPT_HIDDEN, OPT_ISSAFE, OPT_INVOKEHID, OPT_MARKTRUSTED, - OPT_SLAVES, OPT_SHARE, OPT_TARGET, OPT_TRANSFER +#ifndef TCL_NO_CMDALIASES + OPT_ALIAS + ,OPT_ALIASES +#endif +#ifndef TCL_NO_SLAVEINTERP +#ifndef TCL_NO_CMDALIASES + , +#endif + OPT_CREATE + ,OPT_DELETE + ,OPT_EVAL, OPT_EXISTS, OPT_EXPOSE, OPT_HIDE + ,OPT_HIDDEN, OPT_ISSAFE, OPT_INVOKEHID, OPT_MARKTRUSTED + ,OPT_SLAVES +#endif +#ifndef TCL_NO_SLAVEINTERP +#ifndef TCL_NO_NONSTDCHAN + ,OPT_SHARE +#endif +#endif +#ifndef TCL_NO_CMDALIASES + ,OPT_TARGET +#endif +#ifndef TCL_NO_SLAVEINTERP +#ifndef TCL_NO_NONSTDCHAN + ,OPT_TRANSFER +#endif +#endif }; @@ -371,6 +440,7 @@ Tcl_InterpObjCmd(clientData, interp, objc, objv) return TCL_ERROR; } switch ((enum option) index) { +#ifndef TCL_NO_CMDALIASES case OPT_ALIAS: { Tcl_Interp *slaveInterp, *masterInterp; @@ -415,6 +485,8 @@ Tcl_InterpObjCmd(clientData, interp, objc, objv) } return AliasList(interp, slaveInterp); } +#endif +#ifndef TCL_NO_SLAVEINTERP case OPT_CREATE: { int i, last, safe; Tcl_Obj *slavePtr; @@ -652,6 +724,9 @@ Tcl_InterpObjCmd(clientData, interp, objc, objv) } return TCL_OK; } +#endif +#ifndef TCL_NO_NONSTDCHAN +#ifndef TCL_NO_SLAVEINTERP case OPT_SHARE: { Tcl_Interp *slaveInterp; /* A slave. */ Tcl_Interp *masterInterp; /* Its master. */ @@ -678,6 +753,9 @@ Tcl_InterpObjCmd(clientData, interp, objc, objv) Tcl_RegisterChannel(slaveInterp, chan); return TCL_OK; } +#endif +#endif +#ifndef TCL_NO_CMDALIASES case OPT_TARGET: { Tcl_Interp *slaveInterp; InterpInfo *iiPtr; @@ -717,6 +795,9 @@ Tcl_InterpObjCmd(clientData, interp, objc, objv) } return TCL_OK; } +#endif +#ifndef TCL_NO_NONSTDCHAN +#ifndef TCL_NO_SLAVEINTERP case OPT_TRANSFER: { Tcl_Interp *slaveInterp; /* A slave. */ Tcl_Interp *masterInterp; /* Its master. */ @@ -747,9 +828,12 @@ Tcl_InterpObjCmd(clientData, interp, objc, objv) } return TCL_OK; } +#endif +#endif } return TCL_OK; } +#endif /* !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) */ /* *--------------------------------------------------------------------------- @@ -772,6 +856,7 @@ Tcl_InterpObjCmd(clientData, interp, objc, objv) *--------------------------------------------------------------------------- */ +#if !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) static Tcl_Interp * GetInterp2(interp, objc, objv) Tcl_Interp *interp; /* Default interp if no interp was specified @@ -788,6 +873,7 @@ GetInterp2(interp, objc, objv) return NULL; } } +#endif /* !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) */ /* *---------------------------------------------------------------------- @@ -805,6 +891,7 @@ GetInterp2(interp, objc, objv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_CMDALIASES int Tcl_CreateAlias(slaveInterp, slaveCmd, targetInterp, targetCmd, argc, argv) Tcl_Interp *slaveInterp; /* Interpreter for source command. */ @@ -843,6 +930,7 @@ Tcl_CreateAlias(slaveInterp, slaveCmd, targetInterp, targetCmd, argc, argv) return result; } +#endif /* *---------------------------------------------------------------------- @@ -860,6 +948,7 @@ Tcl_CreateAlias(slaveInterp, slaveCmd, targetInterp, targetCmd, argc, argv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_CMDALIASES int Tcl_CreateAliasObj(slaveInterp, slaveCmd, targetInterp, targetCmd, objc, objv) Tcl_Interp *slaveInterp; /* Interpreter for source command. */ @@ -885,6 +974,7 @@ Tcl_CreateAliasObj(slaveInterp, slaveCmd, targetInterp, targetCmd, objc, objv) Tcl_DecrRefCount(targetObjPtr); return result; } +#endif /* *---------------------------------------------------------------------- @@ -902,6 +992,7 @@ Tcl_CreateAliasObj(slaveInterp, slaveCmd, targetInterp, targetCmd, objc, objv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_CMDALIASES int Tcl_GetAlias(interp, aliasName, targetInterpPtr, targetNamePtr, argcPtr, argvPtr) @@ -945,6 +1036,7 @@ Tcl_GetAlias(interp, aliasName, targetInterpPtr, targetNamePtr, argcPtr, } return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -962,6 +1054,7 @@ Tcl_GetAlias(interp, aliasName, targetInterpPtr, targetNamePtr, argcPtr, *---------------------------------------------------------------------- */ +#ifndef TCL_NO_CMDALIASES int Tcl_GetAliasObj(interp, aliasName, targetInterpPtr, targetNamePtr, objcPtr, objvPtr) @@ -1002,6 +1095,7 @@ Tcl_GetAliasObj(interp, aliasName, targetInterpPtr, targetNamePtr, objcPtr, } return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -1025,6 +1119,7 @@ Tcl_GetAliasObj(interp, aliasName, targetInterpPtr, targetNamePtr, objcPtr, *---------------------------------------------------------------------- */ +#ifndef TCL_NO_CMDALIASES int TclPreventAliasLoop(interp, cmdInterp, cmd) Tcl_Interp *interp; /* Interp in which to report errors. */ @@ -1095,6 +1190,7 @@ TclPreventAliasLoop(interp, cmdInterp, cmd) /* NOTREACHED */ } +#endif /* *---------------------------------------------------------------------- @@ -1113,6 +1209,7 @@ TclPreventAliasLoop(interp, cmdInterp, cmd) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_CMDALIASES static int AliasCreate(interp, slaveInterp, masterInterp, namePtr, targetNamePtr, objc, objv) @@ -1224,6 +1321,7 @@ AliasCreate(interp, slaveInterp, masterInterp, namePtr, targetNamePtr, Tcl_SetObjResult(interp, namePtr); return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -1241,6 +1339,7 @@ AliasCreate(interp, slaveInterp, masterInterp, namePtr, targetNamePtr, *---------------------------------------------------------------------- */ +#ifndef TCL_NO_CMDALIASES static int AliasDelete(interp, slaveInterp, namePtr) Tcl_Interp *interp; /* Interpreter for result & errors. */ @@ -1268,6 +1367,7 @@ AliasDelete(interp, slaveInterp, namePtr) Tcl_DeleteCommandFromToken(slaveInterp, aliasPtr->slaveCmd); return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -1288,6 +1388,7 @@ AliasDelete(interp, slaveInterp, namePtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_CMDALIASES static int AliasDescribe(interp, slaveInterp, namePtr) Tcl_Interp *interp; /* Interpreter for result & errors. */ @@ -1313,6 +1414,7 @@ AliasDescribe(interp, slaveInterp, namePtr) Tcl_SetObjResult(interp, aliasPtr->prefixPtr); return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -1330,6 +1432,7 @@ AliasDescribe(interp, slaveInterp, namePtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_CMDALIASES static int AliasList(interp, slaveInterp) Tcl_Interp *interp; /* Interp for data return. */ @@ -1351,6 +1454,7 @@ AliasList(interp, slaveInterp) } return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -1374,6 +1478,7 @@ AliasList(interp, slaveInterp) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_CMDALIASES static int AliasObjCmd(clientData, interp, objc, objv) ClientData clientData; /* Alias record. */ @@ -1460,6 +1565,7 @@ AliasObjCmd(clientData, interp, objc, objv) Tcl_Release((ClientData) targetInterp); return result; } +#endif /* *---------------------------------------------------------------------- @@ -1479,6 +1585,7 @@ AliasObjCmd(clientData, interp, objc, objv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_CMDALIASES static void AliasObjCmdDeleteProc(clientData) ClientData clientData; /* The alias record for this alias. */ @@ -1498,6 +1605,7 @@ AliasObjCmdDeleteProc(clientData) ckfree((char *) aliasPtr); } +#endif /* *---------------------------------------------------------------------- @@ -1522,6 +1630,7 @@ AliasObjCmdDeleteProc(clientData) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_SLAVEINTERP Tcl_Interp * Tcl_CreateSlave(interp, slavePath, isSafe) Tcl_Interp *interp; /* Interpreter to start search at. */ @@ -1537,6 +1646,7 @@ Tcl_CreateSlave(interp, slavePath, isSafe) return slaveInterp; } +#endif /* *---------------------------------------------------------------------- @@ -1555,6 +1665,7 @@ Tcl_CreateSlave(interp, slavePath, isSafe) *---------------------------------------------------------------------- */ +#if !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) Tcl_Interp * Tcl_GetSlave(interp, slavePath) Tcl_Interp *interp; /* Interpreter to start search from. */ @@ -1569,6 +1680,7 @@ Tcl_GetSlave(interp, slavePath) return slaveInterp; } +#endif /* !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) */ /* *---------------------------------------------------------------------- @@ -1586,6 +1698,7 @@ Tcl_GetSlave(interp, slavePath) *---------------------------------------------------------------------- */ +#if !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) Tcl_Interp * Tcl_GetMaster(interp) Tcl_Interp *interp; /* Get the master of this interpreter. */ @@ -1598,6 +1711,7 @@ Tcl_GetMaster(interp) slavePtr = &((InterpInfo *) ((Interp *) interp)->interpInfo)->slave; return slavePtr->masterInterp; } +#endif /* !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) */ /* *---------------------------------------------------------------------- @@ -1625,6 +1739,7 @@ Tcl_GetMaster(interp) *---------------------------------------------------------------------- */ +#if !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) int Tcl_GetInterpPath(askingInterp, targetInterp) Tcl_Interp *askingInterp; /* Interpreter to start search from. */ @@ -1647,6 +1762,7 @@ Tcl_GetInterpPath(askingInterp, targetInterp) iiPtr->slave.slaveEntryPtr)); return TCL_OK; } +#endif /* !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) */ /* *---------------------------------------------------------------------- @@ -1665,6 +1781,7 @@ Tcl_GetInterpPath(askingInterp, targetInterp) *---------------------------------------------------------------------- */ +#if !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) static Tcl_Interp * GetInterp(interp, pathPtr) Tcl_Interp *interp; /* Interp. to start search from. */ @@ -1704,6 +1821,7 @@ GetInterp(interp, pathPtr) } return searchInterp; } +#endif /* !(defined(TCL_NO_SLAVEINTERP) && defined(TCL_NO_CMDALIASES)) */ /* *---------------------------------------------------------------------- @@ -1724,6 +1842,7 @@ GetInterp(interp, pathPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_SLAVEINTERP static Tcl_Interp * SlaveCreate(interp, pathPtr, safe) Tcl_Interp *interp; /* Interp. to start search from. */ @@ -1802,6 +1921,7 @@ SlaveCreate(interp, pathPtr, safe) return NULL; } +#endif /* *---------------------------------------------------------------------- @@ -1820,6 +1940,7 @@ SlaveCreate(interp, pathPtr, safe) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_SLAVEINTERP static int SlaveObjCmd(clientData, interp, objc, objv) ClientData clientData; /* Slave interpreter. */ @@ -1830,12 +1951,18 @@ SlaveObjCmd(clientData, interp, objc, objv) Tcl_Interp *slaveInterp; int index; static char *options[] = { - "alias", "aliases", "eval", "expose", +#ifndef TCL_NO_CMDALIASES + "alias", "aliases", +#endif + "eval", "expose", "hide", "hidden", "issafe", "invokehidden", "marktrusted", NULL }; enum options { - OPT_ALIAS, OPT_ALIASES, OPT_EVAL, OPT_EXPOSE, +#ifndef TCL_NO_CMDALIASES + OPT_ALIAS, OPT_ALIASES, +#endif + OPT_EVAL, OPT_EXPOSE, OPT_HIDE, OPT_HIDDEN, OPT_ISSAFE, OPT_INVOKEHIDDEN, OPT_MARKTRUSTED }; @@ -1855,6 +1982,7 @@ SlaveObjCmd(clientData, interp, objc, objv) } switch ((enum options) index) { +#ifndef TCL_NO_CMDALIASES case OPT_ALIAS: { if (objc == 3) { return AliasDescribe(interp, slaveInterp, objv[2]); @@ -1874,6 +2002,7 @@ SlaveObjCmd(clientData, interp, objc, objv) case OPT_ALIASES: { return AliasList(interp, slaveInterp); } +#endif case OPT_EVAL: { if (objc < 3) { Tcl_WrongNumArgs(interp, 2, objv, "arg ?arg ...?"); @@ -1949,6 +2078,7 @@ SlaveObjCmd(clientData, interp, objc, objv) return TCL_ERROR; } +#endif /* *---------------------------------------------------------------------- @@ -1969,6 +2099,7 @@ SlaveObjCmd(clientData, interp, objc, objv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_SLAVEINTERP static void SlaveObjCmdDeleteProc(clientData) ClientData clientData; /* The SlaveRecord for the command. */ @@ -1997,6 +2128,7 @@ SlaveObjCmdDeleteProc(clientData) Tcl_DeleteInterp(slavePtr->slaveInterp); } } +#endif /* *---------------------------------------------------------------------- @@ -2014,6 +2146,7 @@ SlaveObjCmdDeleteProc(clientData) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_SLAVEINTERP static int SlaveEval(interp, slaveInterp, objc, objv) Tcl_Interp *interp; /* Interp for error return. */ @@ -2041,6 +2174,7 @@ SlaveEval(interp, slaveInterp, objc, objv) Tcl_Release((ClientData) slaveInterp); return result; } +#endif /* *---------------------------------------------------------------------- @@ -2059,6 +2193,7 @@ SlaveEval(interp, slaveInterp, objc, objv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_SLAVEINTERP static int SlaveExpose(interp, slaveInterp, objc, objv) Tcl_Interp *interp; /* Interp for error return. */ @@ -2083,6 +2218,7 @@ SlaveExpose(interp, slaveInterp, objc, objv) } return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -2101,6 +2237,7 @@ SlaveExpose(interp, slaveInterp, objc, objv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_SLAVEINTERP static int SlaveHide(interp, slaveInterp, objc, objv) Tcl_Interp *interp; /* Interp for error return. */ @@ -2125,6 +2262,7 @@ SlaveHide(interp, slaveInterp, objc, objv) } return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -2143,6 +2281,7 @@ SlaveHide(interp, slaveInterp, objc, objv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_SLAVEINTERP static int SlaveHidden(interp, slaveInterp) Tcl_Interp *interp; /* Interp for data return. */ @@ -2166,6 +2305,7 @@ SlaveHidden(interp, slaveInterp) } return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -2183,6 +2323,7 @@ SlaveHidden(interp, slaveInterp) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_SLAVEINTERP static int SlaveInvokeHidden(interp, slaveInterp, global, objc, objv) Tcl_Interp *interp; /* Interp for error return. */ @@ -2216,6 +2357,7 @@ SlaveInvokeHidden(interp, slaveInterp, global, objc, objv) Tcl_Release((ClientData) slaveInterp); return result; } +#endif /* *---------------------------------------------------------------------- @@ -2234,6 +2376,7 @@ SlaveInvokeHidden(interp, slaveInterp, global, objc, objv) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_SLAVEINTERP static int SlaveMarkTrusted(interp, slaveInterp) Tcl_Interp *interp; /* Interp for error return. */ @@ -2249,6 +2392,7 @@ SlaveMarkTrusted(interp, slaveInterp) ((Interp *) slaveInterp)->flags &= ~SAFE_INTERP; return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -2340,6 +2484,13 @@ Tcl_MakeSafe(interp) Tcl_UnsetVar(interp, "tcl_library", TCL_GLOBAL_ONLY); Tcl_UnsetVar(interp, "tcl_pkgPath", TCL_GLOBAL_ONLY); +#ifdef TCL_NO_NONSTDCHAN + /* IOS FIXME: Unregister is still required to make sub interpreters safe by + * removing the std* channels from them. + * This means that removal of sub interp fucntionality allows the removal of this + * functionality too. + */ +#endif /* * Remove the standard channels from the interpreter; safe interpreters * do not ordinarily have access to stdin, stdout and stderr. diff --git a/generic/tclLoad.c b/generic/tclLoad.c index 3b36b9c..e5486b1 100644 --- a/generic/tclLoad.c +++ b/generic/tclLoad.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclLoad.c,v 1.4 1999/12/01 00:08:28 hobbs Exp $ + * RCS: @(#) $Id: tclLoad.c,v 1.4.12.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include "tclInt.h" @@ -104,6 +104,8 @@ static void LoadCleanupProc _ANSI_ARGS_((ClientData clientData, *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_LOADCMD int Tcl_LoadObjCmd(dummy, interp, objc, objv) ClientData dummy; /* Not used. */ @@ -156,6 +158,7 @@ Tcl_LoadObjCmd(dummy, interp, objc, objv) */ target = interp; +#ifndef TCL_NO_SLAVEINTERP if (objc == 4) { char *slaveIntName; slaveIntName = Tcl_GetString(objv[3]); @@ -164,6 +167,7 @@ Tcl_LoadObjCmd(dummy, interp, objc, objv) return TCL_ERROR; } } +#endif /* * Scan through the packages that are currently loaded to see if the @@ -414,6 +418,8 @@ Tcl_LoadObjCmd(dummy, interp, objc, objv) Tcl_DStringFree(&tmp); return code; } +#endif +#endif /* *---------------------------------------------------------------------- @@ -529,9 +535,11 @@ TclGetLoadedPackages(interp, targetName) * otherwise, just return info about this * interpreter. */ { - Tcl_Interp *target; LoadedPackage *pkgPtr; +#ifndef TCL_NO_SLAVEINTERP + Tcl_Interp *target; InterpPackage *ipPtr; +#endif char *prefix; if (targetName == NULL) { @@ -553,6 +561,7 @@ TclGetLoadedPackages(interp, targetName) return TCL_OK; } +#ifndef TCL_NO_SLAVEINTERP /* * Return information about only the packages that are loaded in * a given interpreter. @@ -560,7 +569,9 @@ TclGetLoadedPackages(interp, targetName) target = Tcl_GetSlave(interp, targetName); if (target == NULL) { +#endif return TCL_ERROR; +#ifndef TCL_NO_SLAVEINTERP } ipPtr = (InterpPackage *) Tcl_GetAssocData(target, "tclLoad", (Tcl_InterpDeleteProc **) NULL); @@ -574,6 +585,7 @@ TclGetLoadedPackages(interp, targetName) prefix = " {"; } return TCL_OK; +#endif } /* diff --git a/generic/tclLoadNone.c b/generic/tclLoadNone.c index 5228292..176a5f1 100644 --- a/generic/tclLoadNone.c +++ b/generic/tclLoadNone.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclLoadNone.c,v 1.4 1999/05/07 20:07:40 stanton Exp $ + * RCS: @(#) $Id: tclLoadNone.c,v 1.4.22.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include "tclInt.h" @@ -34,6 +34,7 @@ *---------------------------------------------------------------------- */ +#ifndef TCL_NO_LOADCMD int TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) Tcl_Interp *interp; /* Used for error reporting. */ @@ -53,6 +54,7 @@ TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) TCL_STATIC); return TCL_ERROR; } +#endif /* *---------------------------------------------------------------------- @@ -102,6 +104,7 @@ TclGuessPackageName(fileName, bufPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_LOADCMD void TclpUnloadFile(clientData) ClientData clientData; /* ClientData returned by a previous call @@ -110,3 +113,4 @@ TclpUnloadFile(clientData) * file. */ { } +#endif diff --git a/generic/tclMain.c b/generic/tclMain.c index cae1201..46721b6 100644 --- a/generic/tclMain.c +++ b/generic/tclMain.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMain.c,v 1.7.2.2 2001/08/28 00:12:45 hobbs Exp $ + * RCS: @(#) $Id: tclMain.c,v 1.7.2.2.2.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include "tcl.h" @@ -66,8 +66,10 @@ Tcl_ThreadDataKey dataKey; */ static void Prompt _ANSI_ARGS_((Tcl_Interp *interp, int partial)); +#ifndef TCL_NO_FILEEVENTS static void StdinProc _ANSI_ARGS_((ClientData clientData, int mask)); +#endif /* @@ -218,6 +220,9 @@ Tcl_Main(argc, argv, appInitProc) } } +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN + /* IOS FIXME : See Tcl_EvalFile */ /* * If a script file was specified then just source that file * and quit. @@ -242,6 +247,8 @@ Tcl_Main(argc, argv, appInitProc) } goto done; } +#endif +#endif Tcl_DStringFree(&argString); /* @@ -343,10 +350,12 @@ Tcl_Main(argc, argv, appInitProc) * channel handler for stdin. */ +#ifndef TCL_NO_FILEEVENTS if (inChannel) { Tcl_CreateChannelHandler(inChannel, TCL_READABLE, StdinProc, (ClientData) inChannel); } +#endif if (tsdPtr->tty) { Prompt(interp, 0); } @@ -434,6 +443,7 @@ Tcl_SetMainLoop(proc) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILEEVENTS /* ARGSUSED */ static void StdinProc(clientData, mask) @@ -508,6 +518,7 @@ StdinProc(clientData, mask) } Tcl_ResetResult(interp); } +#endif /* *---------------------------------------------------------------------- diff --git a/generic/tclPipe.c b/generic/tclPipe.c index 4f39c93..9ac6278 100644 --- a/generic/tclPipe.c +++ b/generic/tclPipe.c @@ -10,12 +10,13 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclPipe.c,v 1.3 1999/04/16 00:46:51 stanton Exp $ + * RCS: @(#) $Id: tclPipe.c,v 1.3.30.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include "tclInt.h" #include "tclPort.h" +#ifndef TCL_NO_PIPES /* * A linked list of the following structures is used to keep track * of child processes that have been detached but haven't exited @@ -38,9 +39,11 @@ TCL_DECLARE_MUTEX(pipeMutex) /* Guard access to detList. */ * Declarations for local procedures defined in this file: */ +#ifndef TCL_NO_FILESYSTEM static TclFile FileForRedirect _ANSI_ARGS_((Tcl_Interp *interp, char *spec, int atOk, char *arg, char *nextArg, int flags, int *skipPtr, int *closePtr, int *releasePtr)); +#endif /* *---------------------------------------------------------------------- @@ -63,6 +66,7 @@ static TclFile FileForRedirect _ANSI_ARGS_((Tcl_Interp *interp, *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static TclFile FileForRedirect(interp, spec, atOK, arg, nextArg, flags, skipPtr, closePtr, releasePtr) @@ -155,6 +159,7 @@ FileForRedirect(interp, spec, atOK, arg, nextArg, flags, skipPtr, closePtr, "\" as last word in command", (char *) NULL); return NULL; } +#endif /* *---------------------------------------------------------------------- @@ -192,7 +197,6 @@ Tcl_DetachPids(numPids, pidPtr) detList = detPtr; } Tcl_MutexUnlock(&pipeMutex); - } /* @@ -434,6 +438,7 @@ TclCleanupChildren(interp, numPids, pidPtr, errorChan) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclCreatePipeline(interp, argc, argv, pidArrayPtr, inPipePtr, outPipePtr, errFilePtr) @@ -952,6 +957,7 @@ error: numPids = -1; goto cleanup; } +#endif /* *---------------------------------------------------------------------- @@ -987,6 +993,7 @@ error: *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM Tcl_Channel Tcl_OpenCommandChannel(interp, argc, argv, flags) Tcl_Interp *interp; /* Interpreter for error reporting. Can @@ -1059,3 +1066,5 @@ error: } return NULL; } +#endif /* TCL_NO_FILESYSTEM */ +#endif /* TCL_NO_PIPES */ diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index f81cbee..2813da0 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclStubInit.c,v 1.35.2.7 2001/10/17 19:29:25 das Exp $ + * RCS: @(#) $Id: tclStubInit.c,v 1.35.2.7.2.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include "tclInt.h" @@ -43,28 +43,60 @@ TclIntStubs tclIntStubs = { TCL_STUB_MAGIC, NULL, +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 0*/ +#else /* TCL_NO_FILESYSTEM */ TclAccess, /* 0 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 1*/ +#else /* TCL_NO_FILESYSTEM */ TclAccessDeleteProc, /* 1 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 2*/ +#else /* TCL_NO_FILESYSTEM */ TclAccessInsertProc, /* 2 */ +#endif /* TCL_NO_FILESYSTEM */ TclAllocateFreeObjects, /* 3 */ NULL, /* 4 */ #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ +#if defined(TCL_NO_PIPES) + NULL, /* 5*/ +#else /* TCL_NO_PIPES */ TclCleanupChildren, /* 5 */ +#endif /* TCL_NO_PIPES */ #endif /* UNIX */ #ifdef __WIN32__ +#if defined(TCL_NO_PIPES) + NULL, /* 5*/ +#else /* TCL_NO_PIPES */ TclCleanupChildren, /* 5 */ +#endif /* TCL_NO_PIPES */ #endif /* __WIN32__ */ #ifdef MAC_TCL NULL, /* 5 */ #endif /* MAC_TCL */ TclCleanupCommand, /* 6 */ TclCopyAndCollapse, /* 7 */ +#if defined(TCL_NO_CHANNELCOPY) + NULL, /* 8*/ +#else /* TCL_NO_CHANNELCOPY */ TclCopyChannel, /* 8 */ +#endif /* TCL_NO_CHANNELCOPY */ #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ +#if defined(TCL_NO_FILESYSTEM) || defined(TCL_NO_PIPES) + NULL, /* 9*/ +#else /* TCL_NO_FILESYSTEM TCL_NO_PIPES */ TclCreatePipeline, /* 9 */ +#endif /* TCL_NO_FILESYSTEM TCL_NO_PIPES */ #endif /* UNIX */ #ifdef __WIN32__ +#if defined(TCL_NO_FILESYSTEM) || defined(TCL_NO_PIPES) + NULL, /* 9*/ +#else /* TCL_NO_FILESYSTEM TCL_NO_PIPES */ TclCreatePipeline, /* 9 */ +#endif /* TCL_NO_FILESYSTEM TCL_NO_PIPES */ #endif /* __WIN32__ */ #ifdef MAC_TCL NULL, /* 9 */ @@ -72,15 +104,39 @@ TclIntStubs tclIntStubs = { TclCreateProc, /* 10 */ TclDeleteCompiledLocalVars, /* 11 */ TclDeleteVars, /* 12 */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 13*/ +#else /* TCL_NO_FILESYSTEM */ TclDoGlob, /* 13 */ +#endif /* TCL_NO_FILESYSTEM */ TclDumpMemoryInfo, /* 14 */ NULL, /* 15 */ TclExprFloatError, /* 16 */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 17*/ +#else /* TCL_NO_FILESYSTEM */ TclFileAttrsCmd, /* 17 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 18*/ +#else /* TCL_NO_FILESYSTEM */ TclFileCopyCmd, /* 18 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 19*/ +#else /* TCL_NO_FILESYSTEM */ TclFileDeleteCmd, /* 19 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 20*/ +#else /* TCL_NO_FILESYSTEM */ TclFileMakeDirsCmd, /* 20 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 21*/ +#else /* TCL_NO_FILESYSTEM */ TclFileRenameCmd, /* 21 */ +#endif /* TCL_NO_FILESYSTEM */ TclFindElement, /* 22 */ TclFindProc, /* 23 */ TclFormatInt, /* 24 */ @@ -90,7 +146,11 @@ TclIntStubs tclIntStubs = { TclpGetDefaultStdChannel, /* 28 */ TclGetElementOfIndexedArray, /* 29 */ NULL, /* 30 */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 31*/ +#else /* TCL_NO_FILESYSTEM */ TclGetExtension, /* 31 */ +#endif /* TCL_NO_FILESYSTEM */ TclGetFrame, /* 32 */ TclGetInterpProc, /* 33 */ TclGetIntForIndex, /* 34 */ @@ -101,7 +161,11 @@ TclIntStubs tclIntStubs = { TclGetObjInterpProc, /* 39 */ TclGetOpenMode, /* 40 */ TclGetOriginalCommand, /* 41 */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 42*/ +#else /* TCL_NO_FILESYSTEM */ TclpGetUserHome, /* 42 */ +#endif /* TCL_NO_FILESYSTEM */ TclGlobalInvoke, /* 43 */ TclGuessPackageName, /* 44 */ TclHideUnsafeCommands, /* 45 */ @@ -110,7 +174,11 @@ TclIntStubs tclIntStubs = { TclIncrIndexedScalar, /* 48 */ TclIncrVar2, /* 49 */ TclInitCompiledLocals, /* 50 */ +#if defined(TCL_NO_SLAVEINTERP) && defined (TCL_NO_CMDALIASES) + NULL, /* 51*/ +#else /* TCL_NO_SLAVEINTERP TCL_NO_CMDALIASES */ TclInterpInit, /* 51 */ +#endif /* TCL_NO_SLAVEINTERP TCL_NO_CMDALIASES */ TclInvoke, /* 52 */ TclInvokeObjectCommand, /* 53 */ TclInvokeStringCommand, /* 54 */ @@ -118,43 +186,99 @@ TclIntStubs tclIntStubs = { NULL, /* 56 */ NULL, /* 57 */ TclLookupVar, /* 58 */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 59*/ +#else /* TCL_NO_FILESYSTEM */ TclpMatchFiles, /* 59 */ +#endif /* TCL_NO_FILESYSTEM */ TclNeedSpace, /* 60 */ TclNewProcBodyObj, /* 61 */ TclObjCommandComplete, /* 62 */ TclObjInterpProc, /* 63 */ TclObjInvoke, /* 64 */ TclObjInvokeGlobal, /* 65 */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 66*/ +#else /* TCL_NO_FILESYSTEM */ TclOpenFileChannelDeleteProc, /* 66 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 67*/ +#else /* TCL_NO_FILESYSTEM */ TclOpenFileChannelInsertProc, /* 67 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 68*/ +#else /* TCL_NO_FILESYSTEM */ TclpAccess, /* 68 */ +#endif /* TCL_NO_FILESYSTEM */ TclpAlloc, /* 69 */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 70*/ +#else /* TCL_NO_FILESYSTEM */ TclpCopyFile, /* 70 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 71*/ +#else /* TCL_NO_FILESYSTEM */ TclpCopyDirectory, /* 71 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 72*/ +#else /* TCL_NO_FILESYSTEM */ TclpCreateDirectory, /* 72 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 73*/ +#else /* TCL_NO_FILESYSTEM */ TclpDeleteFile, /* 73 */ +#endif /* TCL_NO_FILESYSTEM */ TclpFree, /* 74 */ TclpGetClicks, /* 75 */ TclpGetSeconds, /* 76 */ TclpGetTime, /* 77 */ TclpGetTimeZone, /* 78 */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 79*/ +#else /* TCL_NO_FILESYSTEM */ TclpListVolumes, /* 79 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) || defined(TCL_NO_NONSTDCHAN) + NULL, /* 80*/ +#else /* TCL_NO_FILESYSTEM TCL_NO_NONSTDCHAN */ TclpOpenFileChannel, /* 80 */ +#endif /* TCL_NO_FILESYSTEM TCL_NO_NONSTDCHAN */ TclpRealloc, /* 81 */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 82*/ +#else /* TCL_NO_FILESYSTEM */ TclpRemoveDirectory, /* 82 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 83*/ +#else /* TCL_NO_FILESYSTEM */ TclpRenameFile, /* 83 */ +#endif /* TCL_NO_FILESYSTEM */ NULL, /* 84 */ NULL, /* 85 */ NULL, /* 86 */ NULL, /* 87 */ TclPrecTraceProc, /* 88 */ +#if defined(TCL_NO_CMDALIASES) + NULL, /* 89*/ +#else /* TCL_NO_CMDALIASES */ TclPreventAliasLoop, /* 89 */ +#endif /* TCL_NO_CMDALIASES */ NULL, /* 90 */ TclProcCleanupProc, /* 91 */ TclProcCompileProc, /* 92 */ TclProcDeleteProc, /* 93 */ TclProcInterpProc, /* 94 */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 95*/ +#else /* TCL_NO_FILESYSTEM */ TclpStat, /* 95 */ +#endif /* TCL_NO_FILESYSTEM */ TclRenameCommand, /* 96 */ TclResetShadowedCmdRefs, /* 97 */ TclServiceIdle, /* 98 */ @@ -180,9 +304,21 @@ TclIntStubs tclIntStubs = { #ifdef MAC_TCL NULL, /* 104 */ #endif /* MAC_TCL */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 105*/ +#else /* TCL_NO_FILESYSTEM */ TclStat, /* 105 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 106*/ +#else /* TCL_NO_FILESYSTEM */ TclStatDeleteProc, /* 106 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 107*/ +#else /* TCL_NO_FILESYSTEM */ TclStatInsertProc, /* 107 */ +#endif /* TCL_NO_FILESYSTEM */ TclTeardownNamespace, /* 108 */ TclUpdateReturnInfo, /* 109 */ NULL, /* 110 */ @@ -212,11 +348,23 @@ TclIntStubs tclIntStubs = { TclpStrftime, /* 134 */ TclpCheckStackSpace, /* 135 */ NULL, /* 136 */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 137*/ +#else /* TCL_NO_FILESYSTEM */ TclpChdir, /* 137 */ +#endif /* TCL_NO_FILESYSTEM */ TclGetEnv, /* 138 */ +#if defined(TCL_NO_FILESYSTEM) || defined(TCL_NO_LOADCMD) + NULL, /* 139*/ +#else /* TCL_NO_FILESYSTEM TCL_NO_LOADCMD */ TclpLoadFile, /* 139 */ +#endif /* TCL_NO_FILESYSTEM TCL_NO_LOADCMD */ TclLooksLikeInt, /* 140 */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 141*/ +#else /* TCL_NO_FILESYSTEM */ TclpGetCwd, /* 141 */ +#endif /* TCL_NO_FILESYSTEM */ TclSetByteCodeFromAny, /* 142 */ TclAddLiteralObj, /* 143 */ TclHideLiteral, /* 144 */ @@ -227,17 +375,33 @@ TclIntStubs tclIntStubs = { TclHandleRelease, /* 149 */ TclRegAbout, /* 150 */ TclRegExpRangeUniChar, /* 151 */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 152*/ +#else /* TCL_NO_FILESYSTEM */ TclSetLibraryPath, /* 152 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 153*/ +#else /* TCL_NO_FILESYSTEM */ TclGetLibraryPath, /* 153 */ +#endif /* TCL_NO_FILESYSTEM */ NULL, /* 154 */ NULL, /* 155 */ TclRegError, /* 156 */ TclVarTraceExists, /* 157 */ TclSetStartupScriptFileName, /* 158 */ TclGetStartupScriptFileName, /* 159 */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 160*/ +#else /* TCL_NO_FILESYSTEM */ TclpMatchFilesTypes, /* 160 */ +#endif /* TCL_NO_FILESYSTEM */ TclChannelTransform, /* 161 */ +#if defined(TCL_NO_FILEEVENTS) + NULL, /* 162*/ +#else /* TCL_NO_FILEEVENTS */ TclChannelEventScriptInvoker, /* 162 */ +#endif /* TCL_NO_FILEEVENTS */ TclGetInstructionTable, /* 163 */ TclExpandCodeArray, /* 164 */ }; @@ -246,16 +410,48 @@ TclIntPlatStubs tclIntPlatStubs = { TCL_STUB_MAGIC, NULL, #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ +#if defined(TCL_NO_PIPES) + NULL, /* 0*/ +#else /* TCL_NO_PIPES */ TclGetAndDetachPids, /* 0 */ +#endif /* TCL_NO_PIPES */ +#if defined(TCL_NO_PIPES) + NULL, /* 1*/ +#else /* TCL_NO_PIPES */ TclpCloseFile, /* 1 */ +#endif /* TCL_NO_PIPES */ +#if defined(TCL_NO_PIPES) + NULL, /* 2*/ +#else /* TCL_NO_PIPES */ TclpCreateCommandChannel, /* 2 */ +#endif /* TCL_NO_PIPES */ +#if defined(TCL_NO_PIPES) + NULL, /* 3*/ +#else /* TCL_NO_PIPES */ TclpCreatePipe, /* 3 */ +#endif /* TCL_NO_PIPES */ +#if defined(TCL_NO_PIPES) + NULL, /* 4*/ +#else /* TCL_NO_PIPES */ TclpCreateProcess, /* 4 */ +#endif /* TCL_NO_PIPES */ NULL, /* 5 */ +#if defined(TCL_NO_PIPES) + NULL, /* 6*/ +#else /* TCL_NO_PIPES */ TclpMakeFile, /* 6 */ +#endif /* TCL_NO_PIPES */ +#if defined(TCL_NO_PIPES) + NULL, /* 7*/ +#else /* TCL_NO_PIPES */ TclpOpenFile, /* 7 */ +#endif /* TCL_NO_PIPES */ TclUnixWaitForFile, /* 8 */ +#if defined(TCL_NO_PIPES) + NULL, /* 9*/ +#else /* TCL_NO_PIPES */ TclpCreateTempFile, /* 9 */ +#endif /* TCL_NO_PIPES */ #endif /* UNIX */ #ifdef __WIN32__ TclWinConvertError, /* 0 */ @@ -269,7 +465,11 @@ TclIntPlatStubs tclIntPlatStubs = { TclpGetPid, /* 8 */ TclWinGetPlatformId, /* 9 */ NULL, /* 10 */ +#if defined(TCL_NO_PIPES) + NULL, /* 11*/ +#else /* TCL_NO_PIPES */ TclGetAndDetachPids, /* 11 */ +#endif /* TCL_NO_PIPES */ TclpCloseFile, /* 12 */ TclpCreateCommandChannel, /* 13 */ TclpCreatePipe, /* 14 */ @@ -356,7 +556,11 @@ TclStubs tclStubs = { Tcl_DbCkfree, /* 7 */ Tcl_DbCkrealloc, /* 8 */ #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ +#if defined(TCL_NO_FILEEVENTS) + NULL, /* 9*/ +#else /* TCL_NO_FILEEVENTS */ Tcl_CreateFileHandler, /* 9 */ +#endif /* TCL_NO_FILEEVENTS */ #endif /* UNIX */ #ifdef __WIN32__ NULL, /* 9 */ @@ -365,7 +569,11 @@ TclStubs tclStubs = { NULL, /* 9 */ #endif /* MAC_TCL */ #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ +#if defined(TCL_NO_FILEEVENTS) + NULL, /* 10*/ +#else /* TCL_NO_FILEEVENTS */ Tcl_DeleteFileHandler, /* 10 */ +#endif /* TCL_NO_FILEEVENTS */ #endif /* UNIX */ #ifdef __WIN32__ NULL, /* 10 */ @@ -448,10 +656,22 @@ TclStubs tclStubs = { Tcl_Concat, /* 83 */ Tcl_ConvertElement, /* 84 */ Tcl_ConvertCountedElement, /* 85 */ +#if defined(TCL_NO_CMDALIASES) + NULL, /* 86*/ +#else /* TCL_NO_CMDALIASES */ Tcl_CreateAlias, /* 86 */ +#endif /* TCL_NO_CMDALIASES */ +#if defined(TCL_NO_CMDALIASES) + NULL, /* 87*/ +#else /* TCL_NO_CMDALIASES */ Tcl_CreateAliasObj, /* 87 */ +#endif /* TCL_NO_CMDALIASES */ Tcl_CreateChannel, /* 88 */ +#if defined(TCL_NO_FILEEVENTS) + NULL, /* 89*/ +#else /* TCL_NO_FILEEVENTS */ Tcl_CreateChannelHandler, /* 89 */ +#endif /* TCL_NO_FILEEVENTS */ Tcl_CreateCloseHandler, /* 90 */ Tcl_CreateCommand, /* 91 */ Tcl_CreateEventSource, /* 92 */ @@ -459,11 +679,19 @@ TclStubs tclStubs = { Tcl_CreateInterp, /* 94 */ Tcl_CreateMathFunc, /* 95 */ Tcl_CreateObjCommand, /* 96 */ +#if defined(TCL_NO_SLAVEINTERP) + NULL, /* 97*/ +#else /* TCL_NO_SLAVEINTERP */ Tcl_CreateSlave, /* 97 */ +#endif /* TCL_NO_SLAVEINTERP */ Tcl_CreateTimerHandler, /* 98 */ Tcl_CreateTrace, /* 99 */ Tcl_DeleteAssocData, /* 100 */ +#if defined(TCL_NO_FILEEVENTS) + NULL, /* 101*/ +#else /* TCL_NO_FILEEVENTS */ Tcl_DeleteChannelHandler, /* 101 */ +#endif /* TCL_NO_FILEEVENTS */ Tcl_DeleteCloseHandler, /* 102 */ Tcl_DeleteCommand, /* 103 */ Tcl_DeleteCommandFromToken, /* 104 */ @@ -474,10 +702,18 @@ TclStubs tclStubs = { Tcl_DeleteHashTable, /* 109 */ Tcl_DeleteInterp, /* 110 */ #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ +#if defined(TCL_NO_PIPES) + NULL, /* 111*/ +#else /* TCL_NO_PIPES */ Tcl_DetachPids, /* 111 */ +#endif /* TCL_NO_PIPES */ #endif /* UNIX */ #ifdef __WIN32__ +#if defined(TCL_NO_PIPES) + NULL, /* 111*/ +#else /* TCL_NO_PIPES */ Tcl_DetachPids, /* 111 */ +#endif /* TCL_NO_PIPES */ #endif /* __WIN32__ */ #ifdef MAC_TCL NULL, /* 111 */ @@ -500,7 +736,11 @@ TclStubs tclStubs = { Tcl_ErrnoId, /* 127 */ Tcl_ErrnoMsg, /* 128 */ Tcl_Eval, /* 129 */ +#if defined(TCL_NO_FILESYSTEM) || defined(TCL_NO_NONSTDCHAN) + NULL, /* 130*/ +#else /* TCL_NO_FILESYSTEM TCL_NO_NONSTDCHAN */ Tcl_EvalFile, /* 130 */ +#endif /* TCL_NO_FILESYSTEM TCL_NO_NONSTDCHAN */ Tcl_EvalObj, /* 131 */ Tcl_EventuallyFree, /* 132 */ Tcl_Exit, /* 133 */ @@ -518,8 +758,16 @@ TclStubs tclStubs = { Tcl_FirstHashEntry, /* 145 */ Tcl_Flush, /* 146 */ Tcl_FreeResult, /* 147 */ +#if defined(TCL_NO_CMDALIASES) + NULL, /* 148*/ +#else /* TCL_NO_CMDALIASES */ Tcl_GetAlias, /* 148 */ +#endif /* TCL_NO_CMDALIASES */ +#if defined(TCL_NO_CMDALIASES) + NULL, /* 149*/ +#else /* TCL_NO_CMDALIASES */ Tcl_GetAliasObj, /* 149 */ +#endif /* TCL_NO_CMDALIASES */ Tcl_GetAssocData, /* 150 */ Tcl_GetChannel, /* 151 */ Tcl_GetChannelBufferSize, /* 152 */ @@ -527,14 +775,26 @@ TclStubs tclStubs = { Tcl_GetChannelInstanceData, /* 154 */ Tcl_GetChannelMode, /* 155 */ Tcl_GetChannelName, /* 156 */ +#if defined(TCL_NO_CHANNEL_CONFIG) + NULL, /* 157*/ +#else /* TCL_NO_CHANNEL_CONFIG */ Tcl_GetChannelOption, /* 157 */ +#endif /* TCL_NO_CHANNEL_CONFIG */ Tcl_GetChannelType, /* 158 */ Tcl_GetCommandInfo, /* 159 */ Tcl_GetCommandName, /* 160 */ Tcl_GetErrno, /* 161 */ Tcl_GetHostName, /* 162 */ +#if defined(TCL_NO_SLAVEINTERP) && defined (TCL_NO_CMDALIASES) + NULL, /* 163*/ +#else /* TCL_NO_SLAVEINTERP TCL_NO_CMDALIASES */ Tcl_GetInterpPath, /* 163 */ +#endif /* TCL_NO_SLAVEINTERP TCL_NO_CMDALIASES */ +#if defined(TCL_NO_SLAVEINTERP) && defined (TCL_NO_CMDALIASES) + NULL, /* 164*/ +#else /* TCL_NO_SLAVEINTERP TCL_NO_CMDALIASES */ Tcl_GetMaster, /* 164 */ +#endif /* TCL_NO_SLAVEINTERP TCL_NO_CMDALIASES */ Tcl_GetNameOfExecutable, /* 165 */ Tcl_GetObjResult, /* 166 */ #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ @@ -546,11 +806,19 @@ TclStubs tclStubs = { #ifdef MAC_TCL NULL, /* 167 */ #endif /* MAC_TCL */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 168*/ +#else /* TCL_NO_FILESYSTEM */ Tcl_GetPathType, /* 168 */ +#endif /* TCL_NO_FILESYSTEM */ Tcl_Gets, /* 169 */ Tcl_GetsObj, /* 170 */ Tcl_GetServiceMode, /* 171 */ +#if defined(TCL_NO_SLAVEINTERP) && defined (TCL_NO_CMDALIASES) + NULL, /* 172*/ +#else /* TCL_NO_SLAVEINTERP TCL_NO_CMDALIASES */ Tcl_GetSlave, /* 172 */ +#endif /* TCL_NO_SLAVEINTERP TCL_NO_CMDALIASES */ Tcl_GetStdChannel, /* 173 */ Tcl_GetStringResult, /* 174 */ Tcl_GetVar, /* 175 */ @@ -564,29 +832,61 @@ TclStubs tclStubs = { Tcl_InputBuffered, /* 183 */ Tcl_InterpDeleted, /* 184 */ Tcl_IsSafe, /* 185 */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 186*/ +#else /* TCL_NO_FILESYSTEM */ Tcl_JoinPath, /* 186 */ +#endif /* TCL_NO_FILESYSTEM */ Tcl_LinkVar, /* 187 */ NULL, /* 188 */ Tcl_MakeFileChannel, /* 189 */ Tcl_MakeSafe, /* 190 */ +#if defined(TCL_NO_SOCKETS) + NULL, /* 191*/ +#else /* TCL_NO_SOCKETS */ Tcl_MakeTcpClientChannel, /* 191 */ +#endif /* TCL_NO_SOCKETS */ Tcl_Merge, /* 192 */ Tcl_NextHashEntry, /* 193 */ +#if defined(TCL_NO_FILEEVENTS) + NULL, /* 194*/ +#else /* TCL_NO_FILEEVENTS */ Tcl_NotifyChannel, /* 194 */ +#endif /* TCL_NO_FILEEVENTS */ Tcl_ObjGetVar2, /* 195 */ Tcl_ObjSetVar2, /* 196 */ #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ +#if defined(TCL_NO_FILESYSTEM) || defined(TCL_NO_PIPES) + NULL, /* 197*/ +#else /* TCL_NO_FILESYSTEM TCL_NO_PIPES */ Tcl_OpenCommandChannel, /* 197 */ +#endif /* TCL_NO_FILESYSTEM TCL_NO_PIPES */ #endif /* UNIX */ #ifdef __WIN32__ +#if defined(TCL_NO_FILESYSTEM) || defined(TCL_NO_PIPES) + NULL, /* 197*/ +#else /* TCL_NO_FILESYSTEM TCL_NO_PIPES */ Tcl_OpenCommandChannel, /* 197 */ +#endif /* TCL_NO_FILESYSTEM TCL_NO_PIPES */ #endif /* __WIN32__ */ #ifdef MAC_TCL NULL, /* 197 */ #endif /* MAC_TCL */ +#if defined(TCL_NO_FILESYSTEM) || defined(TCL_NO_FILEEVENTS) + NULL, /* 198*/ +#else /* TCL_NO_FILESYSTEM TCL_NO_FILEEVENTS */ Tcl_OpenFileChannel, /* 198 */ +#endif /* TCL_NO_FILESYSTEM TCL_NO_FILEEVENTS */ +#if defined(TCL_NO_SOCKETS) + NULL, /* 199*/ +#else /* TCL_NO_SOCKETS */ Tcl_OpenTcpClient, /* 199 */ +#endif /* TCL_NO_SOCKETS */ +#if defined(TCL_NO_SOCKETS) || defined(TCL_NO_FILEEVENTS) + NULL, /* 200*/ +#else /* TCL_NO_SOCKETS TCL_NO_FILEEVENTS */ Tcl_OpenTcpServer, /* 200 */ +#endif /* TCL_NO_SOCKETS TCL_NO_FILEEVENTS */ Tcl_Preserve, /* 201 */ Tcl_PrintDouble, /* 202 */ Tcl_PutEnv, /* 203 */ @@ -594,17 +894,29 @@ TclStubs tclStubs = { Tcl_QueueEvent, /* 205 */ Tcl_Read, /* 206 */ #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ +#if defined(TCL_NO_PIPES) + NULL, /* 207*/ +#else /* TCL_NO_PIPES */ Tcl_ReapDetachedProcs, /* 207 */ +#endif /* TCL_NO_PIPES */ #endif /* UNIX */ #ifdef __WIN32__ +#if defined(TCL_NO_PIPES) + NULL, /* 207*/ +#else /* TCL_NO_PIPES */ Tcl_ReapDetachedProcs, /* 207 */ +#endif /* TCL_NO_PIPES */ #endif /* __WIN32__ */ #ifdef MAC_TCL NULL, /* 207 */ #endif /* MAC_TCL */ Tcl_RecordAndEval, /* 208 */ Tcl_RecordAndEvalObj, /* 209 */ +#if defined(TCL_NO_NONSTDCHAN) + NULL, /* 210*/ +#else /* TCL_NO_NONSTDCHAN */ Tcl_RegisterChannel, /* 210 */ +#endif /* TCL_NO_NONSTDCHAN */ Tcl_RegisterObjType, /* 211 */ Tcl_RegExpCompile, /* 212 */ Tcl_RegExpExec, /* 213 */ @@ -614,7 +926,11 @@ TclStubs tclStubs = { Tcl_ResetResult, /* 217 */ Tcl_ScanElement, /* 218 */ Tcl_ScanCountedElement, /* 219 */ +#if defined(TCL_NO_NONSTDCHAN) + NULL, /* 220*/ +#else /* TCL_NO_NONSTDCHAN */ Tcl_Seek, /* 220 */ +#endif /* TCL_NO_NONSTDCHAN */ Tcl_ServiceAll, /* 221 */ Tcl_ServiceEvent, /* 222 */ Tcl_SetAssocData, /* 223 */ @@ -637,13 +953,21 @@ TclStubs tclStubs = { Tcl_SignalMsg, /* 240 */ Tcl_SourceRCFile, /* 241 */ Tcl_SplitList, /* 242 */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 243*/ +#else /* TCL_NO_FILESYSTEM */ Tcl_SplitPath, /* 243 */ +#endif /* TCL_NO_FILESYSTEM */ Tcl_StaticPackage, /* 244 */ Tcl_StringMatch, /* 245 */ Tcl_Tell, /* 246 */ Tcl_TraceVar, /* 247 */ Tcl_TraceVar2, /* 248 */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 249*/ +#else /* TCL_NO_FILESYSTEM */ Tcl_TranslateFileName, /* 249 */ +#endif /* TCL_NO_FILESYSTEM */ Tcl_Ungets, /* 250 */ Tcl_UnlinkVar, /* 251 */ Tcl_UnregisterChannel, /* 252 */ @@ -671,7 +995,11 @@ TclStubs tclStubs = { Tcl_PkgRequire, /* 274 */ Tcl_SetErrorCodeVA, /* 275 */ Tcl_VarEvalVA, /* 276 */ +#if defined(TCL_NO_PIPES) + NULL, /* 277*/ +#else /* TCL_NO_PIPES */ Tcl_WaitPid, /* 277 */ +#endif /* TCL_NO_PIPES */ #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ Tcl_PanicVA, /* 278 */ #endif /* UNIX */ @@ -715,7 +1043,11 @@ TclStubs tclStubs = { Tcl_ConditionNotify, /* 310 */ Tcl_ConditionWait, /* 311 */ Tcl_NumUtfChars, /* 312 */ +#if defined(TCL_NO_CHANNEL_READ) && defined (TCL_NO_PIPES) + NULL, /* 313*/ +#else /* TCL_NO_CHANNEL_READ TCL_NO_PIPES */ Tcl_ReadChars, /* 313 */ +#endif /* TCL_NO_CHANNEL_READ TCL_NO_PIPES */ Tcl_RestoreResult, /* 314 */ Tcl_SaveResult, /* 315 */ Tcl_SetSystemEncoding, /* 316 */ @@ -743,8 +1075,16 @@ TclStubs tclStubs = { Tcl_WriteChars, /* 338 */ Tcl_WriteObj, /* 339 */ Tcl_GetString, /* 340 */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 341*/ +#else /* TCL_NO_FILESYSTEM */ Tcl_GetDefaultEncodingDir, /* 341 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 342*/ +#else /* TCL_NO_FILESYSTEM */ Tcl_SetDefaultEncodingDir, /* 342 */ +#endif /* TCL_NO_FILESYSTEM */ Tcl_AlertNotifier, /* 343 */ Tcl_ServiceModeHook, /* 344 */ Tcl_UniCharIsAlnum, /* 345 */ @@ -767,10 +1107,26 @@ TclStubs tclStubs = { Tcl_ParseExpr, /* 362 */ Tcl_ParseQuotedString, /* 363 */ Tcl_ParseVarName, /* 364 */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 365*/ +#else /* TCL_NO_FILESYSTEM */ Tcl_GetCwd, /* 365 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 366*/ +#else /* TCL_NO_FILESYSTEM */ Tcl_Chdir, /* 366 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 367*/ +#else /* TCL_NO_FILESYSTEM */ Tcl_Access, /* 367 */ +#endif /* TCL_NO_FILESYSTEM */ +#if defined(TCL_NO_FILESYSTEM) + NULL, /* 368*/ +#else /* TCL_NO_FILESYSTEM */ Tcl_Stat, /* 368 */ +#endif /* TCL_NO_FILESYSTEM */ Tcl_UtfNcmp, /* 369 */ Tcl_UtfNcasecmp, /* 370 */ Tcl_StringCaseMatch, /* 371 */ diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 1aeae89..2e1185f 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUtil.c,v 1.17.2.1 2001/07/16 23:14:13 hobbs Exp $ + * RCS: @(#) $Id: tclUtil.c,v 1.17.2.1.2.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include "tclInt.h" @@ -2391,6 +2391,7 @@ Tcl_GetNameOfExecutable() *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM char * Tcl_GetCwd(interp, cwdPtr) Tcl_Interp *interp; @@ -2398,6 +2399,7 @@ Tcl_GetCwd(interp, cwdPtr) { return TclpGetCwd(interp, cwdPtr); } +#endif /* *---------------------------------------------------------------------- @@ -2415,12 +2417,14 @@ Tcl_GetCwd(interp, cwdPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int Tcl_Chdir(dirName) CONST char *dirName; { return TclpChdir(dirName); } +#endif /* *---------------------------------------------------------------------- @@ -2438,6 +2442,7 @@ Tcl_Chdir(dirName) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int Tcl_Access(path, mode) CONST char *path; /* Path of file to access (UTF-8). */ @@ -2445,6 +2450,7 @@ Tcl_Access(path, mode) { return TclAccess(path, mode); } +#endif /* *---------------------------------------------------------------------- @@ -2462,6 +2468,7 @@ Tcl_Access(path, mode) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int Tcl_Stat(path, bufPtr) CONST char *path; /* Path of file to stat (in UTF-8). */ @@ -2469,3 +2476,6 @@ Tcl_Stat(path, bufPtr) { return TclStat(path, bufPtr); } +#endif + + |