]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/reduce_features.c
htable: clean up interface, document htable_type better.
[ccan] / tools / ccanlint / tests / reduce_features.c
index 39a2bde067a96dbc0072514f5633eebff39974aa..de817d655aa1342da22c2228ba55ac138cd58ba8 100644 (file)
@@ -40,7 +40,20 @@ static bool option_cmp(const char *name1, const char *name2)
        return streq(name1, name2);
 }
 
-HTABLE_DEFINE_TYPE(char, option_name, option_hash, option_cmp, option);
+HTABLE_DEFINE_TYPE(char, option_name, option_hash, option_cmp, htable_option);
+
+static struct htable_option *htable_option_new(void)
+{
+       struct htable_option *opts = malloc(sizeof(*opts));
+       htable_option_init(opts);
+       return opts;
+}
+
+static void htable_option_free(struct htable_option *opts)
+{
+       htable_option_clear(opts);
+       free(opts);
+}
 
 static unsigned int add_options(struct htable_option *opts,
                                struct pp_conditions *cond)