+uci_lua_list_configs(lua_State *L)
+{
+ struct uci_context *ctx;
+ char **configs = NULL;
+ char **ptr;
+ int i = 1;
+
+ ctx = find_context(L, NULL);
+ if ((uci_list_configs(ctx, &configs) != UCI_OK) || !configs)
+ return uci_push_status(L, ctx, false);
+ lua_newtable(L);
+ for (ptr = configs; *ptr; ptr++) {
+ lua_pushstring(L, *ptr);
+ lua_rawseti(L, -2, i++);
+ }
+ free(configs);
+ return 1;
+}
+
+static int