summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixInit.c
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2001-11-28 17:58:35 (GMT)
committerandreas_kupries <akupries@shaw.ca>2001-11-28 17:58:35 (GMT)
commit90daebad86c36a4a83ff0831078e6f8351d9e9e6 (patch)
treecc2fca491a21d7bf88511ee275a12ed085b676a7 /unix/tclUnixInit.c
parente87036076007b0251db8cec91216cec265d24cdb (diff)
downloadtcl-90daebad86c36a4a83ff0831078e6f8351d9e9e6.zip
tcl-90daebad86c36a4a83ff0831078e6f8351d9e9e6.tar.gz
tcl-90daebad86c36a4a83ff0831078e6f8351d9e9e6.tar.bz2
* 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 **** ***************************
Diffstat (limited to 'unix/tclUnixInit.c')
-rw-r--r--unix/tclUnixInit.c24
1 files changed, 23 insertions, 1 deletions
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 */
}
/*