Diff

Differences From Artifact [b50c976369]:

To Artifact [1493b408fe]:


984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
#endif /* XVFS_MODE_FLEXIBLE */

#if defined(XVFS_MODE_SERVER)
static Tcl_Filesystem xvfs_tclfs_dispatch_fs;
static Tcl_HashTable xvfs_tclfs_dispatch_map;
static struct xvfs_tclfs_server_info xvfs_tclfs_dispatch_fsdata;

static int xvfs_tclfs_dispatch_pathInFilesystem(Tcl_Obj *path, ClientData *dataPtr) {
	const char *pathStr, *rootStr;
	int pathLen, rootLen;

	XVFS_DEBUG_ENTER;

	XVFS_DEBUG_PRINTF("Verifying that \"%s\" belongs in XVFS ...", Tcl_GetString(path));
	







|







984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
#endif /* XVFS_MODE_FLEXIBLE */

#if defined(XVFS_MODE_SERVER)
static Tcl_Filesystem xvfs_tclfs_dispatch_fs;
static Tcl_HashTable xvfs_tclfs_dispatch_map;
static struct xvfs_tclfs_server_info xvfs_tclfs_dispatch_fsdata;

static int xvfs_tclfs_dispatch_pathInFS(Tcl_Obj *path, ClientData *dataPtr) {
	const char *pathStr, *rootStr;
	int pathLen, rootLen;

	XVFS_DEBUG_ENTER;

	XVFS_DEBUG_PRINTF("Verifying that \"%s\" belongs in XVFS ...", Tcl_GetString(path));
	
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
	Tcl_HashEntry *mapEntry;
	struct xvfs_tclfs_instance_info *retval;
	int rootLen;
	char *pathStr, *fsName, *fsNameEnds, origSep;

	XVFS_DEBUG_ENTER;

	if (xvfs_tclfs_dispatch_pathInFilesystem(path, NULL) != TCL_OK) {
		XVFS_DEBUG_LEAVE;

		return(NULL);
	}

	rootLen = strlen(XVFS_ROOT_MOUNTPOINT);
	pathStr = Tcl_GetString(path);







|







1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
	Tcl_HashEntry *mapEntry;
	struct xvfs_tclfs_instance_info *retval;
	int rootLen;
	char *pathStr, *fsName, *fsNameEnds, origSep;

	XVFS_DEBUG_ENTER;

	if (xvfs_tclfs_dispatch_pathInFS(path, NULL) != TCL_OK) {
		XVFS_DEBUG_LEAVE;

		return(NULL);
	}

	rootLen = strlen(XVFS_ROOT_MOUNTPOINT);
	pathStr = Tcl_GetString(path);
1110
1111
1112
1113
1114
1115
1116









1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134

	return(xvfs_tclfs_matchInDir(interp, resultPtr, pathPtr, pattern, types, instanceInfo));
}

int Xvfs_Init(Tcl_Interp *interp) {
	static int registered = 0;
	int tclRet;










	/* XXX:TODO: Make this thread-safe */
	if (registered) {
		return(TCL_OK);
	}
	registered = 1;

	xvfs_tclfs_dispatch_fs.typeName                   = "xvfsDispatch";
	xvfs_tclfs_dispatch_fs.structureLength            = sizeof(xvfs_tclfs_dispatch_fs);
	xvfs_tclfs_dispatch_fs.version                    = TCL_FILESYSTEM_VERSION_1;
	xvfs_tclfs_dispatch_fs.pathInFilesystemProc       = xvfs_tclfs_dispatch_pathInFilesystem;
	xvfs_tclfs_dispatch_fs.dupInternalRepProc         = NULL;
	xvfs_tclfs_dispatch_fs.freeInternalRepProc        = NULL;
	xvfs_tclfs_dispatch_fs.internalToNormalizedProc   = NULL;
	xvfs_tclfs_dispatch_fs.createInternalRepProc      = NULL;
	xvfs_tclfs_dispatch_fs.normalizePathProc          = NULL;
	xvfs_tclfs_dispatch_fs.filesystemPathTypeProc     = NULL;
	xvfs_tclfs_dispatch_fs.filesystemSeparatorProc    = NULL;







>
>
>
>
>
>
>
>
>










|







1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143

	return(xvfs_tclfs_matchInDir(interp, resultPtr, pathPtr, pattern, types, instanceInfo));
}

int Xvfs_Init(Tcl_Interp *interp) {
	static int registered = 0;
	int tclRet;

#ifdef USE_TCL_STUBS
	const char *tclInitStubs_ret;
	/* Initialize Stubs */
	tclInitStubs_ret = Tcl_InitStubs(interp, TCL_PATCH_LEVEL, 0);
	if (!tclInitStubs_ret) {
		return(TCL_ERROR);
	}
#endif

	/* XXX:TODO: Make this thread-safe */
	if (registered) {
		return(TCL_OK);
	}
	registered = 1;

	xvfs_tclfs_dispatch_fs.typeName                   = "xvfsDispatch";
	xvfs_tclfs_dispatch_fs.structureLength            = sizeof(xvfs_tclfs_dispatch_fs);
	xvfs_tclfs_dispatch_fs.version                    = TCL_FILESYSTEM_VERSION_1;
	xvfs_tclfs_dispatch_fs.pathInFilesystemProc       = xvfs_tclfs_dispatch_pathInFS;
	xvfs_tclfs_dispatch_fs.dupInternalRepProc         = NULL;
	xvfs_tclfs_dispatch_fs.freeInternalRepProc        = NULL;
	xvfs_tclfs_dispatch_fs.internalToNormalizedProc   = NULL;
	xvfs_tclfs_dispatch_fs.createInternalRepProc      = NULL;
	xvfs_tclfs_dispatch_fs.normalizePathProc          = NULL;
	xvfs_tclfs_dispatch_fs.filesystemPathTypeProc     = NULL;
	xvfs_tclfs_dispatch_fs.filesystemSeparatorProc    = NULL;