From b0edcae8f88b7a7b96a1858290ece903d780bc62 Mon Sep 17 00:00:00 2001 From: stanton Date: Thu, 4 Mar 1999 01:00:47 +0000 Subject: * unix/tclUnixFile.c: * mac/tclMacShLib.exp: * mac/tclMacFile.c: * generic/tclFileName.c: * win/tclWinFile.c: Renamed TclpGetUserHome back to TclGetUserHome for patch level compatibility. * unix/tclUnixFile.c: Added TclpAccess and TclpState. --- generic/tclFileName.c | 4 ++-- mac/tclMacFile.c | 6 +++--- mac/tclMacShLib.exp | 2 +- unix/tclUnixFile.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++---- win/tclWinFile.c | 6 +++--- 5 files changed, 61 insertions(+), 13 deletions(-) diff --git a/generic/tclFileName.c b/generic/tclFileName.c index a1c6a2e..988102f 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.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: tclFileName.c,v 1.4.4.1 1999/03/03 00:38:40 stanton Exp $ + * RCS: @(#) $Id: tclFileName.c,v 1.4.4.2 1999/03/04 01:00:47 stanton Exp $ */ #include "tclInt.h" @@ -1084,7 +1084,7 @@ DoTildeSubst(interp, user, resultPtr) return NULL; } Tcl_JoinPath(1, &dir, resultPtr); - } else if (TclpGetUserHome(user, resultPtr) == NULL) { + } else if (TclGetUserHome(user, resultPtr) == NULL) { if (interp) { Tcl_ResetResult(interp); Tcl_AppendResult(interp, "user \"", user, "\" doesn't exist", diff --git a/mac/tclMacFile.c b/mac/tclMacFile.c index 2b3d883..f47862e 100644 --- a/mac/tclMacFile.c +++ b/mac/tclMacFile.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: tclMacFile.c,v 1.4.4.1 1999/03/03 00:38:44 stanton Exp $ + * RCS: @(#) $Id: tclMacFile.c,v 1.4.4.2 1999/03/04 01:00:48 stanton Exp $ */ /* @@ -249,7 +249,7 @@ Tcl_FindExecutable( /* *---------------------------------------------------------------------- * - * TclpGetUserHome -- + * TclGetUserHome -- * * This function takes the passed in user name and finds the * corresponding home directory specified in the password file. @@ -264,7 +264,7 @@ Tcl_FindExecutable( */ char * -TclpGetUserHome( +TclGetUserHome( char *name, /* User name to use to find home directory. */ Tcl_DString *bufferPtr) /* May be used to hold result. Must not hold * anything at the time of the call, and need diff --git a/mac/tclMacShLib.exp b/mac/tclMacShLib.exp index 35bcfaf..aea4acf 100644 --- a/mac/tclMacShLib.exp +++ b/mac/tclMacShLib.exp @@ -283,7 +283,7 @@ TclGetOpenMode TclGetOriginalCommand TclGetRegError TclGetSrcInfoForPc -TclpGetUserHome +TclGetUserHome TclGlobalInvoke TclGuessPackageName TclHasSockets diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index 4a25bf8..aef2571 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.4.4.1 1999/03/03 00:38:46 stanton Exp $ + * RCS: @(#) $Id: tclUnixFile.c,v 1.4.4.2 1999/03/04 01:00:48 stanton Exp $ */ #include "tclInt.h" @@ -37,7 +37,6 @@ extern pid_t waitpid _ANSI_ARGS_((pid_t pid, int *stat_loc, int options)); * Static routines for this file: */ -static void FreeCurrentDir _ANSI_ARGS_((ClientData clientData)); static void FreeExecutableName _ANSI_ARGS_((ClientData clientData)); /* @@ -344,7 +343,7 @@ Tcl_FindExecutable(argv0) /* *---------------------------------------------------------------------- * - * TclpGetUserHome -- + * TclGetUserHome -- * * This function takes the passed in user name and finds the * corresponding home directory specified in the password file. @@ -363,7 +362,7 @@ Tcl_FindExecutable(argv0) */ char * -TclpGetUserHome(name, bufferPtr) +TclGetUserHome(name, bufferPtr) char *name; /* User name to use to find home directory. */ Tcl_DString *bufferPtr; /* May be used to hold result. Must not hold * anything at the time of the call, and need @@ -535,3 +534,52 @@ TclMatchFiles(interp, separators, dirPtr, pattern, tail) closedir(d); return result; } + +/* + *--------------------------------------------------------------------------- + * + * TclpAccess -- + * + * This function replaces the library version of access(). + * + * Results: + * See access() documentation. + * + * Side effects: + * See access() documentation. + * + *--------------------------------------------------------------------------- + */ + +int +TclpAccess(path, mode) + CONST char *path; /* Path of file to access. */ + int mode; /* Permission setting. */ +{ + return access(native, mode); +} + +/* + *---------------------------------------------------------------------- + * + * TclpStat -- + * + * This function replaces the library version of stat(). + * + * Results: + * See stat() documentation. + * + * Side effects: + * See stat() documentation. + * + *---------------------------------------------------------------------- + */ + +int +TclpStat(path, bufPtr) + CONST char *path; /* Path of file to stat. */ + struct stat *bufPtr; /* Filled with results of stat call. */ +{ + return stat(path, bufPtr); +} + diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 073bc92..0309a8c 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.3.4.1 1999/03/03 00:38:47 stanton Exp $ + * RCS: @(#) $Id: tclWinFile.c,v 1.3.4.2 1999/03/04 01:00:49 stanton Exp $ */ #include "tclWinInt.h" @@ -648,7 +648,7 @@ TclpAccess( /* *---------------------------------------------------------------------- * - * TclpGetUserHome -- + * TclGetUserHome -- * * This function takes the passed in user name and finds the * corresponding home directory specified in the password file. @@ -663,7 +663,7 @@ TclpAccess( */ char * -TclpGetUserHome( +TclGetUserHome( char *name, /* User name to use to find home directory. */ Tcl_DString *bufferPtr) /* May be used to hold result. Must not hold * anything at the time of the call, and need -- cgit v0.12