From d9a75b1d7328b039f7b6a26d86183b3388cc08aa Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 26 Jun 2013 00:21:00 +0200 Subject: add the map variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/argparser.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/argparser.c b/src/argparser.c index 274091e..fdcf84f 100644 --- a/src/argparser.c +++ b/src/argparser.c @@ -194,11 +194,15 @@ static long args_options_count; */ static long args_options_size; -// Option map -// HashMap optmap = new HashMap(); +/** + * Option map + */ +static args_Map args_optmap; -// Parsed arguments, a map from option to arguments, `null` if not used, add one `null` element per argumentless use. -// HashMap opts = new HashMap(); +/** + * Parsed arguments, a map from option to arguments, with one `null` element per argumentless use + */ +static args_Map args_opts; @@ -243,6 +247,8 @@ extern void args_init(char* description, char* usage, char* longdscription, char args_options_count = 0; args_options_size = 64; args_options = (args_Option*)malloc(args_options_size * sizeof(args_Option)); + args_map_init(&optmap); + args_map_init(&opts); } @@ -1424,6 +1430,7 @@ static void sort(char** list, long count) /* TODO +void args_map_init(*args_Map) void* args_map_get(*args_Map, char*) void args_map_put(*args_Map, char*, void*) void** args_map_free(*args_Map) -- cgit v1.2.3-70-g09d2