+static int uci_create_named_section(struct uci_context *ctx, const char *conf_file_name, const char *section_type, const char *section_name)
+{
+ struct uci_ptr ptr;
+ int ret_val;
+ char *cmd_data;
+ int len;
+
+ ret_val = -1;
+ if ((ctx != NULL) &&
+ (conf_file_name != NULL) &&
+ (section_type != NULL) &&
+ (section_name != NULL)) {
+ len = strlen(conf_file_name);
+ len = len + 1;
+ len = len + strlen(section_type);
+ len = len + 1;
+ len = len + strlen(section_name);
+ len = len + 1;
+ cmd_data = malloc(len);
+ snprintf(cmd_data, len, "%s.%s=%s", conf_file_name, section_name, section_type);
+ if (uci_lookup_ptr(ctx, &ptr, cmd_data, true) == UCI_OK) {
+ ret_val = uci_set(ctx, &ptr);
+ if (ret_val == UCI_OK) {
+ //ret_val = uci_save(ctx, ptr.p);
+ }
+ }
+ }
+ return ret_val;
+}
+