X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fopt%2Fopt.h;h=55a78d8ff139e9cbe1de384d4d1da0021557e3aa;hp=7049fffc1c7fa57b8e3b1296da56fc8dc183addd;hb=f725bbb1987284933e0f21dfb8f2ce7a1f0806e5;hpb=af7afcd46e70e87397c33408d88f2bedd2c90bd8 diff --git a/ccan/opt/opt.h b/ccan/opt/opt.h index 7049fffc..55a78d8f 100644 --- a/ccan/opt/opt.h +++ b/ccan/opt/opt.h @@ -187,10 +187,12 @@ 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. + * opt_free_table - reset the opt library. * - * This frees the internal memory. Call this as the last - * opt function. + * This frees the internal memory and returns counters to zero. Call + * this as the last opt function to avoid memory leaks. You can also + * use this function to reset option handling to its initial state (no + * options registered). */ void opt_free_table(void); @@ -297,6 +299,24 @@ char *opt_set_longlongval_si(const char *arg, long long *ll); char *opt_set_ulonglongval_bi(const char *arg, unsigned long long *ll); char *opt_set_ulonglongval_si(const char *arg, unsigned long long *ll); + +void opt_show_intval_bi(char buf[OPT_SHOW_LEN], const int *x); +void opt_show_longval_bi(char buf[OPT_SHOW_LEN], const long *x); +void opt_show_longlongval_bi(char buf[OPT_SHOW_LEN], const long long *x); +void opt_show_uintval_bi(char buf[OPT_SHOW_LEN], const unsigned int *x); +void opt_show_ulongval_bi(char buf[OPT_SHOW_LEN], const unsigned long *x); +void opt_show_ulonglongval_bi(char buf[OPT_SHOW_LEN], const unsigned long long *x); + +void opt_show_intval_si(char buf[OPT_SHOW_LEN], const int *x); +void opt_show_longval_si(char buf[OPT_SHOW_LEN], const long *x); +void opt_show_longlongval_si(char buf[OPT_SHOW_LEN], const long long *x); +void opt_show_uintval_si(char buf[OPT_SHOW_LEN], const unsigned int *x); +void opt_show_ulongval_si(char buf[OPT_SHOW_LEN], const unsigned long *x); +void opt_show_ulonglongval_si(char buf[OPT_SHOW_LEN], const unsigned long long *x); + + + + /* Increment. */ char *opt_inc_intval(int *i);