154#define BU_OPT_CHECK_ARGV0(_msg, _argc, _argv, _opt_name) do { \
155 if ((_argc) < 1 || !(_argv) || !(_argv)[0] || (_argv)[0][0] == '\0') { \
157 bu_vls_printf((_msg), "ERROR: missing required argument: %s\n", (_opt_name)); \
181#define BU_OPT_DESC_NULL {NULL, NULL, NULL, NULL, NULL, NULL}
184#define BU_OPT(_desc, _so, _lo, _ahelp, _aprocess, _var, _help) do { \
185 (_desc).shortopt = _so; \
186 (_desc).longopt = _lo; \
187 (_desc).arg_helpstr = _ahelp; \
188 (_desc).arg_process = _aprocess; \
189 (_desc).set_var = (void *)_var; \
190 (_desc).help_string = _help; \
194#define BU_OPT_NULL(_desc) do { \
195 (_desc).shortopt = NULL; \
196 (_desc).longopt = NULL; \
197 (_desc).arg_helpstr = NULL; \
198 (_desc).arg_process = NULL; \
199 (_desc).set_var = NULL; \
200 (_desc).help_string = NULL; \
295#define BU_OPT_DESC_OPTS_INIT_ZERO { BU_OPT_ASCII, 2, 28, 50, NULL, NULL, NULL, 1, NULL, NULL }
Header file for the BRL-CAD common definitions.
int bu_opt_long(struct bu_vls *msg, size_t argc, const char **argv, void *set_var)
int bu_opt_vect_t(struct bu_vls *msg, size_t argc, const char **argv, void *set_var)
int bu_opt_str(struct bu_vls *msg, size_t argc, const char **argv, void *set_var)
int bu_opt_color(struct bu_vls *msg, size_t argc, const char **argv, void *set_var)
int bu_opt_fastf_t(struct bu_vls *msg, size_t argc, const char **argv, void *set_var)
int bu_opt_bool(struct bu_vls *msg, size_t argc, const char **argv, void *set_var)
int bu_opt_int(struct bu_vls *msg, size_t argc, const char **argv, void *set_var)
int bu_opt_vls(struct bu_vls *msg, size_t argc, const char **argv, void *set_var)
int bu_opt_long_hex(struct bu_vls *msg, size_t argc, const char **argv, void *set_var)
int(* bu_opt_arg_process_t)(struct bu_vls *msg, size_t argc, const char **argv, void *set_var)
char * bu_opt_describe(const struct bu_opt_desc *ds, struct bu_opt_desc_opts *settings)
int bu_opt_parse(struct bu_vls *msgs, size_t ac, const char **argv, const struct bu_opt_desc *ds)
int bu_opt_incr_long(struct bu_vls *msg, size_t argc, const char **argv, void *set_var)
struct bu_opt_desc * repeated
struct bu_opt_desc * optional
struct bu_opt_desc * required
"Option description" structure.
void * set_var
Pointer to the variable or structure that collects this option's results.
const char * shortopt
"Short" option (i.e. -h for help option)
const char * help_string
Option description.
const char * arg_helpstr
Documentation describing option argument, if any (i.e. "file" in –input file)
const char * longopt
"Long" option (i.e. –help for help option)
bu_opt_arg_process_t arg_process
Argument processing function pointer.