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

grammar. [RT #43134]

(cherry picked from commit 89286906dc)
This commit is contained in:
Mark Andrews 2016-11-02 10:04:57 +11:00
parent 8d72b87657
commit bd19cef223
5 changed files with 46 additions and 38 deletions

View file

@ -1,3 +1,6 @@
4502. [func] Report multiple and experimental options when printing
grammar. [RT #43134]
4500. [bug] Support modifier I64 in isc__print_printf. [RT #43526]
4499. [port] MacOSX: silence deprecated function warning

View file

@ -13,7 +13,7 @@ sub sortlevel() {
my $fin = "";
my $i = 0;
while (<>) {
if (/^\s*};$/) {
if (/^\s*};$/ || /^\s*}; \/\/.*$/) {
$fin = $_;
# print 2, $_;
last;

View file

@ -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;

View file

@ -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 },

View file

@ -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,27 +1953,6 @@ cfg_print_mapbody(cfg_printer_t *pctx, const cfg_obj_t *obj) {
}
}
void
cfg_doc_mapbody(cfg_printer_t *pctx, const cfg_type_t *type) {
const cfg_clausedef_t * const *clauseset;
const cfg_clausedef_t *clause;
REQUIRE(pctx != NULL);
REQUIRE(type != NULL);
for (clauseset = type->of; *clauseset != NULL; clauseset++) {
for (clause = *clauseset;
clause->name != NULL;
clause++) {
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");
}
}
}
static struct flagtext {
unsigned int flag;
const char *text;
@ -1984,23 +1963,11 @@ static struct flagtext {
{ 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 }
};
void
cfg_print_map(cfg_printer_t *pctx, const cfg_obj_t *obj) {
REQUIRE(pctx != NULL);
REQUIRE(obj != NULL);
if (obj->value.map.id != NULL) {
cfg_print_obj(pctx, obj->value.map.id);
cfg_print_cstr(pctx, " ");
}
print_open(pctx);
cfg_print_mapbody(pctx, obj);
print_close(pctx);
}
static void
print_clause_flags(cfg_printer_t *pctx, unsigned int flags) {
struct flagtext *p;
@ -2017,6 +1984,42 @@ print_clause_flags(cfg_printer_t *pctx, unsigned int flags) {
}
}
void
cfg_doc_mapbody(cfg_printer_t *pctx, const cfg_type_t *type) {
const cfg_clausedef_t * const *clauseset;
const cfg_clausedef_t *clause;
REQUIRE(pctx != NULL);
REQUIRE(type != NULL);
for (clauseset = type->of; *clauseset != NULL; clauseset++) {
for (clause = *clauseset;
clause->name != NULL;
clause++) {
cfg_print_cstr(pctx, clause->name);
cfg_print_cstr(pctx, " ");
cfg_doc_obj(pctx, clause->type);
cfg_print_cstr(pctx, ";");
print_clause_flags(pctx, clause->flags);
cfg_print_cstr(pctx, "\n\n");
}
}
}
void
cfg_print_map(cfg_printer_t *pctx, const cfg_obj_t *obj) {
REQUIRE(pctx != NULL);
REQUIRE(obj != NULL);
if (obj->value.map.id != NULL) {
cfg_print_obj(pctx, obj->value.map.id);
cfg_print_cstr(pctx, " ");
}
print_open(pctx);
cfg_print_mapbody(pctx, obj);
print_close(pctx);
}
void
cfg_doc_map(cfg_printer_t *pctx, const cfg_type_t *type) {
const cfg_clausedef_t * const *clauseset;