diff options
author | dkf <dkf@noemail.net> | 2008-09-24 09:41:08 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2008-09-24 09:41:08 (GMT) |
commit | 29c12ae0d08e29695991284a60af4c23124c55c9 (patch) | |
tree | 12490c1ca7097e4a1a4f6616fe350aa1cbf6b8e2 /generic/tclFileName.c | |
parent | 0e53271a657ea3296c16337236cf930827546f18 (diff) | |
download | tcl-29c12ae0d08e29695991284a60af4c23124c55c9.zip tcl-29c12ae0d08e29695991284a60af4c23124c55c9.tar.gz tcl-29c12ae0d08e29695991284a60af4c23124c55c9.tar.bz2 |
Implement TIP #316.
FossilOrigin-Name: 05e3bb92fddd1036e881f212607acb1f284ddc1c
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r-- | generic/tclFileName.c | 111 |
1 files changed, 110 insertions, 1 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 999a685..00c7067 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.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: tclFileName.c,v 1.90 2008/08/13 18:14:44 dgp Exp $ + * RCS: @(#) $Id: tclFileName.c,v 1.91 2008/09/24 09:41:20 dkf Exp $ */ #include "tclInt.h" @@ -2527,6 +2527,115 @@ Tcl_AllocStatBuf(void) } /* + *--------------------------------------------------------------------------- + * + * Access functions for Tcl_StatBuf -- + * + * These functions provide portable read-only access to the portable + * fields of the Tcl_StatBuf structure (really a 'struct stat', 'struct + * stat64' or something else related). [TIP #316] + * + * Results: + * The value from the field being retrieved. + * + * Side effects: + * None. + * + *--------------------------------------------------------------------------- + */ + +unsigned +Tcl_GetFSDeviceFromStat( + const Tcl_StatBuf *statPtr) +{ + return (unsigned) statPtr->st_dev; +} + +unsigned +Tcl_GetFSInodeFromStat( + const Tcl_StatBuf *statPtr) +{ + return (unsigned) statPtr->st_ino; +} + +unsigned +Tcl_GetModeFromStat( + const Tcl_StatBuf *statPtr) +{ + return (unsigned) statPtr->st_mode; +} + +int +Tcl_GetLinkCountFromStat( + const Tcl_StatBuf *statPtr) +{ + return (int)statPtr->st_nlink; +} + +int +Tcl_GetUserIdFromStat( + const Tcl_StatBuf *statPtr) +{ + return (int) statPtr->st_uid; +} + +int +Tcl_GetGroupIdFromStat( + const Tcl_StatBuf *statPtr) +{ + return (int) statPtr->st_gid; +} + +int +Tcl_GetDeviceTypeFromStat( + const Tcl_StatBuf *statPtr) +{ + return (int) statPtr->st_rdev; +} + +Tcl_WideInt +Tcl_GetAccessTimeFromStat( + const Tcl_StatBuf *statPtr) +{ + return (Tcl_WideInt) statPtr->st_atime; +} + +Tcl_WideInt +Tcl_GetModificationTimeFromStat( + const Tcl_StatBuf *statPtr) +{ + return (Tcl_WideInt) statPtr->st_mtime; +} + +Tcl_WideInt +Tcl_GetChangeTimeFromStat( + const Tcl_StatBuf *statPtr) +{ + return (Tcl_WideInt) statPtr->st_ctime; +} + +Tcl_WideUInt +Tcl_GetSizeFromStat( + const Tcl_StatBuf *statPtr) +{ + return (Tcl_WideUInt) statPtr->st_size; +} + +Tcl_WideUInt +Tcl_GetBlocksFromStat( + const Tcl_StatBuf *statPtr) +{ + return (Tcl_WideUInt) statPtr->st_blocks; +} + +unsigned +Tcl_GetBlockSizeFromStat( + const Tcl_StatBuf *statPtr) +{ + return (unsigned) statPtr->st_blksize; +} + +/* * Local Variables: * mode: c * c-basic-offset: 4 |