]> git.ozlabs.org Git - ccan/blob - ccan/opt/private.h
opt: add new parse_early_args_incomplete.
[ccan] / ccan / opt / private.h
1 /* Licensed under GPLv2+ - see LICENSE file for details */
2 #ifndef CCAN_OPT_PRIVATE_H
3 #define CCAN_OPT_PRIVATE_H
4
5 extern struct opt_table *opt_table;
6 extern unsigned int opt_count, opt_num_short, opt_num_short_arg, opt_num_long;
7
8 extern const char *opt_argv0;
9
10 #define subtable_of(entry) ((const struct opt_table *)((entry)->names))
11
12 const char *first_sopt(unsigned *i);
13 const char *next_sopt(const char *names, unsigned *i);
14 const char *first_lopt(unsigned *i, unsigned *len);
15 const char *next_lopt(const char *p, unsigned *i, unsigned *len);
16
17 struct opt_alloc {
18         void *(*alloc)(size_t size);
19         void *(*realloc)(void *ptr, size_t size);
20         void (*free)(void *ptr);
21 };
22 extern struct opt_alloc opt_alloc;
23
24 int parse_one(int *argc, char *argv[], enum opt_type is_early, unsigned *offset,
25               void (*errlog)(const char *fmt, ...), bool unknown_ok);
26
27 #endif /* CCAN_OPT_PRIVATE_H */