X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;ds=sidebyside;f=ccan%2Fopt%2Fprivate.h;h=47b8c4e056eead80956103965c1324033da9b05a;hb=a8722345053b7cd860499aa31fd6bb414c120cc8;hp=e4ad24a2be9e7947f862d295bef76b330c735c90;hpb=50212d0d271f967d9f5d14c116ec54c0050882a8;p=ccan diff --git a/ccan/opt/private.h b/ccan/opt/private.h index e4ad24a2..47b8c4e0 100644 --- a/ccan/opt/private.h +++ b/ccan/opt/private.h @@ -1,4 +1,4 @@ -/* Licensed under GPLv3+ - see LICENSE file for details */ +/* Licensed under GPLv2+ - see LICENSE file for details */ #ifndef CCAN_OPT_PRIVATE_H #define CCAN_OPT_PRIVATE_H @@ -7,13 +7,20 @@ extern unsigned int opt_count, opt_num_short, opt_num_short_arg, opt_num_long; extern const char *opt_argv0; -#define subtable_of(entry) ((struct opt_table *)((entry)->names)) +#define subtable_of(entry) ((const struct opt_table *)((entry)->names)) const char *first_sopt(unsigned *i); const char *next_sopt(const char *names, unsigned *i); const char *first_lopt(unsigned *i, unsigned *len); const char *next_lopt(const char *p, unsigned *i, unsigned *len); +struct opt_alloc { + void *(*alloc)(size_t size); + void *(*realloc)(void *ptr, size_t size); + void (*free)(void *ptr); +}; +extern struct opt_alloc opt_alloc; + int parse_one(int *argc, char *argv[], enum opt_type is_early, unsigned *offset, void (*errlog)(const char *fmt, ...));