diff options
author | das <das> | 2003-05-14 19:21:20 (GMT) |
---|---|---|
committer | das <das> | 2003-05-14 19:21:20 (GMT) |
commit | e7e62365449aec7d4e02ab0a58d7b185a74342e8 (patch) | |
tree | 18a23b38b5ab18b3714c78cd1f0f131855938b1f /generic/tclIntPlatDecls.h | |
parent | 12f7a06929318bdfae5af285f1502aa2f5d4aa86 (diff) | |
download | tcl-e7e62365449aec7d4e02ab0a58d7b185a74342e8.zip tcl-e7e62365449aec7d4e02ab0a58d7b185a74342e8.tar.gz tcl-e7e62365449aec7d4e02ab0a58d7b185a74342e8.tar.bz2 |
Implementation of TIP 118:
* generic/tclFCmd.c (TclFileAttrsCmd): return the list of attributes
that can be retrieved without error for a given file, instead of
aborting the whole command when any error occurs.
* unix/tclUnixFCmd.c: added support for new file attributes and for
copying Mac OS X file attributes & resource fork during [file copy].
* generic/tclInt.decls: added declarations of new external commands
needed by new file attributes support in tclUnixFCmd.c.
* macosx/tclMacOSXFCmd.c (new): Mac OS X specific implementation of
new file attributes and of attribute & resource fork copying.
* mac/tclMacFCmd.c: added implementation of -rsrclength attribute &
fixes to other attributes for consistency with OSX implementation.
* mac/tclMacResource.c: fixes to OSType handling.
* doc/file.n: documentation of [file attributes] changes.
* unix/configure.in: check for APIs needed by new file attributes.
* unix/Makefile.in:
* unix/tcl.m4: added new platform specifc tclMacOSXFCmd.c source.
* unix/configure:
* generic/tclStubInit.c:
* generic/tclIntPlatDecls.h: regen.
* tools/genStubs.tcl: fixes to completely broken code trying to
prevent overlap of "aqua", "macosx", "x11" and "unix" stub entries.
* tests/unixFCmd.test: added tests of -readonly attribute.
* tests/macOSXFCmd.test (new): tests of macosx file attributes and
of preservation of attributes & resource fork during [file copy].
* tests/macFCmd.test: restore -readonly attribute of test dir, as
otherwise its removal can fail on unices supporting -readonly.
Diffstat (limited to 'generic/tclIntPlatDecls.h')
-rw-r--r-- | generic/tclIntPlatDecls.h | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h index 09c1226..b9a9dc5 100644 --- a/generic/tclIntPlatDecls.h +++ b/generic/tclIntPlatDecls.h @@ -9,7 +9,7 @@ * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. * - * RCS: @(#) $Id: tclIntPlatDecls.h,v 1.19 2002/12/06 23:22:59 hobbs Exp $ + * RCS: @(#) $Id: tclIntPlatDecls.h,v 1.20 2003/05/14 19:21:22 das Exp $ */ #ifndef _TCLINTPLATDECLS @@ -67,6 +67,11 @@ EXTERN struct tm * TclpLocaltime _ANSI_ARGS_((time_t * clock)); EXTERN struct tm * TclpGmtime _ANSI_ARGS_((time_t * clock)); /* 13 */ EXTERN char * TclpInetNtoa _ANSI_ARGS_((struct in_addr addr)); +/* 14 */ +EXTERN int TclUnixCopyFile _ANSI_ARGS_((CONST char * src, + CONST char * dst, + CONST Tcl_StatBuf * statBufPtr, + int dontCopyAtts)); #endif /* UNIX */ #ifdef __WIN32__ /* 0 */ @@ -212,6 +217,21 @@ EXTERN int TclMacChmod _ANSI_ARGS_((CONST char * path, int mode)); EXTERN int FSpLLocationFromPath _ANSI_ARGS_((int length, CONST char * path, FSSpecPtr theSpec)); #endif /* MAC_TCL */ +#ifdef MAC_OSX_TCL +/* 15 */ +EXTERN int TclMacOSXGetFileAttribute _ANSI_ARGS_(( + Tcl_Interp * interp, int objIndex, + Tcl_Obj * fileName, + Tcl_Obj ** attributePtrPtr)); +/* 16 */ +EXTERN int TclMacOSXSetFileAttribute _ANSI_ARGS_(( + Tcl_Interp * interp, int objIndex, + Tcl_Obj * fileName, Tcl_Obj * attributePtr)); +/* 17 */ +EXTERN int TclMacOSXCopyFileAttributes _ANSI_ARGS_(( + CONST char * src, CONST char * dst, + CONST Tcl_StatBuf * statBufPtr)); +#endif /* MAC_OSX_TCL */ typedef struct TclIntPlatStubs { int magic; @@ -232,6 +252,7 @@ typedef struct TclIntPlatStubs { struct tm * (*tclpLocaltime) _ANSI_ARGS_((time_t * clock)); /* 11 */ struct tm * (*tclpGmtime) _ANSI_ARGS_((time_t * clock)); /* 12 */ char * (*tclpInetNtoa) _ANSI_ARGS_((struct in_addr addr)); /* 13 */ + int (*tclUnixCopyFile) _ANSI_ARGS_((CONST char * src, CONST char * dst, CONST Tcl_StatBuf * statBufPtr, int dontCopyAtts)); /* 14 */ #endif /* UNIX */ #ifdef __WIN32__ void (*tclWinConvertError) _ANSI_ARGS_((DWORD errCode)); /* 0 */ @@ -293,6 +314,11 @@ typedef struct TclIntPlatStubs { int (*tclMacChmod) _ANSI_ARGS_((CONST char * path, int mode)); /* 25 */ int (*fSpLLocationFromPath) _ANSI_ARGS_((int length, CONST char * path, FSSpecPtr theSpec)); /* 26 */ #endif /* MAC_TCL */ +#ifdef MAC_OSX_TCL + int (*tclMacOSXGetFileAttribute) _ANSI_ARGS_((Tcl_Interp * interp, int objIndex, Tcl_Obj * fileName, Tcl_Obj ** attributePtrPtr)); /* 15 */ + int (*tclMacOSXSetFileAttribute) _ANSI_ARGS_((Tcl_Interp * interp, int objIndex, Tcl_Obj * fileName, Tcl_Obj * attributePtr)); /* 16 */ + int (*tclMacOSXCopyFileAttributes) _ANSI_ARGS_((CONST char * src, CONST char * dst, CONST Tcl_StatBuf * statBufPtr)); /* 17 */ +#endif /* MAC_OSX_TCL */ } TclIntPlatStubs; #ifdef __cplusplus @@ -363,6 +389,10 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr; #define TclpInetNtoa \ (tclIntPlatStubsPtr->tclpInetNtoa) /* 13 */ #endif +#ifndef TclUnixCopyFile +#define TclUnixCopyFile \ + (tclIntPlatStubsPtr->tclUnixCopyFile) /* 14 */ +#endif #endif /* UNIX */ #ifdef __WIN32__ #ifndef TclWinConvertError @@ -577,6 +607,20 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr; (tclIntPlatStubsPtr->fSpLLocationFromPath) /* 26 */ #endif #endif /* MAC_TCL */ +#ifdef MAC_OSX_TCL +#ifndef TclMacOSXGetFileAttribute +#define TclMacOSXGetFileAttribute \ + (tclIntPlatStubsPtr->tclMacOSXGetFileAttribute) /* 15 */ +#endif +#ifndef TclMacOSXSetFileAttribute +#define TclMacOSXSetFileAttribute \ + (tclIntPlatStubsPtr->tclMacOSXSetFileAttribute) /* 16 */ +#endif +#ifndef TclMacOSXCopyFileAttributes +#define TclMacOSXCopyFileAttributes \ + (tclIntPlatStubsPtr->tclMacOSXCopyFileAttributes) /* 17 */ +#endif +#endif /* MAC_OSX_TCL */ #endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */ |