[Nagiosplug-devel] RFC: Plugins config file (final proposal)

sean finney seanius at seanius.net
Mon Feb 5 15:49:12 CET 2007


On Mon, 2007-02-05 at 14:23 +0000, Ton Voon wrote:
> Can I suggest that we start with using an existing library first - I  
> would choose http://ndevilla.free.fr/iniparser/html/index.html from  
> http://en.wikipedia.org/wiki/INI_file for the C implementation. Once  
> we have it integrated, we'd understand better the positives and  
> negatives. As Sean points out, an iniparser_getdict() to return a  
> list of keywords for a section would be a worthwhile enhancement to  
> that library - this could be something that we contribute back  
> upstream. If we find further down in the development cycle that this  
> library is not sufficient, hopefully there would be a precise list of  
> what features it lacks.

more to the point, the above library not really usable *unless* it has
some kind of iterator like that (or better an iterator over a the
matching subset).  the only other option would be to pass the long_opts
struct to the ini-file-parsing function, and have it specifically look
for all keys in --long-opts.

however, over the weekend i started hacking out a bit of code for the
ini parsing...  perhaps it was a bit premature to do so given what
you've said,  but it does mean the wheel is already half-re-invented.
with comments and natural use of whitespace it's currently 178 LoC, and
would probably be less than 2x that to finish it.  the iniparser LoC is
an order of magnitude larger (~2000 just for the src dir), fwiw  :)


	sean
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
URL: <http://nagios-plugins.org/archive/devel/attachments/20070205/668f9c66/attachment.sig>


More information about the Devel mailing list