summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2002-07-19 12:31:09 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2002-07-19 12:31:09 (GMT)
commitd49b43a9ceee81dcee52620d4d2469df9624a457 (patch)
tree4bf2d4935b5e97743834dba726fe88543f867664 /generic
parent336c85fe81ce3721d86da085058d09a6322e2a30 (diff)
downloadtcl-d49b43a9ceee81dcee52620d4d2469df9624a457.zip
tcl-d49b43a9ceee81dcee52620d4d2469df9624a457.tar.gz
tcl-d49b43a9ceee81dcee52620d4d2469df9624a457.tar.bz2
Global symbols are now all either prefixed with 'tcl' (or 'Tcl' or ...) or have file-scope.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclBasic.c4
-rw-r--r--generic/tclCompExpr.c4
-rw-r--r--generic/tclCompile.c10
-rw-r--r--generic/tclCompile.h20
-rw-r--r--generic/tclExecute.c13
-rw-r--r--generic/tclIOUtil.c41
-rw-r--r--generic/tclInt.h3
-rw-r--r--generic/tclUtf.c6
8 files changed, 54 insertions, 47 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 86730ab..a2d1dcd 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.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: tclBasic.c,v 1.64 2002/07/18 13:37:45 msofer Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.65 2002/07/19 12:31:09 dkf Exp $
*/
#include "tclInt.h"
@@ -482,7 +482,7 @@ Tcl_CreateInterp()
*/
i = 0;
- for (builtinFuncPtr = builtinFuncTable; builtinFuncPtr->name != NULL;
+ for (builtinFuncPtr = tclBuiltinFuncTable; builtinFuncPtr->name != NULL;
builtinFuncPtr++) {
Tcl_CreateMathFunc((Tcl_Interp *) iPtr, builtinFuncPtr->name,
builtinFuncPtr->numArgs, builtinFuncPtr->argTypes,
diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c
index 5e8567f..e51aa15 100644
--- a/generic/tclCompExpr.c
+++ b/generic/tclCompExpr.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: tclCompExpr.c,v 1.10 2002/06/21 21:17:39 jenglish Exp $
+ * RCS: @(#) $Id: tclCompExpr.c,v 1.11 2002/07/19 12:31:09 dkf Exp $
*/
#include "tclInt.h"
@@ -110,7 +110,7 @@ typedef struct OperatorDesc {
* Ignored if numOperands is 0. */
} OperatorDesc;
-OperatorDesc operatorTable[] = {
+static OperatorDesc operatorTable[] = {
{"*", 2, INST_MULT},
{"/", 2, INST_DIV},
{"%", 2, INST_MOD},
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 20d0448..dc2aa25 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.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: tclCompile.c,v 1.38 2002/07/11 12:39:16 msofer Exp $
+ * RCS: @(#) $Id: tclCompile.c,v 1.39 2002/07/19 12:31:09 dkf Exp $
*/
#include "tclInt.h"
@@ -52,7 +52,7 @@ static int traceInitialized = 0;
* existence of a procedure call frame to distinguish these.
*/
-InstructionDesc instructionTable[] = {
+InstructionDesc tclInstructionTable[] = {
/* Name Bytes stackEffect #Opnds Operand types Stack top, next */
{"done", 1, -1, 0, {OPERAND_NONE}},
/* Finish ByteCode execution and return stktop (top stack item) */
@@ -2518,7 +2518,7 @@ TclFixupForwardJump(envPtr, jumpFixupPtr, jumpDist, distThreshold)
*
* Results:
* Returns a pointer to the global instruction table, same as the
- * expression (&instructionTable[0]).
+ * expression (&tclInstructionTable[0]).
*
* Side effects:
* None.
@@ -2529,7 +2529,7 @@ TclFixupForwardJump(envPtr, jumpFixupPtr, jumpDist, distThreshold)
void * /* == InstructionDesc* == */
TclGetInstructionTable()
{
- return &instructionTable[0];
+ return &tclInstructionTable[0];
}
/*
@@ -3186,7 +3186,7 @@ TclPrintInstruction(codePtr, pc)
{
Proc *procPtr = codePtr->procPtr;
unsigned char opCode = *pc;
- register InstructionDesc *instDesc = &instructionTable[opCode];
+ register InstructionDesc *instDesc = &tclInstructionTable[opCode];
unsigned char *codeStart = codePtr->codeStart;
unsigned int pcOffset = (pc - codeStart);
int opnd, i, j;
diff --git a/generic/tclCompile.h b/generic/tclCompile.h
index d76d405..e6c2740 100644
--- a/generic/tclCompile.h
+++ b/generic/tclCompile.h
@@ -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: tclCompile.h,v 1.28 2002/06/28 21:24:19 msofer Exp $
+ * RCS: @(#) $Id: tclCompile.h,v 1.29 2002/07/19 12:31:09 dkf Exp $
*/
#ifndef _TCLCOMPILATION
@@ -392,11 +392,11 @@ typedef struct ByteCode {
} ByteCode;
/*
- * Opcodes for the Tcl bytecode instructions. These must correspond to the
- * entries in the table of instruction descriptions, instructionTable, in
- * tclCompile.c. Also, the order and number of the expression opcodes
- * (e.g., INST_LOR) must match the entries in the array operatorStrings in
- * tclExecute.c.
+ * Opcodes for the Tcl bytecode instructions. These must correspond to
+ * the entries in the table of instruction descriptions,
+ * tclInstructionTable, in tclCompile.c. Also, the order and number of
+ * the expression opcodes (e.g., INST_LOR) must match the entries in
+ * the array operatorStrings in tclExecute.c.
*/
/* Opcodes 0 to 9 */
@@ -566,12 +566,12 @@ typedef struct InstructionDesc {
/* The type of each operand. */
} InstructionDesc;
-extern InstructionDesc instructionTable[];
+extern InstructionDesc tclInstructionTable[];
/*
* Definitions of the values of the INST_CALL_BUILTIN_FUNC instruction's
* operand byte. Each value denotes a builtin Tcl math function. These
- * values must correspond to the entries in the builtinFuncTable array
+ * values must correspond to the entries in the tclBuiltinFuncTable array
* below and to the values stored in the tclInt.h MathFunc structure's
* builtinFuncIndex field.
*/
@@ -624,7 +624,7 @@ typedef struct {
* function when invoking it. */
} BuiltinFunc;
-extern BuiltinFunc builtinFuncTable[];
+extern BuiltinFunc tclBuiltinFuncTable[];
/*
* Compilation of some Tcl constructs such as if commands and the logical or
@@ -846,7 +846,7 @@ EXTERN void TclVerifyLocalLiteralTable _ANSI_ARGS_((
#define TclUpdateStackReqs(op, i, envPtr) \
{\
- int delta = instructionTable[(op)].stackEffect;\
+ int delta = tclInstructionTable[(op)].stackEffect;\
if (delta) {\
if (delta < 0) {\
if((envPtr)->maxStackDepth < (envPtr)->currStackDepth) {\
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 1050a26..b8d1817 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.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: tclExecute.c,v 1.79 2002/07/17 14:23:13 dkf Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.80 2002/07/19 12:31:09 dkf Exp $
*/
#include "tclInt.h"
@@ -403,7 +403,7 @@ static int VerifyExprObjType _ANSI_ARGS_((Tcl_Interp *interp,
* operand byte.
*/
-BuiltinFunc builtinFuncTable[] = {
+BuiltinFunc tclBuiltinFuncTable[] = {
#ifndef TCL_NO_MATH
{"acos", 1, {TCL_DOUBLE}, ExprUnaryFunc, (ClientData) acos},
{"asin", 1, {TCL_DOUBLE}, ExprUnaryFunc, (ClientData) asin},
@@ -3567,7 +3567,7 @@ TclExecuteByteCode(interp, codePtr)
TRACE(("UNRECOGNIZED BUILTIN FUNC CODE %d\n", opnd));
panic("TclExecuteByteCode: unrecognized builtin function code %d", opnd);
}
- mathFuncPtr = &(builtinFuncTable[opnd]);
+ mathFuncPtr = &(tclBuiltinFuncTable[opnd]);
DECACHE_STACK_INFO();
result = (*mathFuncPtr->proc)(interp, eePtr,
mathFuncPtr->clientData);
@@ -4706,7 +4706,7 @@ GetOpcodeName(pc)
{
unsigned char opCode = *pc;
- return instructionTable[opCode].name;
+ return tclInstructionTable[opCode].name;
}
#endif /* TCL_COMPILE_DEBUG */
@@ -6141,7 +6141,7 @@ EvalStatsCmd(unused, interp, argc, argv)
for (i = 0; i <= LAST_INST_OPCODE; i++) {
if (statsPtr->instructionCount[i]) {
fprintf(stdout, "%20s %8ld %6.1f%%\n",
- instructionTable[i].name,
+ tclInstructionTable[i].name,
statsPtr->instructionCount[i],
(statsPtr->instructionCount[i]*100.0) / numInstructions);
}
@@ -6150,8 +6150,7 @@ EvalStatsCmd(unused, interp, argc, argv)
fprintf(stdout, "\nInstructions NEVER executed:\n");
for (i = 0; i <= LAST_INST_OPCODE; i++) {
if (statsPtr->instructionCount[i] == 0) {
- fprintf(stdout, "%20s\n",
- instructionTable[i].name);
+ fprintf(stdout, "%20s\n", tclInstructionTable[i].name);
}
}
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index dea7cff..ab0da46 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -17,7 +17,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.59 2002/07/18 16:26:03 vincentdarley Exp $
+ * RCS: @(#) $Id: tclIOUtil.c,v 1.60 2002/07/19 12:31:10 dkf Exp $
*/
#include "tclInt.h"
@@ -373,7 +373,7 @@ Tcl_FSLinkProc TclpObjLink;
Tcl_FSListVolumesProc TclpObjListVolumes;
/* Define the native filesystem dispatch table */
-Tcl_Filesystem nativeFilesystem = {
+Tcl_Filesystem tclNativeFilesystem = {
"native",
sizeof(Tcl_Filesystem),
TCL_FILESYSTEM_VERSION_1,
@@ -422,7 +422,7 @@ Tcl_Filesystem nativeFilesystem = {
*/
static FilesystemRecord nativeFilesystemRecord = {
NULL,
- &nativeFilesystem,
+ &tclNativeFilesystem,
1,
NULL
};
@@ -437,18 +437,25 @@ static FilesystemRecord nativeFilesystemRecord = {
* filesystems. Any time it changes, all cached filesystem
* representations are suspect and must be freed.
*/
-int theFilesystemEpoch = 0;
-/* Stores the linked list of filesystems.*/
+static int theFilesystemEpoch = 0;
+
+/*
+ * Stores the linked list of filesystems.
+ */
static FilesystemRecord *filesystemList = &nativeFilesystemRecord;
+
/*
* The number of loops which are currently iterating over the linked
* list. If this is greater than zero, we can't modify the list.
*/
-int filesystemIteratorsInProgress = 0;
-/* Someone wants to modify the list of filesystems if this is set. */
-int filesystemWantToModify = 0;
+static int filesystemIteratorsInProgress = 0;
+
+/*
+ * Someone wants to modify the list of filesystems if this is set.
+ */
+static int filesystemWantToModify = 0;
-Tcl_Condition filesystemOkToModify = NULL;
+static Tcl_Condition filesystemOkToModify = NULL;
TCL_DECLARE_MUTEX(filesystemMutex)
@@ -2601,7 +2608,7 @@ Tcl_FSLoadFile(interp, pathPtr, sym1, sym2, proc1Ptr, proc2Ptr,
tvdlPtr->divertedFile = copyToPtr;
/*
* This is the filesystem we loaded it into. It is
- * almost certainly the nativeFilesystem, but we don't
+ * almost certainly the tclNativeFilesystem, but we don't
* want to make that assumption. Since we have a
* reference to 'copyToPtr', we already have a refCount
* on this filesystem, so we don't need to worry about it
@@ -2976,7 +2983,7 @@ Tcl_FSSplitPath(pathPtr, lenPtr)
if (FSGetPathType(pathPtr, &fsPtr, &driveNameLength)
== TCL_PATH_ABSOLUTE) {
- if (fsPtr == &nativeFilesystem) {
+ if (fsPtr == &tclNativeFilesystem) {
return TclpNativeSplitPath(pathPtr, lenPtr);
}
} else {
@@ -3130,7 +3137,7 @@ Tcl_FSJoinPath(listObj, elements)
*/
if (*strElt == '\0') continue;
- if (fsPtr == &nativeFilesystem || fsPtr == NULL) {
+ if (fsPtr == &tclNativeFilesystem || fsPtr == NULL) {
TclpNativeJoinPath(res, strElt);
} else {
char separator = '/';
@@ -3234,7 +3241,7 @@ GetPathType(pathObjPtr, filesystemPtrPtr, driveNameLengthPtr, driveNameRef)
* save the overhead of the native filesystem returning us
* a list of volumes all the time, it is better.
*/
- if ((fsRecPtr->fsPtr != &nativeFilesystem) && (proc != NULL)) {
+ if ((fsRecPtr->fsPtr != &tclNativeFilesystem) && (proc != NULL)) {
int numVolumes;
Tcl_Obj *thisFsVolumes = (*proc)();
if (thisFsVolumes != NULL) {
@@ -3292,7 +3299,7 @@ GetPathType(pathObjPtr, filesystemPtrPtr, driveNameLengthPtr, driveNameRef)
type = TclpGetNativePathType(pathObjPtr, driveNameLengthPtr,
driveNameRef);
if ((type == TCL_PATH_ABSOLUTE) && (filesystemPtrPtr != NULL)) {
- *filesystemPtrPtr = &nativeFilesystem;
+ *filesystemPtrPtr = &tclNativeFilesystem;
}
}
return type;
@@ -4437,11 +4444,11 @@ Tcl_FSGetInternalRep(pathObjPtr, fsPtr)
*---------------------------------------------------------------------------
*/
-CONST char*
+CONST char *
Tcl_FSGetNativePath(pathObjPtr)
- Tcl_Obj* pathObjPtr;
+ Tcl_Obj *pathObjPtr;
{
- return (CONST char *)Tcl_FSGetInternalRep(pathObjPtr, &nativeFilesystem);
+ return (CONST char *)Tcl_FSGetInternalRep(pathObjPtr, &tclNativeFilesystem);
}
/*
diff --git a/generic/tclInt.h b/generic/tclInt.h
index cef4a74..05780ed 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.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: tclInt.h,v 1.106 2002/07/18 16:26:03 vincentdarley Exp $
+ * RCS: @(#) $Id: tclInt.h,v 1.107 2002/07/19 12:31:10 dkf Exp $
*/
#ifndef _TCLINT
@@ -1613,6 +1613,7 @@ extern char * tclDefaultEncodingDir;
extern Tcl_ChannelType tclFileChannelType;
extern char * tclMemDumpFileName;
extern TclPlatformType tclPlatform;
+extern Tcl_Filesystem tclNativeFilesystem;
/*
* Variables denoting the Tcl object types defined in the core.
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index 522b835..897d743 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.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: tclUtf.c,v 1.26 2002/05/30 03:27:09 hobbs Exp $
+ * RCS: @(#) $Id: tclUtf.c,v 1.27 2002/07/19 12:31:10 dkf Exp $
*/
#include "tclInt.h"
@@ -61,8 +61,8 @@
* The following structures are used when mapping between Unicode (UCS-2)
* and UTF-8.
*/
-
-CONST unsigned char totalBytes[256] = {
+
+static CONST unsigned char totalBytes[256] = {
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,