CA_DUMP_ONLY selectors are like CA_DUMP_NONE, except the xdump command
still has them. This will permit adding selectors for conditional
selector and xdump command forward compatibility without also adding
them to configuration tables.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
/* order is relevant */
CA_DUMP, /* xdump and xundump normally */
CA_DUMP_CONST, /* same, but value can't be changed */
+ CA_DUMP_ONLY, /* only in xdump command */
CA_DUMP_NONE /* do not xdump or xundump */
};
if (CANT_HAPPEN((ef_flags(type) & EFF_MEM)
&& ca[i].ca_get
&& ca[i].ca_dump <= CA_DUMP_CONST))
- ca[i].ca_dump = CA_DUMP_NONE;
+ ca[i].ca_dump = CA_DUMP_ONLY;
}
return 0;
}
/*
* Initialize @xd.
+ * If @cnum is NATID_BAD, this is an empdump export rather than an
+ * xdump command.
* Translate dump for country @cnum, except when @cnum is NATID_BAD.
+ * Ignore CA_DUMP_ONLY selectors when @cnum is NATID_BAD.
* If @human, dump in human-readable format.
* If @sloppy, try to cope with invalid data (may result in invalid
* dump).
continue;
if (ca[i].ca_dump == CA_DUMP_NONE)
continue;
+ if (ca[i].ca_dump == CA_DUMP_ONLY && xd->cnum == NATID_BAD)
+ continue;
n = CA_ARRAY_LEN(&ca[i]);
j = 0;
do {