Commit 89286906 authored by Mark Andrews's avatar Mark Andrews

4502. [func] Report multiple and experimental options when printing

                        grammar. [RT #43134]
parent e1c93a0f
4502. [func] Report multiple and experimental options when printing
grammar. [RT #43134]
4501. [placeholder]
4500. [bug] Support modifier I64 in isc__print_printf. [RT #43526]
......
......@@ -13,7 +13,7 @@ sub sortlevel() {
my $fin = "";
my $i = 0;
while (<>) {
if (/^\s*};$/) {
if (/^\s*};$/ || /^\s*}; \/\/.*$/) {
$fin = $_;
# print 2, $_;
last;
......
......@@ -46,6 +46,8 @@
#define CFG_CLAUSEFLAG_TESTONLY 0x00000040
/*% A configuration option that was not configured at compile time. */
#define CFG_CLAUSEFLAG_NOTCONFIGURED 0x00000080
/*% A option for a experimental feature. */
#define CFG_CLAUSEFLAG_EXPERIMENTAL 0x00000100
typedef struct cfg_clausedef cfg_clausedef_t;
typedef struct cfg_tuplefielddef cfg_tuplefielddef_t;
......
......@@ -1776,7 +1776,7 @@ view_clauses[] = {
{ "suppress-initial-notify", &cfg_type_boolean, CFG_CLAUSEFLAG_NYI },
{ "topology", &cfg_type_bracketed_aml, CFG_CLAUSEFLAG_NOTIMP },
{ "transfer-format", &cfg_type_transferformat, 0 },
{ "trust-anchor-telemetry", &cfg_type_boolean, 0 },
{ "trust-anchor-telemetry", &cfg_type_boolean, CFG_CLAUSEFLAG_EXPERIMENTAL },
{ "use-queryport-pool", &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE },
{ "v6-bias", &cfg_type_uint32, 0 },
{ "zero-no-soa-ttl-cache", &cfg_type_boolean, 0 },
......
......@@ -1113,7 +1113,7 @@ static void
doc_btext(cfg_printer_t *pctx, const cfg_type_t *type) {
UNUSED(type);
cfg_print_cstr(pctx, "{ <unspecified text> }");
cfg_print_cstr(pctx, "{ <unspecified-text> }");
}
......@@ -1953,6 +1953,37 @@ cfg_print_mapbody(cfg_printer_t *pctx, const cfg_obj_t *obj) {
}
}
static struct flagtext {
unsigned int flag;
const char *text;
} flagtexts[] = {
{ CFG_CLAUSEFLAG_NOTIMP, "not implemented" },
{ CFG_CLAUSEFLAG_NYI, "not yet implemented" },
{ CFG_CLAUSEFLAG_OBSOLETE, "obsolete" },
{ CFG_CLAUSEFLAG_NEWDEFAULT, "default changed" },
{ CFG_CLAUSEFLAG_TESTONLY, "test only" },
{ CFG_CLAUSEFLAG_NOTCONFIGURED, "not configured" },
{ CFG_CLAUSEFLAG_MULTI, "may occur multiple times" },
{ CFG_CLAUSEFLAG_EXPERIMENTAL, "experimental" },
{ 0, NULL }
};
static void
print_clause_flags(cfg_printer_t *pctx, unsigned int flags) {
struct flagtext *p;
isc_boolean_t first = ISC_TRUE;
for (p = flagtexts; p->flag != 0; p++) {
if ((flags & p->flag) != 0) {
if (first)
cfg_print_cstr(pctx, " // ");
else
cfg_print_cstr(pctx, ", ");
cfg_print_cstr(pctx, p->text);
first = ISC_FALSE;
}
}
}
void
cfg_doc_mapbody(cfg_printer_t *pctx, const cfg_type_t *type) {
const cfg_clausedef_t * const *clauseset;
......@@ -1968,25 +1999,13 @@ cfg_doc_mapbody(cfg_printer_t *pctx, const cfg_type_t *type) {
cfg_print_cstr(pctx, clause->name);
cfg_print_cstr(pctx, " ");
cfg_doc_obj(pctx, clause->type);
/* XXX print flags here? */
cfg_print_cstr(pctx, ";\n\n");
cfg_print_cstr(pctx, ";");
print_clause_flags(pctx, clause->flags);
cfg_print_cstr(pctx, "\n\n");
}
}
}
static struct flagtext {
unsigned int flag;
const char *text;
} flagtexts[] = {
{ CFG_CLAUSEFLAG_NOTIMP, "not implemented" },
{ CFG_CLAUSEFLAG_NYI, "not yet implemented" },
{ CFG_CLAUSEFLAG_OBSOLETE, "obsolete" },
{ CFG_CLAUSEFLAG_NEWDEFAULT, "default changed" },
{ CFG_CLAUSEFLAG_TESTONLY, "test only" },
{ CFG_CLAUSEFLAG_NOTCONFIGURED, "not configured" },
{ 0, NULL }
};
void
cfg_print_map(cfg_printer_t *pctx, const cfg_obj_t *obj) {
REQUIRE(pctx != NULL);
......@@ -2001,22 +2020,6 @@ cfg_print_map(cfg_printer_t *pctx, const cfg_obj_t *obj) {
print_close(pctx);
}
static void
print_clause_flags(cfg_printer_t *pctx, unsigned int flags) {
struct flagtext *p;
isc_boolean_t first = ISC_TRUE;
for (p = flagtexts; p->flag != 0; p++) {
if ((flags & p->flag) != 0) {
if (first)
cfg_print_cstr(pctx, " // ");
else
cfg_print_cstr(pctx, ", ");
cfg_print_cstr(pctx, p->text);
first = ISC_FALSE;
}
}
}
void
cfg_doc_map(cfg_printer_t *pctx, const cfg_type_t *type) {
const cfg_clausedef_t * const *clauseset;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment