Check-in [0e19d8e3c2]
Overview
Comment:Renamed fuse daemon as "appfsd"
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:0e19d8e3c2d71b90fa88c60484319050837d036e
User & Date: rkeene on 2014-09-10 07:22:18
Other Links: manifest | tags
Context
2014-09-10
07:24
Finished renames check-in: 6958ab0b94 user: rkeene tags: trunk
07:22
Renamed fuse daemon as "appfsd" check-in: 0e19d8e3c2 user: rkeene tags: trunk
04:02
Reorganized check-in: 1f01cf90b5 user: rkeene tags: trunk
Changes

Modified Makefile from [51fd163395] to [66bca1d85f].

    13     13   export TCLKIT_SDK_DIR
    14     14   else
    15     15   TCLCONFIG_SH_PATH = $(shell echo 'puts [::tcl::pkgconfig get libdir,install]' | tclsh)/tclConfig.sh
    16     16   endif
    17     17   TCL_CFLAGS = $(shell . $(TCLCONFIG_SH_PATH); echo "$${TCL_INCLUDE_SPEC}")
    18     18   TCL_LIBS = $(shell . $(TCLCONFIG_SH_PATH); echo "$${TCL_LIB_SPEC}")
    19     19   
    20         -all: appfs
           20  +all: appfsd
    21     21   
    22         -appfs: appfs.o
    23         -	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o appfs appfs.o $(LIBS)
           22  +appfsd: appfsd.o
           23  +	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o appfsd appfsd.o $(LIBS)
    24     24   
    25         -appfs-test: appfs-test.o
    26         -	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o appfs-test appfs-test.o $(LIBS)
           25  +appfsd.o: appfsd.c appfsd.tcl.h
           26  +	$(CC) $(CPPFLAGS) $(CFLAGS) -o appfsd.o -c appfsd.c
    27     27   
    28         -appfs.o: appfs.c appfs.tcl.h
    29         -	$(CC) $(CPPFLAGS) $(CFLAGS) -o appfs.o -c appfs.c
           28  +appfsd.tcl.h: appfsd.tcl stringify.tcl
           29  +	./stringify.tcl appfsd.tcl > appfsd.tcl.h.new
           30  +	mv appfsd.tcl.h.new appfsd.tcl.h
    30     31   
    31         -appfs-test.o: appfs.c appfs.tcl.h
    32         -	$(CC) $(CPPFLAGS) $(CFLAGS) -DAPPFS_TEST_DRIVER=1 -o appfs-test.o -c appfs.c
    33         -
    34         -appfs.tcl.h: appfs.tcl stringify.tcl
    35         -	./stringify.tcl appfs.tcl > appfs.tcl.h.new
    36         -	mv appfs.tcl.h.new appfs.tcl.h
    37         -
    38         -install: appfs
    39         -	cp appfs $(bindir)
    40         -
    41         -test: appfs-test
    42         -	./appfs-test
           32  +install: appfsd
           33  +	cp appfsd $(bindir)
    43     34   
    44     35   clean:
    45         -	rm -f appfs appfs.o
    46         -	rm -f appfs-test appfs-test.o
    47         -	rm -f appfs.tcl.h
           36  +	rm -f appfsd appfsd.o
           37  +	rm -f appfsd.tcl.h
    48     38   
    49     39   distclean: clean
    50     40   
    51     41   .PHONY: all test clean distclean install

Modified appfsd.c from [c11522a03a] to [2342477e32].

   195    195   	if (tcl_ret != TCL_OK) {
   196    196   		fprintf(stderr, "Unable to initialize Tcl.  Aborting.\n");
   197    197   
   198    198   		return(NULL);
   199    199   	}
   200    200   
   201    201   	tcl_ret = Tcl_Eval(interp, ""
   202         -#include "appfs.tcl.h"
          202  +#include "appfsd.tcl.h"
   203    203   	"");
   204    204   	if (tcl_ret != TCL_OK) {
   205    205   		fprintf(stderr, "Unable to initialize Tcl AppFS script.  Aborting.\n");
   206    206   		fprintf(stderr, "Tcl Error is: %s\n", Tcl_GetStringResult(interp));
   207    207   
   208    208   		return(NULL);
   209    209   	}
