From a87c1ffef9b5c696cd26cd041002325c871cafde Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 29 Sep 2003 22:38:20 +0000 Subject: Symbols which are visible outside a single compilation unit must have the prefix 'Tcl' to keep them out of the way of non-Tcl C code on Unix. (Problem reported by George Staplin.) --- ChangeLog | 5 +++++ generic/tclFileSystem.h | 8 ++++---- generic/tclIOUtil.c | 20 ++++++++++---------- generic/tclPathObj.c | 28 ++++++++++++++-------------- win/tclWin32Dll.c | 8 ++++---- win/tclWinFile.c | 4 +--- 6 files changed, 38 insertions(+), 35 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6109d73..33b864d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2003-09-29 Donal K. Fellows + * generic/tclPathObj.c (TclNativePathInFilesystem,TclFSGetPathType): + * generic/tclIOUtil.c (TclNativeDupInternalRep,TclGetPathType): Rename + to make sure function names won't interfere with other non-Tcl + code (reported by George Staplin) + TIP#121 IMPLEMENTATION FROM JOE MISTACHKIN * generic/tclEvent.c (Tcl_SetExitProc,Tcl_Exit): Implementation of diff --git a/generic/tclFileSystem.h b/generic/tclFileSystem.h index 7d74dc2..4514391 100644 --- a/generic/tclFileSystem.h +++ b/generic/tclFileSystem.h @@ -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: tclFileSystem.h,v 1.3 2003/08/23 12:16:49 vasiljevic Exp $ + * RCS: @(#) $Id: tclFileSystem.h,v 1.4 2003/09/29 22:38:20 dkf Exp $ */ /* @@ -88,10 +88,10 @@ extern Tcl_ThreadDataKey fsDataKey; /* * Private shared functions for use by tclIOUtil.c and tclPathObj.c */ -Tcl_PathType FSGetPathType _ANSI_ARGS_((Tcl_Obj *pathObjPtr, +Tcl_PathType TclFSGetPathType _ANSI_ARGS_((Tcl_Obj *pathObjPtr, Tcl_Filesystem **filesystemPtrPtr, int *driveNameLengthPtr)); -Tcl_PathType GetPathType _ANSI_ARGS_((Tcl_Obj *pathObjPtr, +Tcl_PathType TclGetPathType _ANSI_ARGS_((Tcl_Obj *pathObjPtr, Tcl_Filesystem **filesystemPtrPtr, int *driveNameLengthPtr, Tcl_Obj **driveNameRef)); -Tcl_FSPathInFilesystemProc NativePathInFilesystem; +Tcl_FSPathInFilesystemProc TclNativePathInFilesystem; diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index e3013b9..e5b3766 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.83 2003/09/05 21:52:12 dgp Exp $ + * RCS: @(#) $Id: tclIOUtil.c,v 1.84 2003/09/29 22:38:20 dkf Exp $ */ #include "tclInt.h" @@ -293,7 +293,7 @@ TCL_DECLARE_MUTEX(obsoleteFsHookMutex) */ static Tcl_FSFilesystemSeparatorProc NativeFilesystemSeparator; static Tcl_FSFreeInternalRepProc NativeFreeInternalRep; -Tcl_FSDupInternalRepProc NativeDupInternalRep; +Tcl_FSDupInternalRepProc TclNativeDupInternalRep; static Tcl_FSCreateInternalRepProc NativeCreateNativeRep; static Tcl_FSFileAttrStringsProc NativeFileAttrStrings; static Tcl_FSFileAttrsGetProc NativeFileAttrsGet; @@ -339,8 +339,8 @@ Tcl_Filesystem tclNativeFilesystem = { "native", sizeof(Tcl_Filesystem), TCL_FILESYSTEM_VERSION_1, - &NativePathInFilesystem, - &NativeDupInternalRep, + &TclNativePathInFilesystem, + &TclNativeDupInternalRep, &NativeFreeInternalRep, &TclpNativeToNormalized, &NativeCreateNativeRep, @@ -2555,7 +2555,7 @@ Tcl_FSLoadFile(interp, pathPtr, sym1, sym2, proc1Ptr, proc2Ptr, } else { /* We need the native rep */ tvdlPtr->divertedFileNativeRep = - NativeDupInternalRep(Tcl_FSGetInternalRep(copyToPtr, + TclNativeDupInternalRep(Tcl_FSGetInternalRep(copyToPtr, copyFsPtr)); /* * We don't need or want references to the copied @@ -2867,7 +2867,7 @@ Tcl_FSSplitPath(pathPtr, lenPtr) * Perform platform specific splitting. */ - if (FSGetPathType(pathPtr, &fsPtr, &driveNameLength) + if (TclFSGetPathType(pathPtr, &fsPtr, &driveNameLength) == TCL_PATH_ABSOLUTE) { if (fsPtr == &tclNativeFilesystem) { return TclpNativeSplitPath(pathPtr, lenPtr); @@ -2957,7 +2957,7 @@ TclFSInternalToNormalized(fromFilesystem, clientData, fsRecPtrPtr) /* *---------------------------------------------------------------------- * - * GetPathType -- + * TclGetPathType -- * * Helper function used by FSGetPathType. * @@ -2974,7 +2974,7 @@ TclFSInternalToNormalized(fromFilesystem, clientData, fsRecPtrPtr) */ Tcl_PathType -GetPathType(pathObjPtr, filesystemPtrPtr, driveNameLengthPtr, driveNameRef) +TclGetPathType(pathObjPtr, filesystemPtrPtr, driveNameLengthPtr, driveNameRef) Tcl_Obj *pathObjPtr; Tcl_Filesystem **filesystemPtrPtr; int *driveNameLengthPtr; @@ -3625,7 +3625,7 @@ TclpNativeToNormalized(clientData) /* *--------------------------------------------------------------------------- * - * NativeDupInternalRep -- + * TclNativeDupInternalRep -- * * Duplicate the native representation. * @@ -3639,7 +3639,7 @@ TclpNativeToNormalized(clientData) *--------------------------------------------------------------------------- */ ClientData -NativeDupInternalRep(clientData) +TclNativeDupInternalRep(clientData) ClientData clientData; { ClientData copy; diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index 3477b60..7283608 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.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: tclPathObj.c,v 1.8 2003/09/18 11:29:27 vincentdarley Exp $ + * RCS: @(#) $Id: tclPathObj.c,v 1.9 2003/09/29 22:38:21 dkf Exp $ */ #include "tclInt.h" @@ -239,13 +239,13 @@ Tcl_PathType Tcl_FSGetPathType(pathObjPtr) Tcl_Obj *pathObjPtr; { - return FSGetPathType(pathObjPtr, NULL, NULL); + return TclFSGetPathType(pathObjPtr, NULL, NULL); } /* *---------------------------------------------------------------------- * - * FSGetPathType -- + * TclFSGetPathType -- * * Determines whether a given path is relative to the current * directory, relative to the current volume, or absolute. If the @@ -267,25 +267,25 @@ Tcl_FSGetPathType(pathObjPtr) */ Tcl_PathType -FSGetPathType(pathObjPtr, filesystemPtrPtr, driveNameLengthPtr) +TclFSGetPathType(pathObjPtr, filesystemPtrPtr, driveNameLengthPtr) Tcl_Obj *pathObjPtr; Tcl_Filesystem **filesystemPtrPtr; int *driveNameLengthPtr; { if (Tcl_FSConvertToPathType(NULL, pathObjPtr) != TCL_OK) { - return GetPathType(pathObjPtr, filesystemPtrPtr, - driveNameLengthPtr, NULL); + return TclGetPathType(pathObjPtr, filesystemPtrPtr, + driveNameLengthPtr, NULL); } else { FsPath *fsPathPtr = (FsPath*) PATHOBJ(pathObjPtr); if (fsPathPtr->cwdPtr != NULL) { if (PATHFLAGS(pathObjPtr) == 0) { return TCL_PATH_RELATIVE; } - return FSGetPathType(fsPathPtr->cwdPtr, filesystemPtrPtr, - driveNameLengthPtr); + return TclFSGetPathType(fsPathPtr->cwdPtr, filesystemPtrPtr, + driveNameLengthPtr); } else { - return GetPathType(pathObjPtr, filesystemPtrPtr, - driveNameLengthPtr, NULL); + return TclGetPathType(pathObjPtr, filesystemPtrPtr, + driveNameLengthPtr, NULL); } } } @@ -357,7 +357,7 @@ Tcl_FSJoinPath(listObj, elements) Tcl_Obj *tail; Tcl_PathType type; Tcl_ListObjIndex(NULL, listObj, 1, &tail); - type = GetPathType(tail, NULL, NULL, NULL); + type = TclGetPathType(tail, NULL, NULL, NULL); if (type == TCL_PATH_RELATIVE) { CONST char *str; int len; @@ -398,7 +398,7 @@ Tcl_FSJoinPath(listObj, elements) Tcl_ListObjIndex(NULL, listObj, i, &elt); strElt = Tcl_GetStringFromObj(elt, &strEltLen); - type = GetPathType(elt, &fsPtr, &driveNameLength, &driveName); + type = TclGetPathType(elt, &fsPtr, &driveNameLength, &driveName); if (type != TCL_PATH_RELATIVE) { /* Zero out the current result */ Tcl_DecrRefCount(res); @@ -1888,7 +1888,7 @@ UpdateStringOfFsPath(objPtr) /* *--------------------------------------------------------------------------- * - * NativePathInFilesystem -- + * TclNativePathInFilesystem -- * * Any path object is acceptable to the native filesystem, by * default (we will throw errors when illegal paths are actually @@ -1908,7 +1908,7 @@ UpdateStringOfFsPath(objPtr) *--------------------------------------------------------------------------- */ int -NativePathInFilesystem(pathPtr, clientDataPtr) +TclNativePathInFilesystem(pathPtr, clientDataPtr) Tcl_Obj *pathPtr; ClientData *clientDataPtr; { diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c index 1d6266b..09b9046 100644 --- a/win/tclWin32Dll.c +++ b/win/tclWin32Dll.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: tclWin32Dll.c,v 1.26 2003/06/23 10:14:02 vincentdarley Exp $ + * RCS: @(#) $Id: tclWin32Dll.c,v 1.27 2003/09/29 22:38:21 dkf Exp $ */ #include "tclWinInt.h" @@ -181,7 +181,7 @@ MountPointMap *driveLetterLookup = NULL; TCL_DECLARE_MUTEX(mountPointMap) /* We will need this below */ -extern Tcl_FSDupInternalRepProc NativeDupInternalRep; +extern Tcl_FSDupInternalRepProc TclNativeDupInternalRep; #ifdef __WIN32__ #ifndef STATIC_BUILD @@ -768,7 +768,7 @@ TclWinDriveLetterForVolMountPoint(CONST WCHAR *mountPoint) } if (!alreadyStored) { dlPtr2 = (MountPointMap*) ckalloc(sizeof(MountPointMap)); - dlPtr2->volumeName = NativeDupInternalRep(Target); + dlPtr2->volumeName = TclNativeDupInternalRep(Target); dlPtr2->driveLetter = 'A' + (drive[0] - L'A'); dlPtr2->nextPtr = driveLetterLookup; driveLetterLookup = dlPtr2; @@ -789,7 +789,7 @@ TclWinDriveLetterForVolMountPoint(CONST WCHAR *mountPoint) * up each time. */ dlPtr2 = (MountPointMap*) ckalloc(sizeof(MountPointMap)); - dlPtr2->volumeName = NativeDupInternalRep((ClientData)mountPoint); + dlPtr2->volumeName = TclNativeDupInternalRep((ClientData)mountPoint); dlPtr2->driveLetter = -1; dlPtr2->nextPtr = driveLetterLookup; driveLetterLookup = dlPtr2; diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 82cb2ae..8768261 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.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: tclWinFile.c,v 1.53 2003/08/27 20:12:03 davygrvy Exp $ + * RCS: @(#) $Id: tclWinFile.c,v 1.54 2003/09/29 22:38:21 dkf Exp $ */ //#define _WIN32_WINNT 0x0500 @@ -163,8 +163,6 @@ typedef NET_API_STATUS NET_API_FUNCTION NETAPIBUFFERFREEPROC typedef NET_API_STATUS NET_API_FUNCTION NETGETDCNAMEPROC (LPWSTR servername, LPWSTR domainname, LPBYTE *bufptr); -extern Tcl_FSDupInternalRepProc NativeDupInternalRep; - /* * Declarations for local procedures defined in this file: */ -- cgit v0.12