* params. To go with those flow, we rewrite all incoming / * simply to \, so internally we can safely assume \. */ static inline char *replace_pathsep(char *s) { for (char *c = s; *c != '\0'; c++) if (*c == '/') *c = '\\'; return s; } #else static inline char *replace_pathsep(char *s) { return s; } #endif /** Options of strgen. */ static const OptionData _opts[] = { GETOPT_NOVAL( 'v', "--version"), GETOPT_GENERAL('C', '\0', "-export-commands", ODF_NO_VALUE), GETOPT_GENERAL('L', '\0', "-export-plurals", ODF_NO_VALUE), GETOPT_GENERAL('P', '\0', "-export-pragmas", ODF_NO_VALUE), GETOPT_NOVAL( 't', "--todo"), GETOPT_NOVAL( 'w', "--warning"), GETOPT_NOVAL( 'h', "--help"), GETOPT_GENERAL('h', '?', NULL, ODF_NO_VALUE), GETOPT_VALUE( 's', "--source_dir"), GETOPT_VALUE( 'd', "--dest_dir"), GETOPT_END(), }; int CDECL main(int argc, char *argv[]) { char pathbuf[MAX_PATH]; const char *src_dir = ".";
fclose(f2); fclose(f1); return false; } } while (l1 != 0); fclose(f2); fclose(f1); return true; } /** Options of settingsgen. */ static const OptionData _opts[] = { GETOPT_NOVAL( 'v', "--version"), GETOPT_NOVAL( 'h', "--help"), GETOPT_GENERAL('h', '?', NULL, ODF_NO_VALUE), GETOPT_VALUE( 'o', "--output"), GETOPT_VALUE( 'b', "--before"), GETOPT_VALUE( 'a', "--after"), GETOPT_END(), }; /** * Process a single INI file. * The file should have a [templates] group, where each item is one template. * Variables in a template have the form '\$[_a-z0-9]+' (a literal '$' followed * by one or more '_', lowercase letters, or lowercase numbers). * * After loading, the [pre-amble] group is copied verbatim if it exists. * * For every group with a name that matches a template name the template is written.