tclFileSystem.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * tclFileSystem.h --
  3. *
  4. * This file contains the common defintions and prototypes for use by
  5. * Tcl's filesystem and path handling layers.
  6. *
  7. * Copyright (c) 2003 Vince Darley.
  8. *
  9. * See the file "license.terms" for information on usage and redistribution of
  10. * this file, and for a DISCLAIMER OF ALL WARRANTIES.
  11. */
  12. #ifndef _TCLFILESYSTEM
  13. #define _TCLFILESYSTEM
  14. #include "tcl.h"
  15. /*
  16. * The internal TclFS API provides routines for handling and manipulating
  17. * paths efficiently, taking direct advantage of the "path" Tcl_Obj type.
  18. *
  19. * These functions are not exported at all at present.
  20. */
  21. MODULE_SCOPE int TclFSCwdPointerEquals(Tcl_Obj **pathPtrPtr);
  22. MODULE_SCOPE int TclFSNormalizeToUniquePath(Tcl_Interp *interp,
  23. Tcl_Obj *pathPtr, int startAt);
  24. MODULE_SCOPE Tcl_Obj * TclFSMakePathRelative(Tcl_Interp *interp,
  25. Tcl_Obj *pathPtr, Tcl_Obj *cwdPtr);
  26. MODULE_SCOPE int TclFSEnsureEpochOk(Tcl_Obj *pathPtr,
  27. const Tcl_Filesystem **fsPtrPtr);
  28. MODULE_SCOPE void TclFSSetPathDetails(Tcl_Obj *pathPtr,
  29. const Tcl_Filesystem *fsPtr, ClientData clientData);
  30. MODULE_SCOPE Tcl_Obj * TclFSNormalizeAbsolutePath(Tcl_Interp *interp,
  31. Tcl_Obj *pathPtr);
  32. MODULE_SCOPE size_t TclFSEpoch(void);
  33. /*
  34. * Private shared variables for use by tclIOUtil.c and tclPathObj.c
  35. */
  36. MODULE_SCOPE const Tcl_Filesystem tclNativeFilesystem;
  37. /*
  38. * Private shared functions for use by tclIOUtil.c, tclPathObj.c and
  39. * tclFileName.c, and any platform-specific filesystem code.
  40. */
  41. MODULE_SCOPE Tcl_PathType TclFSGetPathType(Tcl_Obj *pathPtr,
  42. const Tcl_Filesystem **filesystemPtrPtr,
  43. int *driveNameLengthPtr);
  44. MODULE_SCOPE Tcl_PathType TclFSNonnativePathType(const char *pathPtr,
  45. int pathLen, const Tcl_Filesystem **filesystemPtrPtr,
  46. int *driveNameLengthPtr, Tcl_Obj **driveNameRef);
  47. MODULE_SCOPE Tcl_PathType TclGetPathType(Tcl_Obj *pathPtr,
  48. const Tcl_Filesystem **filesystemPtrPtr,
  49. int *driveNameLengthPtr, Tcl_Obj **driveNameRef);
  50. MODULE_SCOPE int TclFSEpochOk(size_t filesystemEpoch);
  51. MODULE_SCOPE int TclFSCwdIsNative(void);
  52. MODULE_SCOPE Tcl_Obj * TclWinVolumeRelativeNormalize(Tcl_Interp *interp,
  53. const char *path, Tcl_Obj **useThisCwdPtr);
  54. MODULE_SCOPE Tcl_FSPathInFilesystemProc TclNativePathInFilesystem;
  55. MODULE_SCOPE Tcl_FSCreateInternalRepProc TclNativeCreateNativeRep;
  56. #endif /* _TCLFILESYSTEM */
  57. /*
  58. * Local Variables:
  59. * mode: c
  60. * c-basic-offset: 4
  61. * fill-column: 78
  62. * End:
  63. */