confuse-devel
[Top][All Lists]
Advanced

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

Re: [Confuse-devel] Removing strings from a list


From: Martin Hedenfalk
Subject: Re: [Confuse-devel] Removing strings from a list
Date: Wed, 12 Jan 2005 10:07:11 +0100
User-agent: Mozilla Thunderbird 0.8 (X11/20041012)

Hello,

There is no such function. It is sort of outside the scope of libConfuse, since it is not intended to be a generic data structure. If you want to further manipulate the data returned by libConfuse you'll have to use other functions for that.

For example, if you use GLib:

int i;
GList *trusted = 0;
for(i = 0; i < cfg_size(cfg, "Trusted"); i++)
   trusted = g_list_append(trusted, g_strdup(cfg_getnstr(cfg, i)));

Otherwise you'll have to write your own function for removing list elements, but then you depend on the internals of libConfuse, which is not recommended.

HTH
/martin

Arainty, Bernardo wrote:
Hello there,

I'm using 'libconfuse' to handle a configuration file.
In this file I have a list of trusted hosts ( e.g.: Trusted={ "10.77.82.10",
"10.77.82.30" } ) that I need to update periodically. I need to add hosts
and remove hosts as well.

I didn't find any libconfuse function to remove strings from a list. How do
you suggest this operation can be done?

Thanks.


Bernardo Arainty
Networking & Security



_______________________________________________
Confuse-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/confuse-devel




reply via email to

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