From 90daebad86c36a4a83ff0831078e6f8351d9e9e6 Mon Sep 17 00:00:00 2001 From: andreas_kupries Date: Wed, 28 Nov 2001 17:58:35 +0000 Subject: * NOTES: New file. Read here about the new modularization macros, interdependencies, implications, etc. * static.sizes.html: New file. Report on the cuts achieved so far. Regarding the object files only the files which did change in size are reported. Usage of the MODULAR_TCL macro currently cuts about 17 % of the code (measured using strip'ped object files and libraries). * Changed files so far .. [cut, see changelog for full list] * Working on modularization of the tcl core. *************************** **** mod-8-3-4-branch **** *************************** --- ChangeLog | 55 ++++++++ NOTES | 153 +++++++++++++++++++++ generic/tcl.decls | 74 +++++------ generic/tcl.h | 33 ++++- generic/tclBasic.c | 63 ++++++++- generic/tclCmdAH.c | 20 ++- generic/tclCmdMZ.c | 14 +- generic/tclEncoding.c | 91 ++++++++++++- generic/tclEvent.c | 6 +- generic/tclFCmd.c | 23 +++- generic/tclFileName.c | 36 ++++- generic/tclIO.c | 93 ++++++++++++- generic/tclIOCmd.c | 66 +++++++++- generic/tclIOGT.c | 22 +++- generic/tclIOUtil.c | 34 ++++- generic/tclInt.decls | 98 +++++++------- generic/tclInterp.c | 169 ++++++++++++++++++++++-- generic/tclLoad.c | 16 ++- generic/tclLoadNone.c | 6 +- generic/tclMain.c | 13 +- generic/tclPipe.c | 13 +- generic/tclStubInit.c | 358 +++++++++++++++++++++++++++++++++++++++++++++++++- generic/tclUtil.c | 12 +- static.sizes.html | 54 ++++++++ tools/genStubs.tcl | 36 ++++- unix/tclLoadAout.c | 4 +- unix/tclLoadDl.c | 6 +- unix/tclLoadDld.c | 6 +- unix/tclLoadDyld.c | 6 +- unix/tclLoadNext.c | 6 +- unix/tclLoadOSF.c | 6 +- unix/tclLoadShl.c | 6 +- unix/tclUnixChan.c | 51 ++++++- unix/tclUnixFCmd.c | 44 ++++++- unix/tclUnixFile.c | 21 ++- unix/tclUnixInit.c | 24 +++- unix/tclUnixNotfy.c | 20 ++- unix/tclUnixPipe.c | 18 ++- unix/tclUnixSock.c | 19 ++- 39 files changed, 1643 insertions(+), 152 deletions(-) create mode 100644 NOTES create mode 100644 static.sizes.html diff --git a/ChangeLog b/ChangeLog index 8984f22..e082178 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,58 @@ +2001-11-28 Andreas Kupries + + * NOTES: New file. Read here about the new modularization macros, + interdependencies, implications, etc. + + * static.sizes.html: New file. Report on the cuts achieved so + far. Regarding the object files only the files which did change + in size are reported. Usage of the MODULAR_TCL macro currently + cuts about 17 % of the code (measured using strip'ped object + files and libraries). + + * Changed files so far + * tcl.decls + * tcl.h + * tclBasic.c + * tclCmdAH.c + * tclCmdMZ.c + * tclEncoding.c + * tclEvent.c + * tclFCmd.c + * tclFileName.c + * tclIO.c + * tclIOCmd.c + * tclIOGT.c + * tclIOUtil.c + * tclInt.decls + * tclInterp.c + * tclLoad.c + * tclLoadNone.c + * tclMain.c + * tclPipe.c + * tclStubInit.c + * tclUtil.c + * genStubs.tcl + * tclLoadAout.c + * tclLoadDl.c + * tclLoadDld.c + * tclLoadDyld.c + * tclLoadNext.c + * tclLoadOSF.c + * tclLoadShl.c + * tclUnixChan.c + * tclUnixFCmd.c + * tclUnixFile.c + * tclUnixInit.c + * tclUnixNotfy.c + * tclUnixPipe.c + * tclUnixSock.c + + * Working on modularization of the tcl core. + + *************************** + **** mod-8-3-4-branch **** + *************************** + 2001-11-20 Kevin B. Kenny * generic/tclCmdMZ.c (Tcl_TimeObjCmd) Added extra parentheses to a diff --git a/NOTES b/NOTES new file mode 100644 index 0000000..1f6f5ef --- /dev/null +++ b/NOTES @@ -0,0 +1,153 @@ + +Pre-notes + + The cutting of the channel system is not as clean as I would like + it to be, simply because cisco has the special need of a channel + system trimmed down to the std* channels, without complete removal. + I am not sure that I have removed the maximum amount of C Api's + and functions possible for this specific configuration. + + A first step in rationalizing this section would be NO_CHANNELS + to remove the I/O system completely, and then NO_NONSTDCHAN + for minial exposure of channels. NO_FILEEVENTS is orthogonal + to NO_NONSTDCHAN. Drivers are possible only if not NO_CHANNELS, + but can be disabled separately. The standard channels need the + "file" driver (currently not disable-able), should use #ifdef's + to ensure integrity. + + => Would be interesting to have a configuration tool which + is able to express and enforce these constraints. + + => The linux core configuration uses the domain specific + language CML2 (Eric Raymond, written in Python). + + ! Investigate possible usage of SourceNavigator as + basic for parsing the Tcl core. Use custom tools to + follow dependencies between structures and functions. + + (What-If tools: What if I exclude this function/struct, + what else can be removed, or requires this). + + Also: What are the leaf functions in the system ... + + ! Mapping help: Associate functions with functional areas + and see how the areas relate, how much can be removed + whenever an area is excluded ... + +------------------------------------------------------------------------ +------------------------------------------------------------------------ +------------------------------------------------------------------------ + +Shrinking the core. + Filesystem + +Shrinking the usage of stack + Large static arrays on the stack + Look for #define's, check usage, create #defines if necessary + DString !! (initial dstring data in structure!) + RE's ? + NRE1 + + == running a stack test of the full test suite for a build is 1.5 hours == + == something for the evening and the night == + +Document methodology of testing stack + +Macros + TCL_NO_ to deactivate/cut feature + MODULAR_TCL activates all TCL_NO_ macros +------------------------------------------------------------------------ +Cut 1 + The cut currently restricts itself to the UNIX and GENERIC parts. + No changes in Win* and Mac areas. + + channel system + - no sockets TCL_NO_SOCKETS / + - no serial/tty TCL_NO_TTY / + - no pipes TCL_NO_PIPES / + - no pid command TCL_NO_PIDCMD / + - channel system provides TCL_NO_NONSTDCHAN / + only std* channels [x] + - no channel copying TCL_NO_CHANNELCOPY / + - no [read]ing TCL_NO_CHANNEL_READ / + - no [eof] [/] TCL_NO_CHANNEL_EOF / + - no channel set/get cfg TCL_NO_CHANNEL_CONFIG [+] / + - no [fblocked] TCL_NO_CHANNEL_BLOCKED [/] / + - no fileevents TCL_NO_FILEEVENTS [=] / + + filesystem + - disable filesystem TCL_NO_FILESYSTEM [%] /* + - disable load'ing TCL_NO_LOADCMD / + + master/slave interpreters + - disable slave interp TCL_NO_SLAVEINTERP /* + - disable command aliases TCL_NO_CMDALIASES /* + +[*] Access from the C level is not removed. + +[x] Implies that no .rc can be read during unix init. + Implies that no startup script can be read by tclsh. + Implies NO_SOCKETS, NO_TTY, NO_PIPES + Implies currently 'no "source" cmd' and no loading of encoding files. + In the generic case this functionality can the reimplemented by direct + OS calls without using the channel system. Makes the + implementation platform dependent. As Cisco doesn't want this functionality + we disable them without adding a new implementation. + Implies that channels cannot be moved/shared between master/slave interps. + (seek is removed under the assumption that the std* channels are not seekable) + +[/] Tcl_Eof, Tcl_InputBlocked stay because they are required by [gets]. + +[+] Tcl_SetChannelOption stays, required for initial config of std channels. + +[=] Implies no socket servers. Reason: Accept callback for socket server + is done through fev's + +[%] Ripping the filesystem intrudes heavily on the startup sequence of the + interpreter as auto_path, package paths, etc. can't be initialized anymore. + This also cuts into the initialization of encodings. + + Given that encodings will be changed later to not use UTF internally this + is no big deal. For Cisco. Others might want to have 'no fs', but UTF. + + We have to check that the startup sequence is still operational. + + Given that without a FS loading of encoding from files is + impossible the loss of initialization is again not so big a deal. + +------------------------------------------------------------------------ +------------------------------------------------------------------------ +------------------------------------------------------------------------ + +Handling of stub table when cutting features: + +1. Disable all functions for the feature, from the bottom up to + the top (script level command). This includes full disabling + of stub functions too. + + The bottom-up approach enforces link errors in the higher + levels and thus allows us to use the compiler to find all + relevant places where we have to cut. + + Cutting stub functions is essential to find everything. + +2. Go through the functions causing link errors in tclStubInit.o + == stub functions. Add variants which are empty, return errors + etc. and compile these when the feature is disabled. + + ** Changed ** + Add suppressor definitions to "tcl*.decls" and regen the code. + +------------------------------------------------------------------------ +------------------------------------------------------------------------ +------------------------------------------------------------------------ + +Future: + Implement a mechanism for 'tcl.decls' + which allows the definition of (static, loadable) sub packages. + So that the stub table is minimally initialized and + sub packages initialize their slots when loaded. + +------------------------------------------------------------------------ +------------------------------------------------------------------------ +------------------------------------------------------------------------ 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 +#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 #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 + + diff --git a/static.sizes.html b/static.sizes.html new file mode 100644 index 0000000..a15a962 --- /dev/null +++ b/static.sizes.html @@ -0,0 +1,54 @@ +Static sizes +

