"Sarel J. Botha" wrote: > [ Can everyone please subscribe to debian-admintool? My To: field is > looking rather silly :) ] I am subscribed I think... > I'm very happy with the parser. Just need to add some error-checking. > > The interface changed a small bit, as it parses demand{} as well now. Check > net.conf for details. > > parse_file() returns a pointer to a t_netconf which looks like this: > struct t_netconf { > t_provider *demand; > t_scheme *schemes; > } > > So, after tree = parse_file ("blah"); > demand is a pointer to a linked list of "t_provider"s and schemes is a > pointer to a linked list of "t_schemes". Check parser.h for details. > > I implemented the options as a linked list as well. use getopt() and > setopt() to manipulate options. > > That's how it currently works. Any suggestions? I looked a bit at it and for what I see, excellent work. Thanks for the help with this. > Can everyone please play with 'test' and try to make it segfault. I am quite busy at the university for the next 3 weeks. It's the same every semester: for 4 months nothing, and all exams in the last 2 weeks. Sigh.... But after that, I will be happy to work on the first version of our little project (doing the same as Anthony's current version, but ported to C++ and using the simple interface for gathering configuration data - so maybe sometime we can switch to Wichert's configuration management system). Then we should think about enhancements - support for complex (source-based) routing tables comes instantly to my mind....
> Known bug: > If a word is longer than 80 chars it'll segfault. > How should I handle this? Just produce a warning or return NULL and an > error string? I would say that cutting a string could make something bad happen - return NULL. greets, Rene