From: Felix Fietkau Date: Wed, 27 Aug 2008 15:09:50 +0000 (+0200) Subject: add get functions for savedir and confdir X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=946c51e93303ff71dd5cc44db8a1c2d1d5914625;p=uci.git add get functions for savedir and confdir --- diff --git a/lua/uci.c b/lua/uci.c index 5891562..3f8f3a5 100644 --- a/lua/uci.c +++ b/lua/uci.c @@ -631,6 +631,13 @@ done: return 1; } +static int +uci_lua_get_confdir(lua_State *L) +{ + lua_pushstring(L, ctx->confdir); + return 1; +} + static int uci_lua_set_confdir(lua_State *L) { @@ -642,6 +649,13 @@ uci_lua_set_confdir(lua_State *L) return 1; } +static int +uci_lua_get_savedir(lua_State *L) +{ + lua_pushstring(L, ctx->savedir); + return 1; +} + static int uci_lua_set_savedir(lua_State *L) { @@ -667,7 +681,9 @@ static const luaL_Reg uci[] = { { "revert", uci_lua_revert }, { "changes", uci_lua_changes }, { "foreach", uci_lua_foreach }, + { "get_confdir", uci_lua_get_confdir }, { "set_confdir", uci_lua_set_confdir }, + { "get_savedir", uci_lua_get_savedir }, { "set_savedir", uci_lua_set_savedir }, { NULL, NULL }, };