Hello,
I have been working on an interface to modify configuration file (yes
alternative to augeas) as promised.
INI supports multi valued keys so the interface needs to be able to
manage duplicates.
The attached header file contains the prototype of the interface.
I have implemented value management and about to do the section
management. That part would be quite simple.
Before I polish everything up, hook together and start sending patches I
wanted to make sure the interface is OK and is not missing anything.
I was not sure how much of the design page is needed.
I will probably create one based on this thread with a pointer to header
file.
The assumption is that:
- the caller will read an existing configuration object from a file or
create a configuration object himself. These calls are alreadyavailable
for some time.
- the caller will then add/updated/delete the configuration object as he
sees fit. This is this interface.
- the caller then will call already existing serialization function that
will return a simple buffer object that will contain a serialized
configuration ready to be stored in a file.
- the caller can use simple buffer methods to write content of the
buffer to a file descriptor or just create a file (FILE *), get the
serialized buffer and write to that file. It is up to the caller and
there is so far no plan to provide a specific "save function" as it is
unclear what would be a good function to have.
Let me know if any of these assumptions wrong.
Please take a look at the file, it has doxygen comments. It is a sanity
check exercise not a thorough review :-).
The comments refer to collection interface so I included it too for
easier reading.
--
Thank you,
Dmitri Pal
Sr. Engineering Manager IdM portfolio
Red Hat, Inc.