Check-in [88f96696b7]
Overview
Comment:Added start of flexible mode
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 88f96696b79a47a25b5dfbe780b185c0bdb8afa819944a021c6b0c5ca346d8db
User & Date: rkeene on 2019-05-03 13:30:11
Other Links: manifest | tags
Context
2019-05-03
22:18
Use adler32 to hash values check-in: fb9dd5d783 user: rkeene tags: trunk
13:30
Added start of flexible mode check-in: 88f96696b7 user: rkeene tags: trunk
2019-05-02
23:37
More work on splitting up modes check-in: 3e44e1def1 user: rkeene tags: trunk
Changes

Modified Makefile from [0d56f35fbc] to [083522c323].

1
2
3
4
5
6
7
8
9
10
11
CPPFLAGS := -I. -DUSE_TCL_STUBS=1 -DXVFS_MODE_STANDALONE
CFLAGS   := -fPIC -g3 -ggdb3 -Wall
LDFLAGS  :=
LIBS     := -ltclstub8.6

all: example.so

example.c: $(shell find example -type f) $(shell find lib -type f) xvfs.c.rvt xvfs-create Makefile
	./xvfs-create --directory example --name example > example.c.new
	mv example.c.new example.c

|


|







1
2
3
4
5
6
7
8
9
10
11
CPPFLAGS := -I. -DUSE_TCL_STUBS=1 -DXVFS_MODE_FLEXIBLE
CFLAGS   := -fPIC -g3 -ggdb3 -Wall
LDFLAGS  :=
LIBS     := -ltclstub8.6 -ldl

all: example.so

example.c: $(shell find example -type f) $(shell find lib -type f) xvfs.c.rvt xvfs-create Makefile
	./xvfs-create --directory example --name example > example.c.new
	mv example.c.new example.c

Modified xvfs-core.c from [6b6c879bfa] to [7a51ec83d4].

75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
	pathStr = xvfs_relativePath(path, instanceInfo);
fprintf(stderr, "Called open(%s)!\n", pathStr);
	
	return(NULL);
}
#endif /* XVFS_MODE_SERVER || XVFS_MODE_STANDALONE || XVFS_MODE_FLEIXBLE */

#if defined(XVFS_MODE_STANDALONE)
/*
 * Tcl_Filesystem handlers for the standalone implementation
 */
static struct xvfs_tclfs_instance_info xvfs_tclfs_standalone_info;
static int xvfs_tclfs_standalone_pathInFilesystem(Tcl_Obj *path, ClientData *dataPtr) {
	return(xvfs_tclfs_pathInFilesystem(path, dataPtr, &xvfs_tclfs_standalone_info));
}







|







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
	pathStr = xvfs_relativePath(path, instanceInfo);
fprintf(stderr, "Called open(%s)!\n", pathStr);
	
	return(NULL);
}
#endif /* XVFS_MODE_SERVER || XVFS_MODE_STANDALONE || XVFS_MODE_FLEIXBLE */

#if defined(XVFS_MODE_STANDALONE) || defined(XVFS_MODE_FLEXIBLE)
/*
 * Tcl_Filesystem handlers for the standalone implementation
 */
static struct xvfs_tclfs_instance_info xvfs_tclfs_standalone_info;
static int xvfs_tclfs_standalone_pathInFilesystem(Tcl_Obj *path, ClientData *dataPtr) {
	return(xvfs_tclfs_pathInFilesystem(path, dataPtr, &xvfs_tclfs_standalone_info));
}
189
190
191
192
193
194
195

















196
197
198
199
200
201
		
		return(tcl_ret);
	}
	
	return(TCL_OK);
}
#endif


















#if defined(XVFS_MODE_SERVER)
int Xvfs_Register(Tcl_Interp *interp, struct Xvfs_FSInfo *fsInfo) {
	return(TCL_ERROR);
}
#endif







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
		
		return(tcl_ret);
	}
	
	return(TCL_OK);
}
#endif

#if defined(XVFS_MODE_FLEXIBLE)
#include <dlfcn.h>
int xvfs_flexible_register(Tcl_Interp *interp, struct Xvfs_FSInfo *fsInfo) {
	int (*xvfs_register)(Tcl_Interp *interp, struct Xvfs_FSInfo *fsInfo) = NULL;

	/*
	 * XXX:TODO: Find some way to use Tcl_FindSymbol() to do this
	 */
	xvfs_register = dlsym(NULL, "Xvfs_Register");
	if (!xvfs_register) {
		xvfs_register = &xvfs_standalone_register;
	}
	
	return(xvfs_register(interp, fsInfo));
}
#endif

#if defined(XVFS_MODE_SERVER)
int Xvfs_Register(Tcl_Interp *interp, struct Xvfs_FSInfo *fsInfo) {
	return(TCL_ERROR);
}
#endif