................................................................................
   920    920   	}
   921    921   
   922    922   	read_ret = read(fi->fh, buf, size);
   923    923   
   924    924   	return(read_ret);
   925    925   }
   926    926   
   927         -#ifdef APPFS_TEST_DRIVER
   928         -static int appfs_test_driver(void) {
   929         -	struct appfs_site *sites, *site;
   930         -	struct appfs_package *packages, *package;
   931         -	struct appfs_children *files, *file;
   932         -	char *sha1 = NULL;
   933         -	int packages_count = 0, sites_count = 0, files_count;
   934         -
   935         -	sites = appfs_getsites(&sites_count);
   936         -	printf("Sites:\n");
   937         -	for (site = sites; site; site = site->_next) {
   938         -		printf("\tname = %s\n", site->name);
   939         -	}
   940         -
   941         -	appfs_free_list_site(sites);
   942         -
   943         -	packages = appfs_getindex("rkeene.org", &packages_count);
   944         -	if (packages == NULL || packages_count == 0) {
   945         -		fprintf(stderr, "Unable to fetch package index from rkeene.org.\n");
   946         -
   947         -		return(1);
   948         -	}
   949         -
   950         -	for (package = packages; package; package = package->_next) {
   951         -		sha1 = package->sha1;
   952         -
   953         -		printf("Package:\n\tname = %s\n\tversion = %s\n\tsha1 = %s\n\tos = %s\n\tcpuArch = %s\n",
   954         -			package->name,
   955         -			package->version,
   956         -			package->sha1,
   957         -			appfs_convert_os_toString(package->os),
   958         -			appfs_convert_cpuArch_toString(package->cpuArch)
   959         -		);
   960         -	}
   961         -
   962         -	files = appfs_getchildren("rkeene.org", sha1, "", &files_count);
   963         -	if (files == NULL) {
   964         -		fprintf(stderr, "Unable to list files in the last package.\n");
   965         -
   966         -		return(1);
   967         -	}
   968         -
   969         -	printf("Files:\n");
   970         -	for (file = files; file; file = file->_next) {
   971         -		printf("\t%s\n", file->name);
   972         -	}
   973         -
   974         -	appfs_free_list_children(files);
   975         -
   976         -	files = appfs_getchildren("rkeene.org", sha1, "tcl", &files_count);
   977         -	if (files == NULL) {
   978         -		fprintf(stderr, "Unable to list files in the last package.\n");
   979         -
   980         -		return(1);
   981         -	}
   982         -
   983         -	printf("Files:\n");
   984         -	for (file = files; file; file = file->_next) {
   985         -		printf("\ttcl/%s\n", file->name);
   986         -	}
   987         -
   988         -	appfs_free_list_children(files);
   989         -	appfs_free_list_package(packages);
   990         -
   991         -	return(0);
   992         -}
   993         -#else
   994    927   static struct fuse_operations appfs_oper = {
   995    928   	.getattr	= appfs_fuse_getattr,
   996    929   	.readdir	= appfs_fuse_readdir,
   997    930   	.open		= appfs_fuse_open,
   998    931   	.read		= appfs_fuse_read
   999    932   };
  1000         -#endif
  1001    933   
  1002    934   int main(int argc, char **argv) {
  1003    935   	const char *cachedir = APPFS_CACHEDIR;
  1004    936   	char dbfilename[1024];
  1005    937   	int pthread_ret, snprintf_ret, sqlite_ret;
  1006    938   
  1007    939   	globalThread.cachedir = cachedir;
................................................................................
  1024    956   	sqlite_ret = sqlite3_open(dbfilename, &globalThread.db);
  1025    957   	if (sqlite_ret != SQLITE_OK) {
  1026    958   		fprintf(stderr, "Unable to open database: %s\n", dbfilename);
  1027    959   
  1028    960   		return(1);
  1029    961   	}
  1030    962   
  1031         -#ifdef APPFS_TEST_DRIVER
  1032         -	return(appfs_test_driver());
  1033         -#else
  1034    963   	return(fuse_main(argc, argv, &appfs_oper, NULL));
  1035         -#endif
  1036    964   }
  1037    965    

Name change from appfs.tcl to appfsd.tcl.