2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

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.
This commit is contained in:
Evan Hunt
2019-01-21 20:03:45 -08:00
parent 57dedab3f3
commit cf072d659e
8 changed files with 22 additions and 59 deletions

View File

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

View File

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

View File

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

View File

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