X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fopt%2Fprivate.h;h=f2199e48dc90b3581e376d91323a64d843fa2e2b;hp=b1a189234974bb8250102cd3a073f00b6bb503e2;hb=74257cee33ae3033f961d5f22a0313b8cb1b18d4;hpb=d7d5abe98caeec82d784ce525e0444ff438acd46;ds=inline diff --git a/ccan/opt/private.h b/ccan/opt/private.h index b1a18923..f2199e48 100644 --- a/ccan/opt/private.h +++ b/ccan/opt/private.h @@ -1,11 +1,20 @@ +/* Licensed under GPLv3+ - see LICENSE file for details */ #ifndef CCAN_OPT_PRIVATE_H #define CCAN_OPT_PRIVATE_H extern struct opt_table *opt_table; -extern unsigned int opt_count; +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)->longopt)) +#define subtable_of(entry) ((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); + +int parse_one(int *argc, char *argv[], unsigned *offset, + void (*errlog)(const char *fmt, ...)); #endif /* CCAN_OPT_PRIVATE_H */