| 159 | } |
| 160 | |
| 161 | void _opt_register(const char *names, enum opt_type type, |
| 162 | char *(*cb)(void *arg), |
| 163 | char *(*cb_arg)(const char *optarg, void *arg), |
| 164 | void (*show)(char buf[OPT_SHOW_LEN], const void *arg), |
| 165 | const void *arg, const char *desc) |
| 166 | { |
| 167 | struct opt_table opt; |
| 168 | opt.names = names; |
| 169 | opt.type = type; |
| 170 | opt.cb = cb; |
| 171 | opt.cb_arg = cb_arg; |
| 172 | opt.show = show; |
| 173 | opt.u.carg = arg; |
| 174 | opt.desc = desc; |
| 175 | check_opt(&opt); |
| 176 | add_opt(&opt); |
| 177 | } |
| 178 | |
| 179 | bool opt_unregister(const char *names) |
| 180 | { |