Add object name parsing to pa_config_parser
@tanuk
Submitted by Tanu Kaskinen Assigned to pul..@..op.org
Description
Some configuration files support the following pattern:
[SomeObjectType foo]
somekey = somevalue
[SomeObjectType bar]
somekey = someothervalue
In the above example, "SomeObjectType" identifies a type for an object, and "foo" and "bar" identify the object. Currently pa_config_parser doesn't understand anything about this, however; it just sees that there are two section with names "SomeObjectType foo" and "SomeObjectType bar". This means that parsing the object names is pushed to the code that is using pa_config_parser. The object names are parsed every time a config value assignment is done, which is redundant work, and makes the parsing more complicated, and it also prevents us from printing the line number of the section header when a missing or invalid object name is encountered.
So, pa_config_parser should be extended so that it natively understands the concept of object names in section headers, so that the users of pa_config_parser can easily fetch the object name without having to parse it themselves.