Library sizes

+

+ + + + + + + + + + + + + + + + + + + +
lib/libtcl8.3.a lib/libtcl8.3.a % lib/libtcl8.3.a d% ENV_FLAGS
baseline 490124 100.00 0.00
cut_eof 489964 99.97 0.03 -DTCL_NO_CHANNEL_EOF
cut_blocked 489940 99.96 0.04 -DTCL_NO_CHANNEL_BLOCKED
cut_pid 489824 99.94 0.06 -DTCL_NO_PIDCMD
cut_read 489420 99.86 0.14 -DTCL_NO_CHANNEL_READ
cut_tty 488268 99.62 0.38 -DTCL_NO_TTY
cut_copy 488032 99.57 0.43 -DTCL_NO_CHANNELCOPY
cut_load 487264 99.42 0.58 -DTCL_NO_LOADCMD
cut_alias 486576 99.28 0.72 -DTCL_NO_CMDALIASES
cut_slave 485080 98.97 1.03 -DTCL_NO_SLAVEINTERP
cut_config 484932 98.94 1.06 -DTCL_NO_CHANNEL_CONFIG
cut_sock 484428 98.84 1.16 -DTCL_NO_SOCKETS
cut_fev 484376 98.83 1.17 -DTCL_NO_FILEEVENTS
cut_interp 480624 98.06 1.94 -DTCL_NO_SLAVEINTERP -DTCL_NO_CMDALIASES
cut_pipes 480136 97.96 2.04 -DTCL_NO_PIPES
cut_nonstdchan 463544 94.58 5.42 -DTCL_NO_NONSTDCHAN
cut_fs 440940 89.96 10.04 -DTCL_NO_FILESYSTEM
cut 403228 82.27 17.73 -DMODULAR_TCL

+

Object file sizes

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
baseline cut cut_alias cut_blocked cut_config cut_copy cut_eof cut_fev cut_fs cut_interp cut_load cut_nonstdchan cut_pid cut_pipes cut_read cut_slave cut_sock cut_tty
tclBasic.o 16656 16144 16592 16624 16624 16624 16624 16624 16464 16592 16624 16496 16624 16624 16624 16656 16624 16656
tclCmdAH.o 14228 9108 14228 14228 14228 14228 14228 14228 9108 14228 14228 14228 14228 14228 14228 14228 14228 14228
tclCmdMZ.o 17160 17000 17160 17160 17160 17160 17160 17160 17000 17160 17160 17096 17160 17160 17160 17160 17160 17160
tclEncoding.o 10008 3488 10008 10008 10008 10008 10008 10008 3488 10008 10008 4364 10008 10008 10008 10008 10008 10008
tclEvent.o 4036 3844 4036 4036 4036 4036 4036 4036 3844 4036 4036 4036 4036 4036 4036 4036 4036 4036
tclFCmd.o 5272 472 5272 5272 5272 5272 5272 5272 472 5272 5272 5272 5272 5272 5272 5272 5272 5272
tclFileName.o 12020 472 12020 12020 12020 12020 12020 12020 472 12020 12020 12020 12020 12020 12020 12020 12020 12020
tclIO.o 25296 17724 25296 25296 23824 23728 25296 22748 25296 25296 25296 24848 25296 25296 25296 25296 25296 25296
tclIOCmd.o 7860 2020 7860 7668 7412 7368 7732 6996 6588 7860 7860 3932 7860 6940 7188 7860 5716 7860
tclIOGT.o 3760 484 3760 3760 484 3760 3760 3536 3760 3760 3760 3760 3760 3760 3760 3760 3760 3760
tclIOUtil.o 3300 1976 3300 3300 3300 3300 3300 3300 1976 3300 3300 2764 3300 3300 3300 3300 3300 3300
tclInterp.o 10196 948 6676 10196 10196 10196 10196 10196 10196 948 10196 9876 10196 10196 10196 5340 10196 10196
tclLoad.o 3556 1140 3556 3556 3556 3556 3556 3556 1292 3332 1292 3556 3556 3556 3556 3332 3556 3556
tclLoadDl.o 1044 480 1044 1044 1044 1044 1044 1044 1044 1044 480 1044 1044 1044 1044 1044 1044 1044
tclMain.o 3296 2656 3296 3296 3296 3296 3296 2816 3136 3296 3296 3136 3296 3296 3296 3296 3296 3296
tclPipe.o 6040 472 6040 6040 6040 6040 6040 6040 1940 6040 6040 472 6040 472 6040 6040 6040 6040
tclUnixChan.o 9036 3084 9036 9036 9036 9036 9036 8524 8300 9036 9036 3148 9036 9036 9036 9036 5708 7180
tclUnixFCmd.o 6604 472 6604 6604 6604 6604 6604 6604 472 6604 6604 6604 6604 6604 6604 6604 6604 6604
tclUnixFile.o 3324 472 3324 3324 3324 3324 3324 3324 472 3324 3324 3324 3324 3324 3324 3324 3324 3324
tclUnixInit.o 6000 4312 6036 6040 6036 6000 6000 6000 4316 6036 6000 5832 6000 6036 6000 6036 6000 6000
tclUnixNotfy.o 1784 856 1784 1784 1784 1784 1784 856 1784 1784 1784 1784 1784 1784 1784 1784 1784 1784
tclUnixPipe.o 4196 472 4196 4196 4196 4196 4196 4036 4196 4196 4196 692 3928 692 4196 4196 4196 4196
tclUnixSock.o 760 568 760 760 760 760 760 760 760 760 760 568 760 760 760 760 568 760
tclUtil.o 8600 8472 8600 8600 8600 8600 8600 8600 8472 8600 8600 8600 8600 8600 8600 8600 8600 8600
Sigma 184032 97136 180484 183848 178840 181940 183872 178284 134848 174532 181172 157452 183732 174044 183328 178988 178336 182176
% 100.00 52.78 98.07 99.90 97.18 98.86 99.91 96.88 73.27 94.84 98.45 85.56 99.84 94.57 99.62 97.26 96.90 98.99

