Commit cf072d65 authored by Evan Hunt's avatar Evan Hunt
Browse files

cleanup cfg_parse_buffer* functions

cfg_parse_buffer() now has the same signature as the former
cfg_parse_buffer4(). cfg_parse_buffer{2,3,4}() have been removed.
parent 57dedab3
Pipeline #9035 passed with stages
in 16 minutes and 29 seconds
......@@ -743,8 +743,8 @@ setup_dnsseckeys(dns_client_t *client) {
isc_buffer_init(&b, anchortext, sizeof(anchortext) - 1);
isc_buffer_add(&b, sizeof(anchortext) - 1);
result = cfg_parse_buffer(parser, &b, &cfg_type_bindkeys,
&bindkeys);
result = cfg_parse_buffer(parser, &b, NULL, 0,
&cfg_type_bindkeys, 0, &bindkeys);
if (result != ISC_R_SUCCESS)
fatal("Unable to parse built-in keys");
}
......
......@@ -323,9 +323,9 @@ named_config_parsedefaults(cfg_parser_t *parser, cfg_obj_t **conf) {
isc_buffer_init(&b, defaultconf, sizeof(defaultconf) - 1);
isc_buffer_add(&b, sizeof(defaultconf) - 1);
return (cfg_parse_buffer4(parser, &b, __FILE__, 0,
&cfg_type_namedconf,
CFG_PCTX_NODEPRECATED, conf));
return (cfg_parse_buffer(parser, &b, __FILE__, 0,
&cfg_type_namedconf,
CFG_PCTX_NODEPRECATED, conf));
}
isc_result_t
......
......@@ -2575,8 +2575,8 @@ catz_addmodzone_taskaction(isc_task_t *task, isc_event_t *event0) {
result = dns_catz_generate_zonecfg(ev->origin, ev->entry, &confbuf);
if (result == ISC_R_SUCCESS) {
cfg_parser_reset(cfg->add_parser);
result = cfg_parse_buffer3(cfg->add_parser, confbuf, "catz", 0,
&cfg_type_addzoneconf, &zoneconf);
result = cfg_parse_buffer(cfg->add_parser, confbuf, "catz", 0,
&cfg_type_addzoneconf, 0, &zoneconf);
isc_buffer_free(&confbuf);
}
/*
......@@ -7642,8 +7642,8 @@ data_to_cfg(dns_view_t *view, MDB_val *key, MDB_val *data,
CHECK(putstr(text, ";\n"));
cfg_parser_reset(named_g_addparser);
result = cfg_parse_buffer3(named_g_addparser, *text, zone_name, 0,
&cfg_type_addzoneconf, &zoneconf);
result = cfg_parse_buffer(named_g_addparser, *text, zone_name, 0,
&cfg_type_addzoneconf, 0, &zoneconf);
if (result != ISC_R_SUCCESS) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
......@@ -12727,8 +12727,8 @@ newzone_parse(named_server_t *server, char *command, dns_view_t **viewp,
isc_buffer_forward(&argbuf, 3);
cfg_parser_reset(named_g_addparser);
CHECK(cfg_parse_buffer3(named_g_addparser, &argbuf, bn, 0,
&cfg_type_addzoneconf, &zoneconf));
CHECK(cfg_parse_buffer(named_g_addparser, &argbuf, bn, 0,
&cfg_type_addzoneconf, 0, &zoneconf));
CHECK(cfg_map_get(zoneconf, "zone", &zlist));
if (!cfg_obj_islist(zlist))
CHECK(ISC_R_FAILURE);
......
......@@ -307,8 +307,8 @@ parse_parameters(filter_instance_t *inst, const char *parameters,
isc_buffer_constinit(&b, parameters, strlen(parameters));
isc_buffer_add(&b, strlen(parameters));
CHECK(cfg_parse_buffer4(parser, &b, cfg_file, cfg_line,
&cfg_type_parameters, 0, &param_obj));
CHECK(cfg_parse_buffer(parser, &b, cfg_file, cfg_line,
&cfg_type_parameters, 0, &param_obj));
CHECK(check_syntax(param_obj, cfg, mctx, lctx, actx));
......@@ -420,8 +420,8 @@ plugin_check(const char *parameters,
isc_buffer_constinit(&b, parameters, strlen(parameters));
isc_buffer_add(&b, strlen(parameters));
CHECK(cfg_parse_buffer4(parser, &b, cfg_file, cfg_line,
&cfg_type_parameters, 0, &param_obj));
CHECK(cfg_parse_buffer(parser, &b, cfg_file, cfg_line,
&cfg_type_parameters, 0, &param_obj));
CHECK(check_syntax(param_obj, cfg, mctx, lctx, actx));
......
......@@ -115,17 +115,6 @@ cfg_parse_file(cfg_parser_t *pctx, const char *file,
isc_result_t
cfg_parse_buffer(cfg_parser_t *pctx, isc_buffer_t *buffer,
const cfg_type_t *type, cfg_obj_t **ret);
isc_result_t
cfg_parse_buffer2(cfg_parser_t *pctx, isc_buffer_t *buffer,
const char *file, const cfg_type_t *type,
cfg_obj_t **ret);
isc_result_t
cfg_parse_buffer3(cfg_parser_t *pctx, isc_buffer_t *buffer,
const char *file, unsigned int line,
const cfg_type_t *type, cfg_obj_t **ret);
isc_result_t
cfg_parse_buffer4(cfg_parser_t *pctx, isc_buffer_t *buffer,
const char *file, unsigned int line,
const cfg_type_t *type, unsigned int flags,
cfg_obj_t **ret);
......
......@@ -622,32 +622,9 @@ cfg_parse_file(cfg_parser_t *pctx, const char *filename,
isc_result_t
cfg_parse_buffer(cfg_parser_t *pctx, isc_buffer_t *buffer,
const cfg_type_t *type, cfg_obj_t **ret)
{
return (cfg_parse_buffer4(pctx, buffer, NULL, 0, type, 0, ret));
}
isc_result_t
cfg_parse_buffer2(cfg_parser_t *pctx, isc_buffer_t *buffer,
const char *file, const cfg_type_t *type,
cfg_obj_t **ret)
{
return (cfg_parse_buffer4(pctx, buffer, file, 0, type, 0, ret));
}
isc_result_t
cfg_parse_buffer3(cfg_parser_t *pctx, isc_buffer_t *buffer,
const char *file, unsigned int line,
const cfg_type_t *type, cfg_obj_t **ret)
{
return (cfg_parse_buffer4(pctx, buffer, file, line, type, 0, ret));
}
isc_result_t
cfg_parse_buffer4(cfg_parser_t *pctx, isc_buffer_t *buffer,
const char *file, unsigned int line,
const cfg_type_t *type, unsigned int flags,
cfg_obj_t **ret)
const char *file, unsigned int line,
const cfg_type_t *type, unsigned int flags,
cfg_obj_t **ret)
{
isc_result_t result;
......
......@@ -118,8 +118,8 @@ parse_buffer_test(void **state) {
result = cfg_parser_create(mctx, lctx, &p1);
assert_int_equal(result, ISC_R_SUCCESS);
result = cfg_parse_buffer3(p1, &buf1, "text1", 0,
&cfg_type_namedconf, &c1);
result = cfg_parse_buffer(p1, &buf1, "text1", 0,
&cfg_type_namedconf, 0, &c1);
assert_int_equal(result, ISC_R_SUCCESS);
assert_int_equal(p1->line, 5);
......@@ -130,8 +130,8 @@ parse_buffer_test(void **state) {
result = cfg_parser_create(mctx, lctx, &p2);
assert_int_equal(result, ISC_R_SUCCESS);
result = cfg_parse_buffer3(p2, &buf2, "text2", 100,
&cfg_type_namedconf, &c2);
result = cfg_parse_buffer(p2, &buf2, "text2", 100,
&cfg_type_namedconf, 0, &c2);
assert_int_equal(result, ISC_R_SUCCESS);
assert_int_equal(p2->line, 104);
......
......@@ -67,9 +67,6 @@ cfg_parse_astring
cfg_parse_boolean
cfg_parse_bracketed_list
cfg_parse_buffer
cfg_parse_buffer2
cfg_parse_buffer3
cfg_parse_buffer4
cfg_parse_dscp
cfg_parse_enum
cfg_parse_enum_or_other
......
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