conf-parser: distinguish between multiple sections with the same name
Pass on the line on which a section was decleared to the parsers, so they can distinguish between multiple sections (if they chose to). Currently no parsers take advantage of this, but a follow-up patch will do that to distinguish [Address] Address=192.168.0.1/24 Label=one [Address] Address=192.168.0.2/24 Label=two from [Address] Address=192.168.0.1/24 Label=one Address=192.168.0.2/24 Label=two
This commit is contained in:
@@ -115,6 +115,7 @@ int config_parse_address(const char *unit,
|
||||
const char *filename,
|
||||
unsigned line,
|
||||
const char *section,
|
||||
unsigned section_line,
|
||||
const char *lvalue,
|
||||
int ltype,
|
||||
const char *rvalue,
|
||||
|
||||
@@ -100,6 +100,7 @@ int config_parse_gateway(const char *unit,
|
||||
const char *filename,
|
||||
unsigned line,
|
||||
const char *section,
|
||||
unsigned section_line,
|
||||
const char *lvalue,
|
||||
int ltype,
|
||||
const char *rvalue,
|
||||
|
||||
@@ -164,8 +164,8 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(Route*, route_free);
|
||||
#define _cleanup_route_free_ _cleanup_(route_freep)
|
||||
|
||||
int config_parse_gateway(const char *unit, const char *filename, unsigned line,
|
||||
const char *section, const char *lvalue, int ltype,
|
||||
const char *rvalue, void *data, void *userdata);
|
||||
const char *section, unsigned section_line, const char *lvalue,
|
||||
int ltype, const char *rvalue, void *data, void *userdata);
|
||||
|
||||
/* Address */
|
||||
int address_new(Network *network, Address **ret);
|
||||
@@ -176,8 +176,8 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(Address*, address_free);
|
||||
#define _cleanup_address_free_ _cleanup_(address_freep)
|
||||
|
||||
int config_parse_address(const char *unit, const char *filename, unsigned line,
|
||||
const char *section, const char *lvalue, int ltype,
|
||||
const char *rvalue, void *data, void *userdata);
|
||||
const char *section, unsigned section_line, const char *lvalue,
|
||||
int ltype, const char *rvalue, void *data, void *userdata);
|
||||
|
||||
/* Link */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user