typedef struct {
char *opt;
void *var;
} option_record;
opt - a key string
var - an argument
void set_options(int n, option_record options[]);
n - the number of key strings to register
options - an array of structure which includes the key and the
variable
option_complex *set_option(char *key, ...)
key, ... - key string and multi-variable arguments
option_complex *alias_option(char *key, char *alias);
key - already registered key
alias - its alias
void scan_options(int argc, char *argv[]);
argc - the number of command-line arguments
argv - command-line arguments
int is_option(char *key);
key - the key string
int reset_options()
set_options(9, options);
set_option("-geom %dx%d", &width, &height);
alias_option("-geom", "-geometry");
scan_options(argc, argv);
if (is_option("-help"))
show_help();
reset_options();
For the styles of key, please see option.h