Index: lib/xvfs/xvfs.c.rvt ================================================================== --- lib/xvfs/xvfs.c.rvt +++ lib/xvfs/xvfs.c.rvt @@ -236,10 +236,13 @@ .getChildrenProc = xvfs__getChildren, .getDataProc = xvfs__getData, .getStatProc = xvfs__getStat }; +#ifdef XVFS__INIT_STATIC +static +#endif int Xvfs__Init(Tcl_Interp *interp) { int register_ret; #ifdef USE_TCL_STUBS const char *tclInitStubs_ret; @@ -257,5 +260,6 @@ return(TCL_OK); } #undef XVFS_NAME_LOOKUP_ERROR #undef XVFS_FILE_BLOCKSIZE +#undef XVFS__INIT_STATIC Index: lib/xvfs/xvfs.tcl ================================================================== --- lib/xvfs/xvfs.tcl +++ lib/xvfs/xvfs.tcl @@ -15,11 +15,11 @@ foreach error $errors { puts $channel "error: $error" } puts $channel "" } - puts $channel "Usage: dir2c \[--help\] \[--set-mode {flexible|standalone|client}\] \[--output \] --directory --name " + puts $channel "Usage: xvfs-create \[--help\] \[--static-init {true|false}\] \[--set-mode {flexible|standalone|client}\] \[--output \] --directory --name " flush $channel } proc ::xvfs::sanitizeCString {string} { set output [join [lmap char [split $string ""] { @@ -235,10 +235,11 @@ ## 1. Parse arguments if {[llength $argv] % 2 != 0} { lappend argv "" } + set staticInit false foreach {arg val} $argv { switch -exact -- $arg { "--help" { printHelp stdout exit 0 @@ -247,10 +248,13 @@ set rootDirectory $val } "--name" { set fsName $val } + "--static-init" { + set staticInit $val + } "--output" - "--header" - "--set-mode" { # Ignored, handled as part of some other process } default { printHelp stderr [list "Invalid option: $arg $val"] @@ -271,11 +275,16 @@ if {[llength $errors] != 0} { printHelp stderr $errors exit 1 } - ## 3. Start processing directory and producing initial output + ## 3. Initialization + if {$staticInit} { + ::xvfs::_emitLine "#define XVFS_${fsName}_INIT_STATIC 1" + } + + ## 4. Start processing directory and producing initial output set ::xvfs::outputFiles [processDirectory $fsName $rootDirectory] set ::xvfs::fsName $fsName set ::xvfs::rootDirectory $rootDirectory Index: xvfs-core.c ================================================================== --- xvfs-core.c +++ xvfs-core.c @@ -1,6 +1,8 @@ #include +#ifndef XVFS_CORE_H_1B4B28D60EBAA11D5FF85642FA7CA22C29E8E817 +#define XVFS_CORE_C_1B4B28D60EBAA11D5FF85642FA7CA22C29E8E817 1 #include #include #include #include #include @@ -1258,5 +1260,6 @@ #undef XVFS_DEBUG_ENTER #undef XVFS_DEBUG_LEAVE #undef XVFS_INTERNAL_SERVER_MAGIC #undef XVFS_INTERNAL_SERVER_MAGIC_LEN #undef XVFS_ROOT_MOUNTPOINT +#endif /* XVFS_CORE_C_1B4B28D60EBAA11D5FF85642FA7CA22C29E8E817 */ Index: xvfs-create ================================================================== --- xvfs-create +++ xvfs-create @@ -7,10 +7,11 @@ set template [file join $sourceDirectory lib xvfs xvfs.c.rvt] package require minirivet set mode "run" +set staticInit false if {[lindex $argv 0] == "--dump-tcl"} { set mode "dump-tcl" } foreach {arg val} $argv {