From: Olivier Matz Date: Mon, 21 Feb 2011 23:00:13 +0000 (+0100) Subject: genconf: use the new file token for load/save X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f1352f348b3961a33094ea58ab6363021cba6ce1;p=libcmdline.git genconf: use the new file token for load/save Signed-off-by: Olivier Matz --- diff --git a/src/genconf/commands.c b/src/genconf/commands.c index 957bbef..1db4595 100644 --- a/src/genconf/commands.c +++ b/src/genconf/commands.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -550,7 +551,7 @@ cmdline_parse_inst_t cmd_show_node_a = { /**********************************************************/ struct cmd_load_result { - cmdline_fixed_string_t load; + cmdline_filename_t load; cmdline_fixed_string_t file; }; @@ -591,8 +592,8 @@ cmdline_parse_inst_t cmd_load = { }, }; -cmdline_parse_token_string_t cmd_load_file = - TOKEN_STRING_INITIALIZER(struct cmd_load_result, file, NULL); +cmdline_parse_token_file_t cmd_load_file = + TOKEN_FILE_INITIALIZER(struct cmd_load_result, file, 0); cmdline_parse_inst_t cmd_loadfile = { .f = cmd_load_parsed, /* function to call */ @@ -611,7 +612,7 @@ cmdline_parse_inst_t cmd_loadfile = { struct cmd_save_result { cmdline_fixed_string_t save; - cmdline_fixed_string_t file; + cmdline_filename_t file; }; static void cmd_save_parsed(void *parsed_result, @@ -646,8 +647,9 @@ cmdline_parse_inst_t cmd_save = { }, }; -cmdline_parse_token_string_t cmd_save_file = - TOKEN_STRING_INITIALIZER(struct cmd_save_result, file, NULL); +cmdline_parse_token_file_t cmd_save_file = + TOKEN_FILE_INITIALIZER(struct cmd_save_result, file, + PARSE_FILE_F_CREATE); cmdline_parse_inst_t cmd_savefile = { .f = cmd_save_parsed, /* function to call */