@@ -15,11 +15,11 @@ foreach error $errors { puts $channel "error: $error" } puts $channel "" } - puts $channel "Usage: dir2c \[--help\] \[--output \] --directory --name " + puts $channel "Usage: dir2c \[--help\] \[--set-mode {flexible|standalone|client}\] \[--output \] --directory --name " flush $channel } proc ::xvfs::sanitizeCString {string} { set output [join [lmap char [split $string ""] { @@ -247,11 +247,11 @@ set rootDirectory $val } "--name" { set fsName $val } - "--output" - "--header" { + "--output" - "--header" - "--set-mode" { # Ignored, handled as part of some other process } default { printHelp stderr [list "Invalid option: $arg $val"] exit 1 @@ -307,10 +307,18 @@ proc ::xvfs::staticIncludeHeader {pathToHeaderFile} { set fd [open $pathToHeaderFile] ::xvfs::staticIncludeHeaderData [read $fd] close $fd } + +proc ::xvfs::setSpecificMode {mode} { + ::minirivet::_emitOutput "#undef XVFS_MODE_SERVER\n" + ::minirivet::_emitOutput "#undef XVFS_MODE_CLIENT\n" + ::minirivet::_emitOutput "#undef XVFS_MODE_FLEXIBLE\n" + ::minirivet::_emitOutput "#undef XVFS_MODE_STANDALONE\n" + ::minirivet::_emitOutput "#define XVFS_MODE_[string toupper $mode] 1\n" +} proc ::xvfs::_tryFit {list} { set idx -1 set lastItem -100000 foreach item $list {