+ diff --git a/tools/genStubs.tcl b/tools/genStubs.tcl index 9166c20..c3d85a3 100644 --- a/tools/genStubs.tcl +++ b/tools/genStubs.tcl @@ -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: genStubs.tcl,v 1.7.10.1 2001/08/24 16:19:10 dgp Exp $ +# RCS: @(#) $Id: genStubs.tcl,v 1.7.10.1.2.1 2001/11/28 17:58:37 andreas_kupries Exp $ package require Tcl 8 @@ -133,10 +133,15 @@ proc genStubs::declare {args} { variable stubs variable curName - if {[llength $args] != 3} { + if {[llength $args] != 3 && [llength $args] != 4} { puts stderr "wrong # args: declare $args" } - lassign $args index platformList decl + if {[llength $args] == 3} { + lassign $args index platformList decl + set supressorList {} + } else { + lassign $args index platformList supressorList decl + } # Check for duplicate declarations, then add the declaration and # bump the lastNum counter if necessary. @@ -151,7 +156,7 @@ proc genStubs::declare {args} { foreach platform $platformList { if {$decl != ""} { - set stubs($curName,$platform,$index) $decl + set stubs($curName,$platform,$index) [list $decl $supressorList] if {![info exists stubs($curName,$platform,lastNum)] \ || ($index > $stubs($curName,$platform,lastNum))} { set stubs($curName,$platform,lastNum) $index @@ -348,6 +353,7 @@ proc genStubs::parseArg {arg} { # Returns the formatted declaration string. proc genStubs::makeDecl {name decl index} { + set decl [lindex $decl 0] lassign $decl rtype fname args append text "/* $index */\n" @@ -408,6 +414,7 @@ proc genStubs::makeDecl {name decl index} { # Returns the formatted macro definition. proc genStubs::makeMacro {name decl index} { + set decl [lindex $decl 0] lassign $decl rtype fname args set lfname [string tolower [string index $fname 0]] @@ -449,6 +456,7 @@ proc genStubs::makeMacro {name decl index} { # Returns the formatted stub function definition. proc genStubs::makeStub {name decl index} { + set decl [lindex $decl 0] lassign $decl rtype fname args set lfname [string tolower [string index $fname 0]] @@ -514,6 +522,7 @@ proc genStubs::makeStub {name decl index} { # Returns the formatted table entry. proc genStubs::makeSlot {name decl index} { + set decl [lindex $decl 0] ; # ignore supressors here. lassign $decl rtype fname args set lfname [string tolower [string index $fname 0]] @@ -559,7 +568,24 @@ proc genStubs::makeSlot {name decl index} { # Returns the formatted declaration string. proc genStubs::makeInit {name decl index} { - append text " " [lindex $decl 1] ", /* " $index " */\n" + lassign $decl decl suppressors + if {[llength $suppressors] > 0} { + set sup [list] + foreach s $suppressors { + if {[llength $s] > 1} { + lappend sup "defined([join $s ") && defined ("])" + } else { + lappend sup "defined($s)" + } + } + append text "#if " [join $sup " || "] "\n" + append text " NULL, /* " $index "*/\n" + append text "#else /* " [join $suppressors] " */\n" + append text " " [lindex $decl 1] ", /* " $index " */\n" + append text "#endif /* " [join $suppressors] " */\n" + } else { + append text " " [lindex $decl 1] ", /* " $index " */\n" + } return $text } diff --git a/unix/tclLoadAout.c b/unix/tclLoadAout.c index aad9978..6835deb 100644 --- a/unix/tclLoadAout.c +++ b/unix/tclLoadAout.c @@ -14,7 +14,7 @@ * and Design Engineering (MADE) Initiative through ARPA contract * F33615-94-C-4400. * - * RCS: @(#) $Id: tclLoadAout.c,v 1.4.2.1 2001/10/16 21:13:36 hobbs Exp $ + * RCS: @(#) $Id: tclLoadAout.c,v 1.4.2.1.2.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include "tclInt.h" @@ -140,6 +140,7 @@ static void UnlinkSymbolTable _ANSI_ARGS_((void)); *---------------------------------------------------------------------- */ +#ifndef TCL_NO_LOADCMD int TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) Tcl_Interp *interp; /* Used for error reporting. */ @@ -313,6 +314,7 @@ TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) return TCL_OK; } +#endif /* *------------------------------------------------------------------------ diff --git a/unix/tclLoadDl.c b/unix/tclLoadDl.c index 2a868d8..3a72965 100644 --- a/unix/tclLoadDl.c +++ b/unix/tclLoadDl.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: tclLoadDl.c,v 1.3 1999/04/16 00:48:04 stanton Exp $ + * RCS: @(#) $Id: tclLoadDl.c,v 1.3.22.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include "tclInt.h" @@ -56,6 +56,7 @@ *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_LOADCMD int TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) Tcl_Interp *interp; /* Used for error reporting. */ @@ -120,6 +121,7 @@ TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -139,6 +141,7 @@ TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_LOADCMD void TclpUnloadFile(clientData) ClientData clientData; /* ClientData returned by a previous call @@ -151,6 +154,7 @@ TclpUnloadFile(clientData) handle = (VOID *) clientData; dlclose(handle); } +#endif /* *---------------------------------------------------------------------- diff --git a/unix/tclLoadDld.c b/unix/tclLoadDld.c index 1f9e702..9000bbf 100644 --- a/unix/tclLoadDld.c +++ b/unix/tclLoadDld.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: tclLoadDld.c,v 1.3 1999/04/16 00:48:04 stanton Exp $ + * RCS: @(#) $Id: tclLoadDld.c,v 1.3.22.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include "tclInt.h" @@ -48,6 +48,7 @@ *---------------------------------------------------------------------- */ +#ifndef TCL_NO_LOADCMD int TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) Tcl_Interp *interp; /* Used for error reporting. */ @@ -98,6 +99,7 @@ TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) (char *) ckalloc((unsigned) (strlen(fileName) + 1)), fileName); return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -117,6 +119,7 @@ TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_LOADCMD void TclpUnloadFile(clientData) ClientData clientData; /* ClientData returned by a previous call @@ -130,6 +133,7 @@ TclpUnloadFile(clientData) dld_unlink_by_file(handle, 0); ckfree(handle); } +#endif /* *---------------------------------------------------------------------- diff --git a/unix/tclLoadDyld.c b/unix/tclLoadDyld.c index 0e0915b..b7f487d 100644 --- a/unix/tclLoadDyld.c +++ b/unix/tclLoadDyld.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: tclLoadDyld.c,v 1.2.2.2 2001/10/16 06:44:09 das Exp $ + * RCS: @(#) $Id: tclLoadDyld.c,v 1.2.2.2.2.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include "tclInt.h" @@ -38,6 +38,7 @@ *---------------------------------------------------------------------- */ +#ifndef TCL_NO_LOADCMD int TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) Tcl_Interp *interp; /* Used for error reporting. */ @@ -101,6 +102,7 @@ TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -121,6 +123,7 @@ TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_LOADCMD void TclpUnloadFile(clientData) ClientData clientData; /* ClientData returned by a previous call @@ -130,6 +133,7 @@ TclpUnloadFile(clientData) { NSUnLinkModule(clientData, FALSE); } +#endif /* *---------------------------------------------------------------------- diff --git a/unix/tclLoadNext.c b/unix/tclLoadNext.c index f29c996..46861ec 100644 --- a/unix/tclLoadNext.c +++ b/unix/tclLoadNext.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: tclLoadNext.c,v 1.3 1999/04/16 00:48:04 stanton Exp $ + * RCS: @(#) $Id: tclLoadNext.c,v 1.3.22.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include "tclInt.h" @@ -38,6 +38,7 @@ *---------------------------------------------------------------------- */ +#ifndef TCL_NO_LOADCMD int TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) Tcl_Interp *interp; /* Used for error reporting. */ @@ -83,6 +84,7 @@ TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -102,6 +104,7 @@ TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_LOADCMD void TclpUnloadFile(clientData) ClientData clientData; /* ClientData returned by a previous call @@ -110,6 +113,7 @@ TclpUnloadFile(clientData) * file. */ { } +#endif /* *---------------------------------------------------------------------- diff --git a/unix/tclLoadOSF.c b/unix/tclLoadOSF.c index 9e8b3ad..b762633 100644 --- a/unix/tclLoadOSF.c +++ b/unix/tclLoadOSF.c @@ -31,7 +31,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclLoadOSF.c,v 1.3 1999/04/16 00:48:04 stanton Exp $ + * RCS: @(#) $Id: tclLoadOSF.c,v 1.3.22.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include "tclInt.h" @@ -59,6 +59,7 @@ *---------------------------------------------------------------------- */ +#ifndef TCL_NO_LOADCMD int TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) Tcl_Interp *interp; /* Used for error reporting. */ @@ -101,6 +102,7 @@ TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) *proc2Ptr = ldr_lookup_package(pkg, sym2); return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -120,6 +122,7 @@ TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_LOADCMD void TclpUnloadFile(clientData) ClientData clientData; /* ClientData returned by a previous call @@ -128,6 +131,7 @@ TclpUnloadFile(clientData) * file. */ { } +#endif /* *---------------------------------------------------------------------- diff --git a/unix/tclLoadShl.c b/unix/tclLoadShl.c index 86962c3..466f81b 100644 --- a/unix/tclLoadShl.c +++ b/unix/tclLoadShl.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: tclLoadShl.c,v 1.3.12.1 2001/09/12 21:26:36 dgp Exp $ + * RCS: @(#) $Id: tclLoadShl.c,v 1.3.12.1.2.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include @@ -46,6 +46,7 @@ *---------------------------------------------------------------------- */ +#ifndef TCL_NO_LOADCMD int TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) Tcl_Interp *interp; /* Used for error reporting. */ @@ -111,6 +112,7 @@ TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) } return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -130,6 +132,7 @@ TclpLoadFile(interp, fileName, sym1, sym2, proc1Ptr, proc2Ptr, clientDataPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_LOADCMD void TclpUnloadFile(clientData) ClientData clientData; /* ClientData returned by a previous call @@ -142,6 +145,7 @@ TclpUnloadFile(clientData) handle = (shl_t) clientData; shl_unload(handle); } +#endif /* *---------------------------------------------------------------------- diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index 869d190..f0238ff 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.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: tclUnixChan.c,v 1.17.2.1 2001/04/03 22:54:39 hobbs Exp $ + * RCS: @(#) $Id: tclUnixChan.c,v 1.17.2.1.2.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include "tclInt.h" /* Internal definitions for Tcl. */ #include "tclPort.h" /* Portability features for Tcl. */ +#ifndef TCL_NO_TTY /* * sys/ioctl.h has already been included by tclPort.h. Including termios.h * or termio.h causes a bunch of warning messages because some duplicate @@ -65,6 +66,9 @@ #endif /* !USE_SGTTY */ #endif /* !USE_TERMIO */ #endif /* !USE_TERMIOS */ +#else +#undef SUPPORTS_TTY +#endif /* TCL_NO_TTY */ /* * This structure describes per-instance state of a file based channel. @@ -119,6 +123,7 @@ typedef struct ThreadSpecificData { static Tcl_ThreadDataKey dataKey; +#ifndef TCL_NO_SOCKETS /* * This structure describes per-instance state of a tcp based channel. */ @@ -163,17 +168,20 @@ typedef struct TcpState { */ #define SOCKET_BUFSIZE 4096 +#endif /* * Static routines for this file: */ +#ifndef TCL_NO_SOCKETS static TcpState * CreateSocket _ANSI_ARGS_((Tcl_Interp *interp, int port, char *host, int server, char *myaddr, int myport, int async)); static int CreateSocketAddress _ANSI_ARGS_( (struct sockaddr_in *sockaddrPtr, char *host, int port)); +#endif static int FileBlockModeProc _ANSI_ARGS_(( ClientData instanceData, int mode)); static int FileCloseProc _ANSI_ARGS_((ClientData instanceData, @@ -189,7 +197,10 @@ static int FileSeekProc _ANSI_ARGS_((ClientData instanceData, long offset, int mode, int *errorCode)); static void FileWatchProc _ANSI_ARGS_((ClientData instanceData, int mask)); +#ifndef TCL_NO_SOCKETS +#ifndef TCL_NO_FILEEVENTS static void TcpAccept _ANSI_ARGS_((ClientData data, int mask)); +#endif static int TcpBlockModeProc _ANSI_ARGS_((ClientData data, int mode)); static int TcpCloseProc _ANSI_ARGS_((ClientData instanceData, @@ -205,6 +216,9 @@ static int TcpOutputProc _ANSI_ARGS_((ClientData instanceData, char *buf, int toWrite, int *errorCode)); static void TcpWatchProc _ANSI_ARGS_((ClientData instanceData, int mask)); +static int WaitForConnect _ANSI_ARGS_((TcpState *statePtr, + int *errorCodePtr)); +#endif #ifdef SUPPORTS_TTY static int TtyCloseProc _ANSI_ARGS_((ClientData instanceData, Tcl_Interp *interp)); @@ -223,8 +237,6 @@ static int TtySetOptionProc _ANSI_ARGS_((ClientData instanceData, Tcl_Interp *interp, char *optionName, char *value)); #endif /* SUPPORTS_TTY */ -static int WaitForConnect _ANSI_ARGS_((TcpState *statePtr, - int *errorCodePtr)); /* * This structure describes the channel type structure for file based IO: @@ -271,6 +283,7 @@ static Tcl_ChannelType ttyChannelType = { }; #endif /* SUPPORTS_TTY */ +#ifndef TCL_NO_SOCKETS /* * This structure describes the channel type structure for TCP socket * based IO: @@ -292,7 +305,7 @@ static Tcl_ChannelType tcpChannelType = { NULL, /* flush proc. */ NULL, /* handler proc. */ }; - +#endif /* *---------------------------------------------------------------------- @@ -458,7 +471,9 @@ FileCloseProc(instanceData, interp) int errorCode = 0; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); +#ifndef TCL_NO_FILEEVENTS Tcl_DeleteFileHandler(fsPtr->fd); +#endif /* * Do not close standard channels while in thread-exit. @@ -544,6 +559,7 @@ FileWatchProc(instanceData, mask) * combination of TCL_READABLE, * TCL_WRITABLE and TCL_EXCEPTION. */ { +#ifndef TCL_NO_FILEEVENTS FileState *fsPtr = (FileState *) instanceData; /* @@ -560,6 +576,7 @@ FileWatchProc(instanceData, mask) } else { Tcl_DeleteFileHandler(fsPtr->fd); } +#endif } /* @@ -1264,6 +1281,8 @@ TtyInit(fd) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN Tcl_Channel TclpOpenFileChannel(interp, fileName, modeString, permissions) Tcl_Interp *interp; /* Interpreter for error reporting; @@ -1371,6 +1390,7 @@ TclpOpenFileChannel(interp, fileName, modeString, permissions) } } +#ifdef SUPPORTS_TTY if (translation != NULL) { /* * Gotcha. Most modems need a "\r" at the end of the command @@ -1386,9 +1406,12 @@ TclpOpenFileChannel(interp, fileName, modeString, permissions) return NULL; } } +#endif return fsPtr->channel; } +#endif +#endif /* TCL_NO_FILESYSTEM */ /* *---------------------------------------------------------------------- @@ -1464,6 +1487,7 @@ Tcl_MakeFileChannel(handle, mode) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_SOCKETS /* ARGSUSED */ static int TcpBlockModeProc(instanceData, mode) @@ -1700,6 +1724,7 @@ TcpCloseProc(instanceData, interp) TcpState *statePtr = (TcpState *) instanceData; int errorCode = 0; +#ifndef TCL_NO_FILEEVENTS /* * Delete a file handler that may be active for this socket if this * is a server socket - the file handler was created automatically @@ -1710,6 +1735,7 @@ TcpCloseProc(instanceData, interp) */ Tcl_DeleteFileHandler(statePtr->fd); +#endif if (close(statePtr->fd) < 0) { errorCode = errno; @@ -1896,6 +1922,7 @@ TcpWatchProc(instanceData, mask) * combination of TCL_READABLE, * TCL_WRITABLE and TCL_EXCEPTION. */ { +#ifndef TCL_NO_FILEEVENTS TcpState *statePtr = (TcpState *) instanceData; /* @@ -1913,6 +1940,7 @@ TcpWatchProc(instanceData, mask) Tcl_DeleteFileHandler(statePtr->fd); } } +#endif } /* @@ -2209,6 +2237,7 @@ CreateSocketAddress(sockaddrPtr, host, port) sockaddrPtr->sin_addr.s_addr = addr.s_addr; return 1; /* Success. */ } +#endif /* *---------------------------------------------------------------------- @@ -2227,6 +2256,7 @@ CreateSocketAddress(sockaddrPtr, host, port) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_SOCKETS Tcl_Channel Tcl_OpenTcpClient(interp, port, host, myaddr, myport, async) Tcl_Interp *interp; /* For error reporting; can be NULL. */ @@ -2264,6 +2294,7 @@ Tcl_OpenTcpClient(interp, port, host, myaddr, myport, async) } return statePtr->channel; } +#endif /* *---------------------------------------------------------------------- @@ -2281,6 +2312,7 @@ Tcl_OpenTcpClient(interp, port, host, myaddr, myport, async) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_SOCKETS Tcl_Channel Tcl_MakeTcpClientChannel(sock) ClientData sock; /* The socket to wrap up into a channel. */ @@ -2304,6 +2336,7 @@ Tcl_MakeTcpClientChannel(sock) } return statePtr->channel; } +#endif /* *---------------------------------------------------------------------- @@ -2323,6 +2356,8 @@ Tcl_MakeTcpClientChannel(sock) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_SOCKETS +#ifndef TCL_NO_FILEEVENTS Tcl_Channel Tcl_OpenTcpServer(interp, port, myHost, acceptProc, acceptProcData) Tcl_Interp *interp; /* For error reporting - may be @@ -2360,6 +2395,8 @@ Tcl_OpenTcpServer(interp, port, myHost, acceptProc, acceptProcData) (ClientData) statePtr, 0); return statePtr->channel; } +#endif /* NO_FILEEVENTS */ +#endif /* NO_SOCKETS */ /* *---------------------------------------------------------------------- @@ -2377,6 +2414,8 @@ Tcl_OpenTcpServer(interp, port, myHost, acceptProc, acceptProcData) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_SOCKETS +#ifndef TCL_NO_FILEEVENTS /* ARGSUSED */ static void TcpAccept(data, mask) @@ -2425,6 +2464,8 @@ TcpAccept(data, mask) ntohs(addr.sin_port)); } } +#endif /* NO_FILEEVENTS */ +#endif /* NO SOCKETS */ /* *---------------------------------------------------------------------- @@ -2567,7 +2608,9 @@ Tcl_GetOpenFile(interp, string, forWriting, checkUsage, filePtr) #ifdef SUPPORTS_TTY || (chanTypePtr == &ttyChannelType) #endif /* SUPPORTS_TTY */ +#ifndef TCL_NO_SOCKETS || (chanTypePtr == &tcpChannelType) +#endif || (strcmp(chanTypePtr->typeName, "pipe") == 0)) { if (Tcl_GetChannelHandle(chan, (forWriting ? TCL_WRITABLE : TCL_READABLE), diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index 81adb4b..e1c8000 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.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: tclUnixFCmd.c,v 1.6.2.1 2001/10/17 19:12:26 hobbs Exp $ + * RCS: @(#) $Id: tclUnixFCmd.c,v 1.6.2.1.2.1 2001/11/28 17:58:37 andreas_kupries Exp $ * * Portions of this code were derived from NetBSD source code which has * the following copyright notice: @@ -57,6 +57,7 @@ #endif #endif +#ifndef TCL_NO_FILESYSTEM /* * The following constants specify the type of callback when * TraverseUnixTree() calls the traverseProc() @@ -149,6 +150,7 @@ static int TraverseUnixTree _ANSI_ARGS_(( TraversalProc *traversalProc, Tcl_DString *sourcePtr, Tcl_DString *destPtr, Tcl_DString *errorPtr)); +#endif /* *--------------------------------------------------------------------------- @@ -185,6 +187,7 @@ static int TraverseUnixTree _ANSI_ARGS_(( *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclpRenameFile(src, dst) CONST char *src; /* Pathname of file or dir to be renamed @@ -283,7 +286,7 @@ DoRenameFile(src, dst) return TCL_ERROR; } - +#endif /* *--------------------------------------------------------------------------- @@ -312,6 +315,7 @@ DoRenameFile(src, dst) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclpCopyFile(src, dst) CONST char *src; /* Pathname of file to be copied (UTF-8). */ @@ -403,6 +407,7 @@ DoCopyFile(srcPtr, dstPtr) } return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -421,6 +426,7 @@ DoCopyFile(srcPtr, dstPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int CopyFile(src, dst, statBufPtr) CONST char *src; /* Pathname of file to copy (native). */ @@ -493,6 +499,7 @@ CopyFile(src, dst, statBufPtr) } return TCL_OK; } +#endif /* *--------------------------------------------------------------------------- @@ -516,6 +523,7 @@ CopyFile(src, dst, statBufPtr) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclpDeleteFile(path) CONST char *path; /* Pathname of file to be removed (UTF-8). */ @@ -541,6 +549,7 @@ DoDeleteFile(pathPtr) } return TCL_OK; } +#endif /* *--------------------------------------------------------------------------- @@ -568,6 +577,7 @@ DoDeleteFile(pathPtr) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclpCreateDirectory(path) CONST char *path; /* Pathname of directory to create (UTF-8). */ @@ -604,6 +614,7 @@ DoCreateDirectory(pathPtr) } return TCL_OK; } +#endif /* *--------------------------------------------------------------------------- @@ -631,6 +642,7 @@ DoCreateDirectory(pathPtr) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclpCopyDirectory(src, dst, errorPtr) CONST char *src; /* Pathname of directory to be copied @@ -652,6 +664,7 @@ TclpCopyDirectory(src, dst, errorPtr) Tcl_DStringFree(&dstString); return result; } +#endif /* *--------------------------------------------------------------------------- @@ -679,6 +692,7 @@ TclpCopyDirectory(src, dst, errorPtr) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclpRemoveDirectory(path, recursive, errorPtr) CONST char *path; /* Pathname of directory to be removed @@ -734,6 +748,7 @@ DoRemoveDirectory(pathPtr, recursive, errorPtr) return TraverseUnixTree(TraversalDelete, pathPtr, NULL, errorPtr); } +#endif /* *--------------------------------------------------------------------------- @@ -757,6 +772,7 @@ DoRemoveDirectory(pathPtr, recursive, errorPtr) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int TraverseUnixTree(traverseProc, sourcePtr, targetPtr, errorPtr) TraversalProc *traverseProc;/* Function to call for every file and @@ -876,6 +892,7 @@ TraverseUnixTree(traverseProc, sourcePtr, targetPtr, errorPtr) return result; } +#endif /* *---------------------------------------------------------------------- @@ -895,6 +912,7 @@ TraverseUnixTree(traverseProc, sourcePtr, targetPtr, errorPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int TraversalCopy(srcPtr, dstPtr, statBufPtr, type, errorPtr) Tcl_DString *srcPtr; /* Source pathname to copy (native). */ @@ -939,6 +957,7 @@ TraversalCopy(srcPtr, dstPtr, statBufPtr, type, errorPtr) } return TCL_ERROR; } +#endif /* *--------------------------------------------------------------------------- @@ -959,6 +978,7 @@ TraversalCopy(srcPtr, dstPtr, statBufPtr, type, errorPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int TraversalDelete(srcPtr, ignore, statBufPtr, type, errorPtr) Tcl_DString *srcPtr; /* Source pathname (native). */ @@ -993,6 +1013,7 @@ TraversalDelete(srcPtr, ignore, statBufPtr, type, errorPtr) } return TCL_ERROR; } +#endif /* *--------------------------------------------------------------------------- @@ -1013,6 +1034,7 @@ TraversalDelete(srcPtr, ignore, statBufPtr, type, errorPtr) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int CopyFileAtts(src, dst, statBufPtr) CONST char *src; /* Path name of source file (native). */ @@ -1050,7 +1072,7 @@ CopyFileAtts(src, dst, statBufPtr) } return TCL_OK; } - +#endif /* *---------------------------------------------------------------------- @@ -1069,6 +1091,7 @@ CopyFileAtts(src, dst, statBufPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int GetGroupAttribute(interp, objIndex, fileName, attributePtrPtr) Tcl_Interp *interp; /* The interp we are using for errors. */ @@ -1102,6 +1125,7 @@ GetGroupAttribute(interp, objIndex, fileName, attributePtrPtr) endgrent(); return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -1120,6 +1144,7 @@ GetGroupAttribute(interp, objIndex, fileName, attributePtrPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int GetOwnerAttribute(interp, objIndex, fileName, attributePtrPtr) Tcl_Interp *interp; /* The interp we are using for errors. */ @@ -1153,6 +1178,7 @@ GetOwnerAttribute(interp, objIndex, fileName, attributePtrPtr) endpwent(); return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -1171,6 +1197,7 @@ GetOwnerAttribute(interp, objIndex, fileName, attributePtrPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int GetPermissionsAttribute(interp, objIndex, fileName, attributePtrPtr) Tcl_Interp *interp; /* The interp we are using for errors. */ @@ -1196,6 +1223,7 @@ GetPermissionsAttribute(interp, objIndex, fileName, attributePtrPtr) return TCL_OK; } +#endif /* *--------------------------------------------------------------------------- @@ -1213,6 +1241,7 @@ GetPermissionsAttribute(interp, objIndex, fileName, attributePtrPtr) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int SetGroupAttribute(interp, objIndex, fileName, attributePtr) Tcl_Interp *interp; /* The interp for error reporting. */ @@ -1258,6 +1287,7 @@ SetGroupAttribute(interp, objIndex, fileName, attributePtr) } return TCL_OK; } +#endif /* *--------------------------------------------------------------------------- @@ -1275,6 +1305,7 @@ SetGroupAttribute(interp, objIndex, fileName, attributePtr) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int SetOwnerAttribute(interp, objIndex, fileName, attributePtr) Tcl_Interp *interp; /* The interp for error reporting. */ @@ -1318,6 +1349,7 @@ SetOwnerAttribute(interp, objIndex, fileName, attributePtr) } return TCL_OK; } +#endif /* *--------------------------------------------------------------------------- @@ -1335,6 +1367,7 @@ SetOwnerAttribute(interp, objIndex, fileName, attributePtr) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int SetPermissionsAttribute(interp, objIndex, fileName, attributePtr) Tcl_Interp *interp; /* The interp we are using for errors. */ @@ -1390,6 +1423,7 @@ SetPermissionsAttribute(interp, objIndex, fileName, attributePtr) } return TCL_OK; } +#endif /* *--------------------------------------------------------------------------- @@ -1409,6 +1443,7 @@ SetPermissionsAttribute(interp, objIndex, fileName, attributePtr) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclpListVolumes(interp) Tcl_Interp *interp; /* Interpreter to which to pass @@ -1420,6 +1455,7 @@ TclpListVolumes(interp) Tcl_SetStringObj(resultPtr, "/", 1); return TCL_OK; } +#endif /* *---------------------------------------------------------------------- @@ -1439,6 +1475,7 @@ TclpListVolumes(interp) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM static int GetModeFromPermString(interp, modeStringPtr, modePtr) Tcl_Interp *interp; /* The interp we are using for errors. */ @@ -1609,3 +1646,4 @@ GetModeFromPermString(interp, modeStringPtr, modePtr) } return TCL_OK; } +#endif diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index 2679fdb..3870d26 100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.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: tclUnixFile.c,v 1.9 2000/01/11 22:09:19 hobbs Exp $ + * RCS: @(#) $Id: tclUnixFile.c,v 1.9.12.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include "tclInt.h" @@ -40,6 +40,7 @@ *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM char * TclpFindExecutable(argv0) CONST char *argv0; /* The value of the application's argv[0] @@ -172,6 +173,7 @@ TclpFindExecutable(argv0) Tcl_DStringFree(&buffer); return tclNativeExecutableName; } +#endif /* *---------------------------------------------------------------------- @@ -194,6 +196,7 @@ TclpFindExecutable(argv0) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclpMatchFilesTypes(interp, separators, dirPtr, pattern, tail, types) Tcl_Interp *interp; /* Interpreter to receive results. */ @@ -435,6 +438,7 @@ TclpMatchFiles(interp, separators, dirPtr, pattern, tail) { return TclpMatchFilesTypes(interp,separators,dirPtr,pattern,tail,NULL); } +#endif /* *--------------------------------------------------------------------------- @@ -457,6 +461,7 @@ TclpMatchFiles(interp, separators, dirPtr, pattern, tail) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM char * TclpGetUserHome(name, bufferPtr) CONST char *name; /* User name for desired home directory. */ @@ -479,6 +484,7 @@ TclpGetUserHome(name, bufferPtr) endpwent(); return Tcl_DStringValue(bufferPtr); } +#endif /* *--------------------------------------------------------------------------- @@ -496,6 +502,7 @@ TclpGetUserHome(name, bufferPtr) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclpAccess(path, mode) CONST char *path; /* Path of file to access (UTF-8). */ @@ -511,6 +518,7 @@ TclpAccess(path, mode) return result; } +#endif /* *--------------------------------------------------------------------------- @@ -528,6 +536,7 @@ TclpAccess(path, mode) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclpChdir(dirName) CONST char *dirName; /* Path to new working directory (UTF-8). */ @@ -542,6 +551,7 @@ TclpChdir(dirName) return result; } +#endif /* *---------------------------------------------------------------------- @@ -559,6 +569,7 @@ TclpChdir(dirName) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclpLstat(path, bufPtr) CONST char *path; /* Path of file to stat (UTF-8). */ @@ -574,6 +585,7 @@ TclpLstat(path, bufPtr) return result; } +#endif /* *--------------------------------------------------------------------------- @@ -596,6 +608,7 @@ TclpLstat(path, bufPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM char * TclpGetCwd(interp, bufferPtr) Tcl_Interp *interp; /* If non-NULL, used for error reporting. */ @@ -618,6 +631,7 @@ TclpGetCwd(interp, bufferPtr) } return Tcl_ExternalToUtfDString(NULL, buffer, -1, bufferPtr); } +#endif /* *--------------------------------------------------------------------------- @@ -639,6 +653,7 @@ TclpGetCwd(interp, bufferPtr) *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM char * TclpReadlink(path, linkPtr) CONST char *path; /* Path of file to readlink (UTF-8). */ @@ -661,6 +676,7 @@ TclpReadlink(path, linkPtr) Tcl_ExternalToUtfDString(NULL, link, length, linkPtr); return Tcl_DStringValue(linkPtr); } +#endif /* *---------------------------------------------------------------------- @@ -678,6 +694,7 @@ TclpReadlink(path, linkPtr) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM int TclpStat(path, bufPtr) CONST char *path; /* Path of file to stat (in UTF-8). */ @@ -693,4 +710,4 @@ TclpStat(path, bufPtr) return result; } - +#endif diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 956c058..d76ccb1 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -7,7 +7,7 @@ * Copyright (c) 1999 by Scriptics Corporation. * All rights reserved. * - * RCS: @(#) $Id: tclUnixInit.c,v 1.18.2.3 2001/08/24 16:19:10 dgp Exp $ + * RCS: @(#) $Id: tclUnixInit.c,v 1.18.2.3.2.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include "tclInt.h" @@ -116,7 +116,10 @@ static CONST LocaleTable localeTable[] = { void TclpInitPlatform() { +#ifndef TCL_NO_FILESYSTEM + /* See tclFileName.c for definition and usage */ tclPlatform = TCL_PLATFORM_UNIX; +#endif /* * The code below causes SIGPIPE (broken pipe) errors to @@ -186,6 +189,7 @@ TclpInitPlatform() *--------------------------------------------------------------------------- */ +#ifndef TCL_NO_FILESYSTEM void TclpInitLibraryPath(path) CONST char *path; /* Path to the executable in native @@ -361,6 +365,7 @@ CONST char *path; /* Path to the executable in native TclSetLibraryPath(pathPtr); Tcl_DStringFree(&buffer); } +#endif /* *--------------------------------------------------------------------------- @@ -386,7 +391,9 @@ TclpSetInitialEncodings() { CONST char *encoding; int i; +#ifndef TCL_NO_FILESYSTEM Tcl_Obj *pathPtr; +#endif char *langEnv; /* @@ -493,6 +500,7 @@ TclpSetInitialEncodings() * encoding. */ +#ifndef TCL_NO_FILESYSTEM pathPtr = TclGetLibraryPath(); if (pathPtr != NULL) { int objc; @@ -512,6 +520,7 @@ TclpSetInitialEncodings() Tcl_DStringFree(&ds); } } +#endif /* * Keep the iso8859-1 encoding preloaded. The IO package uses it for @@ -693,7 +702,9 @@ int Tcl_Init(interp) Tcl_Interp *interp; /* Interpreter to initialize. */ { +#ifndef TCL_NO_FILESYSTEM Tcl_Obj *pathPtr; +#endif if (tclPreInitScript != NULL) { if (Tcl_Eval(interp, tclPreInitScript) == TCL_ERROR) { @@ -701,11 +712,13 @@ Tcl_Init(interp) }; } +#ifndef TCL_NO_FILESYSTEM pathPtr = TclGetLibraryPath(); if (pathPtr == NULL) { pathPtr = Tcl_NewObj(); } Tcl_SetVar2Ex(interp, "tcl_libPath", NULL, pathPtr, TCL_GLOBAL_ONLY); +#endif return Tcl_Eval(interp, initScript); } @@ -731,6 +744,13 @@ void Tcl_SourceRCFile(interp) Tcl_Interp *interp; /* Interpreter to source rc file into. */ { +#ifndef TCL_NO_FILESYSTEM +#ifndef TCL_NO_NONSTDCHAN + /* This functionality cannot be made available if the channel + * system is restricted to the standard channels, i.e. stdin, + * stdout, stderr. + */ + Tcl_DString temp; char *fileName; Tcl_Channel errChannel; @@ -769,6 +789,8 @@ Tcl_SourceRCFile(interp) } Tcl_DStringFree(&temp); } +#endif +#endif /* TCL_NO_FILESYSTEM */ } /* diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index f376746..5e9b285 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.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: tclUnixNotfy.c,v 1.10 2000/04/24 23:32:13 hobbs Exp $ + * RCS: @(#) $Id: tclUnixNotfy.c,v 1.10.20.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include "tclInt.h" @@ -20,6 +20,7 @@ extern TclStubs tclStubs; +#ifndef TCL_NO_FILEEVENTS /* * This structure is used to keep track of the notifier info for a * a registered file. @@ -52,6 +53,7 @@ typedef struct FileHandlerEvent { * FileHandler structure because it could * go away while the event is queued). */ } FileHandlerEvent; +#endif /* * The following static structure contains the state information for the @@ -60,8 +62,10 @@ typedef struct FileHandlerEvent { */ typedef struct ThreadSpecificData { +#ifndef TCL_NO_FILEEVENTS FileHandler *firstFileHandlerPtr; /* Pointer to head of file handler list. */ +#endif fd_mask checkMasks[3*MASK_SIZE]; /* This array is used to build up the masks * to be used in the next call to select. @@ -174,8 +178,10 @@ static Tcl_ThreadId notifierThread; #ifdef TCL_THREADS static void NotifierThreadProc _ANSI_ARGS_((ClientData clientData)); #endif +#ifndef TCL_NO_FILEEVENTS static int FileHandlerEventProc _ANSI_ARGS_((Tcl_Event *evPtr, int flags)); +#endif /* *---------------------------------------------------------------------- @@ -397,6 +403,7 @@ Tcl_ServiceModeHook(mode) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILEEVENTS void Tcl_CreateFileHandler(fd, mask, proc, clientData) int fd; /* Handle of stream to watch. */ @@ -459,6 +466,7 @@ Tcl_CreateFileHandler(fd, mask, proc, clientData) tsdPtr->numFdBits = fd+1; } } +#endif /* *---------------------------------------------------------------------- @@ -477,6 +485,7 @@ Tcl_CreateFileHandler(fd, mask, proc, clientData) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILEEVENTS void Tcl_DeleteFileHandler(fd) int fd; /* Stream id for which to remove callback procedure. */ @@ -554,6 +563,7 @@ Tcl_DeleteFileHandler(fd) } ckfree((char *) filePtr); } +#endif /* *---------------------------------------------------------------------- @@ -577,6 +587,7 @@ Tcl_DeleteFileHandler(fd) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_FILEEVENTS static int FileHandlerEventProc(evPtr, flags) Tcl_Event *evPtr; /* Event to service. */ @@ -627,6 +638,7 @@ FileHandlerEventProc(evPtr, flags) } return 1; } +#endif /* *---------------------------------------------------------------------- @@ -651,10 +663,12 @@ int Tcl_WaitForEvent(timePtr) Tcl_Time *timePtr; /* Maximum block time, or NULL. */ { +#ifndef TCL_NO_FILEEVENTS FileHandler *filePtr; FileHandlerEvent *fileEvPtr; - struct timeval timeout, *timeoutPtr; int bit, index, mask; +#endif + struct timeval timeout, *timeoutPtr; #ifdef TCL_THREADS int waitForFiles; #else @@ -783,6 +797,7 @@ Tcl_WaitForEvent(timePtr) } #endif +#ifndef TCL_NO_FILEEVENTS /* * Queue all detected file events before returning. */ @@ -821,6 +836,7 @@ Tcl_WaitForEvent(timePtr) } filePtr->readyMask = mask; } +#endif #ifdef TCL_THREADS Tcl_MutexUnlock(¬ifierMutex); #endif diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c index 9f04c3d..a6196c3 100644 --- a/unix/tclUnixPipe.c +++ b/unix/tclUnixPipe.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: tclUnixPipe.c,v 1.9.2.2 2001/10/18 01:02:02 hobbs Exp $ + * RCS: @(#) $Id: tclUnixPipe.c,v 1.9.2.2.2.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include "tclInt.h" #include "tclPort.h" +#ifndef TCL_NO_PIPES /* * The following macros convert between TclFile's and fd's. The conversion * simple involves shifting fd's up by one to ensure that no valid fd is ever @@ -285,7 +286,9 @@ TclpCloseFile(file) return 0; } +#ifndef TCL_NO_FILEEVENTS Tcl_DeleteFileHandler(fd); +#endif return close(fd); } @@ -1046,6 +1049,7 @@ PipeWatchProc(instanceData, mask) * combination of TCL_READABLE, * TCL_WRITABEL and TCL_EXCEPTION. */ { +#ifndef TCL_NO_FILEEVENTS PipeState *psPtr = (PipeState *) instanceData; int newmask; @@ -1069,6 +1073,7 @@ PipeWatchProc(instanceData, mask) Tcl_DeleteFileHandler(GetFd(psPtr->outFile)); } } +#endif } /* @@ -1141,6 +1146,7 @@ Tcl_WaitPid(pid, statPtr, options) } } } +#endif /* *---------------------------------------------------------------------- @@ -1159,6 +1165,7 @@ Tcl_WaitPid(pid, statPtr, options) *---------------------------------------------------------------------- */ +#ifndef TCL_NO_PIDCMD /* ARGSUSED */ int Tcl_PidObjCmd(dummy, interp, objc, objv) @@ -1167,12 +1174,13 @@ Tcl_PidObjCmd(dummy, interp, objc, objv) int objc; /* Number of arguments. */ Tcl_Obj *CONST *objv; /* Argument strings. */ { +#ifndef TCL_NO_PIPES Tcl_Channel chan; Tcl_ChannelType *chanTypePtr; PipeState *pipePtr; int i; Tcl_Obj *resultPtr, *longObjPtr; - +#endif if (objc > 2) { Tcl_WrongNumArgs(interp, 1, objv, "?channelId?"); return TCL_ERROR; @@ -1180,6 +1188,7 @@ Tcl_PidObjCmd(dummy, interp, objc, objv) if (objc == 1) { Tcl_SetLongObj(Tcl_GetObjResult(interp), (long) getpid()); } else { +#ifndef TCL_NO_PIPES chan = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), NULL); if (chan == (Tcl_Channel) NULL) { return TCL_ERROR; @@ -1194,6 +1203,11 @@ Tcl_PidObjCmd(dummy, interp, objc, objv) longObjPtr = Tcl_NewLongObj((long) TclpGetPid(pipePtr->pidPtr[i])); Tcl_ListObjAppendElement(NULL, resultPtr, longObjPtr); } +#else + /* IOS FIXME: Add error message */ + return TCL_ERROR; +#endif } return TCL_OK; } +#endif /* TCL_NO_PIDCMD */ diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index 37d430e..13a8521 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.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: tclUnixSock.c,v 1.4 1999/04/16 00:48:05 stanton Exp $ + * RCS: @(#) $Id: tclUnixSock.c,v 1.4.30.1 2001/11/28 17:58:37 andreas_kupries Exp $ */ #include "tcl.h" @@ -39,10 +39,16 @@ * The following variable holds the network name of this host. */ +#ifndef TCL_NO_SOCKETS static char hostname[TCL_HOSTNAME_LEN + 1]; static int hostnameInited = 0; TCL_DECLARE_MUTEX(hostMutex) +#else +/* Without sockets a network hostname makes no sense. + */ +static char hostname [] = ""; +#endif /* *---------------------------------------------------------------------- @@ -65,6 +71,12 @@ TCL_DECLARE_MUTEX(hostMutex) char * Tcl_GetHostName() { +#ifdef TCL_NO_SOCKETS + /* Empty string, pre-initialized. + */ + return hostname; +#else + #ifndef NO_UNAME struct utsname u; struct hostent *hp; @@ -109,6 +121,7 @@ Tcl_GetHostName() hostnameInited = 1; Tcl_MutexUnlock(&hostMutex); return hostname; +#endif } /* @@ -131,5 +144,9 @@ int TclpHasSockets(interp) Tcl_Interp *interp; /* Not used. */ { +#ifndef TCL_NO_SOCKETS return TCL_OK; +#else + return TCL_ERROR; +#endif } -- cgit v0.12