summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2003-10-22 08:21:14 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2003-10-22 08:21:14 (GMT)
commitfcd9762272f467238addbbfcc715432865d64ae6 (patch)
tree5d0a59fa7d5de79dd0c476d74d501d028182ef9f
parent4babd9463cca124b608680aceabf2132b40d7c26 (diff)
downloadtcl-fcd9762272f467238addbbfcc715432865d64ae6.zip
tcl-fcd9762272f467238addbbfcc715432865d64ae6.tar.gz
tcl-fcd9762272f467238addbbfcc715432865d64ae6.tar.bz2
Changed FILE_ to FCMD_ to prevent symbol/#def collisions. [Bug 822528]
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclCmdAH.c90
2 files changed, 51 insertions, 45 deletions
diff --git a/ChangeLog b/ChangeLog
index 7a901ce..3626613 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-10-22 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tclCmdAH.c (Tcl_FileObjCmd): Changed FILE_ prefix for
+ option enumeration to FCMD_ to prevent collision with symbols
+ defined by Cygwin/Mingw32 on NT. [Bug 822528]
+
2003-10-21 Daniel Steffen <das@users.sourceforge.net>
* tools/tcltk-man2html.tcl: fixed incorrect html generated for
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c
index 2e6ba99..8f4ec9b 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.27.2.6 2003/05/14 23:01:56 dkf Exp $
+ * RCS: @(#) $Id: tclCmdAH.c,v 1.27.2.7 2003/10/22 08:21:15 dkf Exp $
*/
#include "tclInt.h"
@@ -763,7 +763,7 @@ Tcl_ExprObjCmd(dummy, interp, objc, objv)
* EMBEDDED NULLS, WHICH COULD THEORETICALLY HAPPEN ON A MAC.
* With the object-based Tcl_FS APIs, the above NOTE may no
* longer be true. In any case this assertion should be tested.
- *
+ *
* Results:
* A standard Tcl result.
*
@@ -801,16 +801,16 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
(char *) NULL
};
enum options {
- FILE_ATIME, FILE_ATTRIBUTES, FILE_CHANNELS, FILE_COPY,
- FILE_DELETE,
- FILE_DIRNAME, FILE_EXECUTABLE, FILE_EXISTS, FILE_EXTENSION,
- FILE_ISDIRECTORY, FILE_ISFILE, FILE_JOIN, FILE_LINK,
- FILE_LSTAT, FILE_MTIME, FILE_MKDIR, FILE_NATIVENAME,
- FILE_NORMALIZE, FILE_OWNED,
- FILE_PATHTYPE, FILE_READABLE, FILE_READLINK, FILE_RENAME,
- FILE_ROOTNAME, FILE_SEPARATOR, FILE_SIZE, FILE_SPLIT,
- FILE_STAT, FILE_SYSTEM,
- FILE_TAIL, FILE_TYPE, FILE_VOLUMES, FILE_WRITABLE
+ FCMD_ATIME, FCMD_ATTRIBUTES, FCMD_CHANNELS, FCMD_COPY,
+ FCMD_DELETE,
+ FCMD_DIRNAME, FCMD_EXECUTABLE, FCMD_EXISTS, FCMD_EXTENSION,
+ FCMD_ISDIRECTORY, FCMD_ISFILE, FCMD_JOIN, FCMD_LINK,
+ FCMD_LSTAT, FCMD_MTIME, FCMD_MKDIR, FCMD_NATIVENAME,
+ FCMD_NORMALIZE, FCMD_OWNED,
+ FCMD_PATHTYPE, FCMD_READABLE, FCMD_READLINK, FCMD_RENAME,
+ FCMD_ROOTNAME, FCMD_SEPARATOR, FCMD_SIZE, FCMD_SPLIT,
+ FCMD_STAT, FCMD_SYSTEM,
+ FCMD_TAIL, FCMD_TYPE, FCMD_VOLUMES, FCMD_WRITABLE
};
if (objc < 2) {
@@ -823,7 +823,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
}
switch ((enum options) index) {
- case FILE_ATIME: {
+ case FCMD_ATIME: {
Tcl_StatBuf buf;
struct utimbuf tval;
@@ -862,10 +862,10 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
Tcl_SetLongObj(Tcl_GetObjResult(interp), (long) buf.st_atime);
return TCL_OK;
}
- case FILE_ATTRIBUTES: {
+ case FCMD_ATTRIBUTES: {
return TclFileAttrsCmd(interp, objc, objv);
}
- case FILE_CHANNELS: {
+ case FCMD_CHANNELS: {
if ((objc < 2) || (objc > 3)) {
Tcl_WrongNumArgs(interp, 2, objv, "?pattern?");
return TCL_ERROR;
@@ -873,13 +873,13 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
return Tcl_GetChannelNamesEx(interp,
((objc == 2) ? NULL : Tcl_GetString(objv[2])));
}
- case FILE_COPY: {
+ case FCMD_COPY: {
return TclFileCopyCmd(interp, objc, objv);
}
- case FILE_DELETE: {
+ case FCMD_DELETE: {
return TclFileDeleteCmd(interp, objc, objv);
}
- case FILE_DIRNAME: {
+ case FCMD_DIRNAME: {
Tcl_Obj *dirPtr;
if (objc != 3) {
goto only3Args;
@@ -893,19 +893,19 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
return TCL_OK;
}
}
- case FILE_EXECUTABLE: {
+ case FCMD_EXECUTABLE: {
if (objc != 3) {
goto only3Args;
}
return CheckAccess(interp, objv[2], X_OK);
}
- case FILE_EXISTS: {
+ case FCMD_EXISTS: {
if (objc != 3) {
goto only3Args;
}
return CheckAccess(interp, objv[2], F_OK);
}
- case FILE_EXTENSION: {
+ case FCMD_EXTENSION: {
char *fileName, *extension;
if (objc != 3) {
goto only3Args;
@@ -917,7 +917,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
}
return TCL_OK;
}
- case FILE_ISDIRECTORY: {
+ case FCMD_ISDIRECTORY: {
int value;
Tcl_StatBuf buf;
@@ -931,7 +931,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
Tcl_SetBooleanObj(Tcl_GetObjResult(interp), value);
return TCL_OK;
}
- case FILE_ISFILE: {
+ case FCMD_ISFILE: {
int value;
Tcl_StatBuf buf;
@@ -945,7 +945,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
Tcl_SetBooleanObj(Tcl_GetObjResult(interp), value);
return TCL_OK;
}
- case FILE_JOIN: {
+ case FCMD_JOIN: {
Tcl_Obj *resObj;
if (objc < 3) {
@@ -956,7 +956,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
Tcl_SetObjResult(interp, resObj);
return TCL_OK;
}
- case FILE_LINK: {
+ case FCMD_LINK: {
Tcl_Obj *contents;
int index;
@@ -1046,7 +1046,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
}
return TCL_OK;
}
- case FILE_LSTAT: {
+ case FCMD_LSTAT: {
char *varName;
Tcl_StatBuf buf;
@@ -1060,7 +1060,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
varName = Tcl_GetString(objv[3]);
return StoreStatData(interp, varName, &buf);
}
- case FILE_MTIME: {
+ case FCMD_MTIME: {
Tcl_StatBuf buf;
struct utimbuf tval;
@@ -1099,14 +1099,14 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
Tcl_SetLongObj(Tcl_GetObjResult(interp), (long) buf.st_mtime);
return TCL_OK;
}
- case FILE_MKDIR: {
+ case FCMD_MKDIR: {
if (objc < 3) {
Tcl_WrongNumArgs(interp, 2, objv, "name ?name ...?");
return TCL_ERROR;
}
return TclFileMakeDirsCmd(interp, objc, objv);
}
- case FILE_NATIVENAME: {
+ case FCMD_NATIVENAME: {
CONST char *fileName;
Tcl_DString ds;
@@ -1123,7 +1123,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
Tcl_DStringFree(&ds);
return TCL_OK;
}
- case FILE_NORMALIZE: {
+ case FCMD_NORMALIZE: {
Tcl_Obj *fileName;
if (objc != 3) {
@@ -1135,7 +1135,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
Tcl_SetObjResult(interp, fileName);
return TCL_OK;
}
- case FILE_OWNED: {
+ case FCMD_OWNED: {
int value;
Tcl_StatBuf buf;
@@ -1158,7 +1158,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
Tcl_SetBooleanObj(Tcl_GetObjResult(interp), value);
return TCL_OK;
}
- case FILE_PATHTYPE: {
+ case FCMD_PATHTYPE: {
if (objc != 3) {
goto only3Args;
}
@@ -1176,13 +1176,13 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
}
return TCL_OK;
}
- case FILE_READABLE: {
+ case FCMD_READABLE: {
if (objc != 3) {
goto only3Args;
}
return CheckAccess(interp, objv[2], R_OK);
}
- case FILE_READLINK: {
+ case FCMD_READLINK: {
Tcl_Obj *contents;
if (objc != 3) {
@@ -1205,10 +1205,10 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
Tcl_DecrRefCount(contents);
return TCL_OK;
}
- case FILE_RENAME: {
+ case FCMD_RENAME: {
return TclFileRenameCmd(interp, objc, objv);
}
- case FILE_ROOTNAME: {
+ case FCMD_ROOTNAME: {
int length;
char *fileName, *extension;
@@ -1225,7 +1225,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
}
return TCL_OK;
}
- case FILE_SEPARATOR: {
+ case FCMD_SEPARATOR: {
if ((objc < 2) || (objc > 3)) {
Tcl_WrongNumArgs(interp, 2, objv, "?name?");
return TCL_ERROR;
@@ -1256,7 +1256,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
}
return TCL_OK;
}
- case FILE_SIZE: {
+ case FCMD_SIZE: {
Tcl_StatBuf buf;
if (objc != 3) {
@@ -1269,14 +1269,14 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
(Tcl_WideInt) buf.st_size);
return TCL_OK;
}
- case FILE_SPLIT: {
+ case FCMD_SPLIT: {
if (objc != 3) {
goto only3Args;
}
Tcl_SetObjResult(interp, Tcl_FSSplitPath(objv[2], NULL));
return TCL_OK;
}
- case FILE_STAT: {
+ case FCMD_STAT: {
char *varName;
Tcl_StatBuf buf;
@@ -1290,7 +1290,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
varName = Tcl_GetString(objv[3]);
return StoreStatData(interp, varName, &buf);
}
- case FILE_SYSTEM: {
+ case FCMD_SYSTEM: {
Tcl_Obj* fsInfo;
if (objc != 3) {
goto only3Args;
@@ -1305,7 +1305,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
return TCL_ERROR;
}
}
- case FILE_TAIL: {
+ case FCMD_TAIL: {
int splitElements;
Tcl_Obj *splitPtr;
@@ -1346,7 +1346,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
Tcl_DecrRefCount(splitPtr);
return TCL_OK;
}
- case FILE_TYPE: {
+ case FCMD_TYPE: {
Tcl_StatBuf buf;
if (objc != 3) {
@@ -1359,7 +1359,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
GetTypeFromMode((unsigned short) buf.st_mode), -1);
return TCL_OK;
}
- case FILE_VOLUMES: {
+ case FCMD_VOLUMES: {
if (objc != 2) {
Tcl_WrongNumArgs(interp, 2, objv, NULL);
return TCL_ERROR;
@@ -1367,7 +1367,7 @@ Tcl_FileObjCmd(dummy, interp, objc, objv)
Tcl_SetObjResult(interp, Tcl_FSListVolumes());
return TCL_OK;
}
- case FILE_WRITABLE: {
+ case FCMD_WRITABLE: {
if (objc != 3) {
goto only3Args;
}