Add an option under a specific section using UCI's C API
问题 How can I add a NEW option under a specific section in an UCI config file? I would like to achieve that programmatically using the C API. Can someone put an example here ? 回答1: #include <uci.h> #include <stdio.h> int main() { uci_context* ctx = uci_alloc_context(); if (!ctx) { printf("failed to alloc uci ctx\n"); return 1; } uci_ptr config; char section_name[] = "your_package.your_section"; if (uci_lookup_ptr(ctx, &config, section_name, true) != UCI_OK || !config.s) { printf("failed to find