confuse-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CFG_XXX_LIST_CB() [Was: Re: [Confuse-devel] libconfuse help (several que


From: Ademar de Souza Reis Jr.
Subject: CFG_XXX_LIST_CB() [Was: Re: [Confuse-devel] libconfuse help (several questions)]
Date: Mon, 28 Apr 2003 23:53:45 -0300
User-agent: Mutt/1.5.4i

On Mon, Apr 28, 2003 at 09:47:19AM +0200, Martin Hedenfalk wrote:
> > 2. Is there a callback for values different than int? The docs/example
> > mention the callback to set int values (CFG_INT_CB), but what I need
> > is a callback to parse string values.
> > Ex.: I have statements like:
> > 
> > foobar {
> >     fake_mac_address = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01}
> >     fake_dest_ip_addr = "192.168.1.200"
> > }
> > 
> > And I would like to set a callback to check if the values have valid
> > syntax and are inside the valid range.
> 
> Yes, there and CFG_STR_CB, and CFG_XXX_CB for all other supported types.
> They work in the same way as the int example.

Ok, I don't know why I haven't found them before :)

But I have a question regarding "CFG_INT_LIST_CB": Do I have to mess with
all internal libconfuse structures to fill "void *result"? In STR_CB and
INT_CB it's easy, but I have no idea about what to do when parsing a list.

I like a list because it really easies my work when parsing an ethernet
mac address, but if I have to parse it manually before it turns into a list,
then there's no point in using a list... What am I missing here? :)

Thanks.

-- 
Ademar de Souza Reis Jr. <address@hidden>
http://www.ademar.org

^[:wq!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]