aboutsummaryrefslogtreecommitdiffstats
path: root/src/argparser.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-06-26 00:21:00 +0200
committerMattias Andrée <maandree@operamail.com>2013-06-26 00:21:00 +0200
commitd9a75b1d7328b039f7b6a26d86183b3388cc08aa (patch)
treecf8af9cc551c24fece12d6faafceea5934a7de23 /src/argparser.c
parentfree the maps (diff)
downloadargparser-d9a75b1d7328b039f7b6a26d86183b3388cc08aa.tar.gz
argparser-d9a75b1d7328b039f7b6a26d86183b3388cc08aa.tar.bz2
argparser-d9a75b1d7328b039f7b6a26d86183b3388cc08aa.tar.xz
add the map variables
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/argparser.c')
-rw-r--r--src/argparser.c15
1 files changed, 11 insertions, 4 deletions
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<String, Option> optmap = new HashMap<String, Option>();
+/**
+ * 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<String, String[]> opts = new HashMap<String, String[]>();
+/**
+ * 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)