How to delete section from UCI package with struct uci_section pointer?

Viewed 28

I'm iterating package sections and I want to delete one of them:

struct uci_package * pkg;
struct uci_context * ctx;

//...

struct uci_element *elem;
uci_foreach_element(&(pkg->sections), elem)
{
        struct uci_section *section = uci_to_section(elem);
        if(!section)
            continue;
        if(match_foo(ctx, section))
        {
            //TODO uci_delete
            break;
        }
}

//...

but uci_delete input argument is struct uci_ptr which can be created only from parsing cli string (there is no conversion function from struct uci_section to struct uci_ptr).

How to delete section without playing with cli strings?

0 Answers
Related