static const char *first_opt(unsigned *i, unsigned *len)
{
for (*i = 0; *i < opt_count; (*i)++) {
- if (opt_table[*i].type == OPT_SUBTABLE)
+ if (opt_table[*i].type & OPT_SUBTABLE)
continue;
return first_name(opt_table[*i].names, len);
}
static const char *next_opt(const char *p, unsigned *i, unsigned *len)
{
for (; *i < opt_count; (*i)++) {
- if (opt_table[*i].type == OPT_SUBTABLE)
+ if (opt_table[*i].type & OPT_SUBTABLE)
continue;
if (!p)
return first_name(opt_table[*i].names, len);
{
const char *p;
unsigned len;
+ enum opt_type type = entry->type & (OPT_USER_MIN-1);
- if (entry->type != OPT_HASARG && entry->type != OPT_NOARG
- && entry->type != (OPT_EARLY|OPT_HASARG)
- && entry->type != (OPT_EARLY|OPT_NOARG))
+ if (type != OPT_HASARG && type != OPT_NOARG
+ && type != (OPT_EARLY|OPT_HASARG)
+ && type != (OPT_EARLY|OPT_NOARG))
failmsg("Option %s: unknown entry type %u",
entry->names, entry->type);
int found = -1, i;
for (i = 0; i < opt_count; i++) {
- if (opt_table[i].type == OPT_SUBTABLE)
+ if (opt_table[i].type & OPT_SUBTABLE)
continue;
if (strcmp(opt_table[i].names, names) == 0)
found = i;
add_opt(&heading);
}
for (i = 0; entry[i].type != OPT_END; i++) {
- if (entry[i].type == OPT_SUBTABLE)
+ if (entry[i].type & OPT_SUBTABLE)
opt_register_table(subtable_of(&entry[i]),
entry[i].desc);
else {