confuse-devel
[Top][All Lists]
Advanced

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

Re: [Confuse-devel] Wondering a solution of multi configuration file wit


From: Martin Hedenfalk
Subject: Re: [Confuse-devel] Wondering a solution of multi configuration file with same schema. Please help.
Date: Fri, 21 May 2004 13:43:31 +0200

Hello,

This is because libconfuse uses the options passed to cfg_init to store the parsed values. Since both acfg and bcfg share the same options schema, the values are stored in the same structure.

This is obviously a bug in libconfuse. I'm working on a fix. Basically the options schema is now duplicated, so each instance created with cfg_init() gets its own dynamically allocated schema to work with. There are some deallocation issues to fix first.

thanks
/martin

2004-05-20 kl. 13.41 skrev pythonstudy:

Here's the situation.

It got several configuration files in an application with same schema.
Each configuration file instruct a serious of actions the program has to
finish.

But I find it's impossible to make a list of parse results to the files.
The program simply add all results in one cfg_t.

For example,

File 1:

sec "1" {
 a = 1
 b = 2
}

File 2:

sec "4" {
 a = 5
 b = 6
}

acfg = cfg_init( schema, 0 );
cfg_parse( file1 );
bcfg = cfg_init( schema, 0 );
cfg_parse( file2 );

then acfg and bcfg both have two secions, "1" and "4"

However, acfg and bcfg are different pointers.

What should I do to resolve the problem?



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





reply via email to

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