summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2008-11-15 12:55:33 +0100
committerFelix Fietkau <nbd@openwrt.org>2008-11-15 12:55:33 +0100
commit740ed93a529b0a8d9dc8a21f7d6fbac65295f4a3 (patch)
tree701698e1ab080b272ca927349be944a18be6ec72
parentd788264ddc370ffb5f9fe1f451ac6845da0dfda0 (diff)
downloaduci-740ed93a529b0a8d9dc8a21f7d6fbac65295f4a3.tar.gz
lua: add uci.add_history to the api
-rw-r--r--lua/uci.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lua/uci.c b/lua/uci.c
index d9d4ec6..bdac3f6 100644
--- a/lua/uci.c
+++ b/lua/uci.c
@@ -692,6 +692,18 @@ uci_lua_get_savedir(lua_State *L)
}
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)
{
struct uci_context *ctx;
@@ -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 },