]> pilppa.org Git - uci.git/commitdiff
lua: add uci.add_history to the api
authorFelix Fietkau <nbd@openwrt.org>
Sat, 15 Nov 2008 11:55:33 +0000 (12:55 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 15 Nov 2008 11:55:33 +0000 (12:55 +0100)
lua/uci.c

index d9d4ec6d8dce7a6a0712ecc807df018e74997065..bdac3f6f5c13dd9892f5315bf9d7659fc23dd9c0 100644 (file)
--- a/lua/uci.c
+++ b/lua/uci.c
@@ -691,6 +691,18 @@ uci_lua_get_savedir(lua_State *L)
        return 1;
 }
 
+static int
+uci_lua_add_history(lua_State *L)
+{
+       struct uci_context *ctx;
+       int ret, offset = 0;
+
+       ctx = find_context(L, &offset);
+       luaL_checkstring(L, 1 + offset);
+       ret = uci_add_history_path(ctx, lua_tostring(L, -1));
+       return uci_push_status(L, ctx, false);
+}
+
 static int
 uci_lua_set_savedir(lua_State *L)
 {
@@ -756,6 +768,7 @@ static const luaL_Reg uci[] = {
        { "revert", uci_lua_revert },
        { "changes", uci_lua_changes },
        { "foreach", uci_lua_foreach },
+       { "add_history", uci_lua_add_history },
        { "get_confdir", uci_lua_get_confdir },
        { "set_confdir", uci_lua_set_confdir },
        { "get_savedir", uci_lua_get_savedir },