Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -7,13 +7,17 @@ TCLSH := tclsh LIB_SUFFIX := $(shell . "${TCL_CONFIG_SH}"; echo "$${TCL_SHLIB_SUFFIX:-.so}") all: example-standalone$(LIB_SUFFIX) example-client$(LIB_SUFFIX) example-flexible$(LIB_SUFFIX) xvfs$(LIB_SUFFIX) -example.c: $(shell find example -type f) $(shell find lib -type f) lib/xvfs/xvfs.c.rvt xvfs-create Makefile - ./xvfs-create --directory example --name example > example.c.new - mv example.c.new example.c +example.c: $(shell find example -type f) $(shell find lib -type f) lib/xvfs/xvfs.c.rvt xvfs-create-c xvfs-create Makefile + rm -f example.c.new.1 example.c.new.2 + ./xvfs-create-c --directory example --name example > example.c.new.1 + ./xvfs-create --directory example --name example > example.c.new.2 + diff -u example.c.new.1 example.c.new.2 + rm -f example.c.new.2 + mv example.c.new.1 example.c example-standalone.o: example.c xvfs-core.h xvfs-core.c Makefile $(CC) $(CPPFLAGS) -DXVFS_MODE_STANDALONE $(CFLAGS) -o example-standalone.o -c example.c example-standalone$(LIB_SUFFIX): example-standalone.o Makefile @@ -43,10 +47,16 @@ rm -f xvfs-create-standalone.new xvfs-create-standalone ./xvfs-create --dump-tcl --remove-debug > xvfs-create-standalone.new chmod +x xvfs-create-standalone.new mv xvfs-create-standalone.new xvfs-create-standalone +xvfs-create-c: xvfs-create-c.o + $(CC) $(CFLAGS) $(LDFLAGS) -o xvfs-create-c xvfs-create-c.o $(LIBS) + +xvfs-create-c.o: xvfs-create-c.c + $(CC) $(CPPFLAGS) $(CFLAGS) -o xvfs-create-c.o -c xvfs-create-c.c + xvfs_random$(LIB_SUFFIX): $(shell find example -type f) $(shell find lib -type f) lib/xvfs/xvfs.c.rvt xvfs-create-random Makefile ./xvfs-create-random | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -DXVFS_MODE_FLEXIBLE -x c - -shared -o xvfs_random$(LIB_SUFFIX) $(LIBS) xvfs_synthetic$(LIB_SUFFIX): $(shell find lib -type f) lib/xvfs/xvfs.c.rvt xvfs-create-synthetic Makefile ./xvfs-create-synthetic | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -DXVFS_MODE_FLEXIBLE -x c - -shared -o xvfs_synthetic$(LIB_SUFFIX) $(LIBS) @@ -97,11 +107,12 @@ valgrind --tool=callgrind --callgrind-out-file=callgrind.out ./profile-bare 10 2 callgrind_annotate callgrind.out clean: rm -f xvfs-create-standalone.new xvfs-create-standalone - rm -f example.c example.c.new + rm -f xvfs-create-c.o xvfs-create-c + rm -f example.c example.c.new example.c.new.1 example.c.new.2 rm -f example-standalone$(LIB_SUFFIX) example-standalone.o rm -f example-client.o example-client$(LIB_SUFFIX) rm -f example-flexible.o example-flexible$(LIB_SUFFIX) rm -f xvfs.o xvfs$(LIB_SUFFIX) rm -f example-standalone.gcda example-standalone.gcno Index: lib/xvfs/xvfs.c.rvt ================================================================== --- lib/xvfs/xvfs.c.rvt +++ lib/xvfs/xvfs.c.rvt @@ -1,8 +1,15 @@ #include #include #include #include @@ -53,13 +60,12 @@ #endif + set ::xvfs::fileInfoStruct [xvfs::main $::xvfs::argv] +?> static long xvfs__nameToIndex(const char *path) {