private.h 942 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright 2011 Rusty Russell
  3. *
  4. * This program is free software; you can redistribute it and/or modify it under
  5. * the terms of the GNU General Public License as published by the Free Software
  6. * Foundation; either version 2 of the License, or (at your option) any later
  7. * version. See LICENSE for more details.
  8. */
  9. #ifndef CCAN_OPT_PRIVATE_H
  10. #define CCAN_OPT_PRIVATE_H
  11. extern struct opt_table *opt_table;
  12. extern unsigned int opt_count, opt_num_short, opt_num_short_arg, opt_num_long;
  13. extern const char *opt_argv0;
  14. #define subtable_of(entry) ((struct opt_table *)((entry)->names))
  15. const char *first_sopt(unsigned *i);
  16. const char *next_sopt(const char *names, unsigned *i);
  17. const char *first_lopt(unsigned *i, unsigned *len);
  18. const char *next_lopt(const char *p, unsigned *i, unsigned *len);
  19. int parse_one(int *argc, char *argv[], unsigned *offset,
  20. void (*errlog)(const char *fmt, ...));
  21. #endif /* CCAN_OPT_PRIVATE_H */