[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Confuse-devel] Adding a section programmatically?
From: |
Kelan Champagne |
Subject: |
Re: [Confuse-devel] Adding a section programmatically? |
Date: |
Wed, 9 Nov 2011 23:49:43 -0800 |
On Wed, Nov 9, 2011 at 1:07 PM, Kelan Champagne
<address@hidden> wrote:
> I was able to add that function myself (by following the example of the other
> cfg_set*() functions -- so I actually added cfg_setsec(), cfg_setnsec(), and
> cfg_opt_setnsec()), but my implementation only works when adding a single
> section. If you try to to pass an index aside from 0, it hits the assert at
> the top of cfg_opt_getval(), because my repeatable section has the CFGF_MULTI
> flag set (which applies to sections only) and not the CFGF_LIST flag, which
> that assert is expecting.
>
> I attached my patch (based on the v2.7 downloadable source).
I figured out a better approach that adds sections in (what I think is) a more
correct way. It allows me to add multiple sections programmatically (which was
the basic functionality that I needed, and wasn't working in my previous
patch). I have attached the updated patch.
I'm still curious to know if there is already a way to do this, or maybe if
this patch would be useful to others.
Thanks,
-Kelan
updated_libConfuse_sections.patch
Description: Binary data