summaryrefslogtreecommitdiffstats
path: root/generic/tclFileSystem.h
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2003-04-11 15:59:49 (GMT)
committervincentdarley <vincentdarley>2003-04-11 15:59:49 (GMT)
commita5499a51a90ae1c06f3f39ee05c4b42185e0f28c (patch)
tree324d5cddf5f2dfe379c3cf1427347351d8d683a5 /generic/tclFileSystem.h
parent3c51da6d9db3a5e20f2e38f667ef5c0791b2e88d (diff)
downloadtcl-a5499a51a90ae1c06f3f39ee05c4b42185e0f28c.zip
tcl-a5499a51a90ae1c06f3f39ee05c4b42185e0f28c.tar.gz
tcl-a5499a51a90ae1c06f3f39ee05c4b42185e0f28c.tar.bz2
fix 5 small filesystem bugs, and some typos
Diffstat (limited to 'generic/tclFileSystem.h')
-rw-r--r--generic/tclFileSystem.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/generic/tclFileSystem.h b/generic/tclFileSystem.h
new file mode 100644
index 0000000..30a6399
--- /dev/null
+++ b/generic/tclFileSystem.h
@@ -0,0 +1,75 @@
+/*
+ * tclFileSystem.h --
+ *
+ * This file contains the common defintions and prototypes for
+ * use by Tcl's filesystem and path handling layers.
+ *
+ * Copyright (c) 2003 Vince Darley.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id: tclFileSystem.h,v 1.1 2003/04/11 15:59:54 vincentdarley Exp $
+ */
+
+/*
+ * struct FilesystemRecord --
+ *
+ * A filesystem record is used to keep track of each
+ * filesystem currently registered with the core,
+ * in a linked list. Pointers to these structures
+ * are also kept by each "path" Tcl_Obj, and we must
+ * retain a refCount on the number of such references.
+ */
+typedef struct FilesystemRecord {
+ ClientData clientData; /* Client specific data for the new
+ * filesystem (can be NULL) */
+ Tcl_Filesystem *fsPtr; /* Pointer to filesystem dispatch
+ * table. */
+ int fileRefCount; /* How many Tcl_Obj's use this
+ * filesystem. */
+ struct FilesystemRecord *nextPtr;
+ /* The next filesystem registered
+ * to Tcl, or NULL if no more. */
+} FilesystemRecord;
+
+/*
+ * The internal TclFS API provides routines for handling and
+ * manipulating paths efficiently, taking direct advantage of
+ * the "path" Tcl_Obj type.
+ *
+ * These functions are not exported at all at present.
+ */
+
+int TclFSCwdPointerEquals _ANSI_ARGS_((Tcl_Obj* objPtr));
+int TclFSMakePathFromNormalized _ANSI_ARGS_((Tcl_Interp *interp,
+ Tcl_Obj *objPtr, ClientData clientData));
+int TclFSNormalizeToUniquePath _ANSI_ARGS_((Tcl_Interp *interp,
+ Tcl_Obj *pathPtr, int startAt, ClientData *clientDataPtr));
+Tcl_Obj* TclFSMakePathRelative _ANSI_ARGS_((Tcl_Interp *interp,
+ Tcl_Obj *objPtr, Tcl_Obj *cwdPtr));
+Tcl_Obj* TclFSInternalToNormalized _ANSI_ARGS_((
+ Tcl_Filesystem *fromFilesystem, ClientData clientData,
+ FilesystemRecord **fsRecPtrPtr, int *epochPtr));
+int TclFSEnsureEpochOk _ANSI_ARGS_((Tcl_Obj* pathObjPtr, int theEpoch,
+ Tcl_Filesystem **fsPtrPtr));
+void TclFSSetPathDetails _ANSI_ARGS_((Tcl_Obj *pathObjPtr,
+ FilesystemRecord *fsRecPtr, ClientData clientData,
+ int theEpoch));
+
+/*
+ * Private shared variables for use by tclIOUtil.c and tclPathObj.c
+ */
+extern Tcl_Filesystem tclNativeFilesystem;
+extern int theFilesystemEpoch;
+
+/*
+ * Private shared functions for use by tclIOUtil.c and tclPathObj.c
+ */
+Tcl_PathType FSGetPathType _ANSI_ARGS_((Tcl_Obj *pathObjPtr,
+ Tcl_Filesystem **filesystemPtrPtr,
+ int *driveNameLengthPtr));
+Tcl_PathType GetPathType _ANSI_ARGS_((Tcl_Obj *pathObjPtr,
+ Tcl_Filesystem **filesystemPtrPtr,
+ int *driveNameLengthPtr, Tcl_Obj **driveNameRef));
+Tcl_FSPathInFilesystemProc NativePathInFilesystem;