X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fopt%2Fopt.h;h=5757778577e2079b31641f176dd6976fe11c4d3d;hp=8796752a133f9f8d70854af0d99ba52af4d8b51c;hb=a39bf3aca1b60365efaf8b1eeb2b2c58b09ffab6;hpb=1b2efd5679452d03ff7a0dacb496eb3830b37434 diff --git a/ccan/opt/opt.h b/ccan/opt/opt.h index 8796752a..57577785 100644 --- a/ccan/opt/opt.h +++ b/ccan/opt/opt.h @@ -1,5 +1,6 @@ #ifndef CCAN_OPT_H #define CCAN_OPT_H +#include #include #include @@ -79,7 +80,7 @@ struct opt_table; * * This must be the final element in the opt_table array. */ -#define OPT_ENDTABLE { NULL, OPT_END } +#define OPT_ENDTABLE { NULL, OPT_END, NULL, NULL, NULL, NULL, NULL } /** * opt_register_table - register a table of options @@ -182,6 +183,14 @@ void opt_register_table(const struct opt_table *table, const char *desc); */ bool opt_parse(int *argc, char *argv[], void (*errlog)(const char *fmt, ...)); +/** + * opt_free_table - free the table. + * + * This frees the internal memory. Call this as the last + * opt function. + */ +void opt_free_table(void); + /** * opt_log_stderr - print message to stderr. * @fmt: printf-style format. @@ -325,6 +334,6 @@ void _opt_register(const char *names, enum opt_type type, void *arg, const char *desc); /* We use this to get typechecking for OPT_SUBTABLE */ -static inline int _check_is_entry(struct opt_table *e) { return 0; } +static inline int _check_is_entry(struct opt_table *e UNUSED) { return 0; } #endif /* CCAN_OPT_H */