summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-10-15 09:23:57 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-10-15 09:23:57 +0000
commit297174b1e89f882f7bfd1767484f14fa863ad3a9 (patch)
tree1319556e33dd6c016ce96ad371aec93fac9fd29a
parent5179a4ebc4ef86a7302a3858a701c6dda6f59272 (diff)
downloadlua-augeas-297174b1e89f882f7bfd1767484f14fa863ad3a9.tar.bz2
lua-augeas-297174b1e89f882f7bfd1767484f14fa863ad3a9.tar.xz
implement defnode()
-rw-r--r--laugeas.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/laugeas.c b/laugeas.c
index 6246343..f1ecb2e 100644
--- a/laugeas.c
+++ b/laugeas.c
@@ -115,6 +115,15 @@ static int Paug_defvar(lua_State *L)
return pushresult(L, aug_defvar(a, name, expr), a, NULL);
}
+static int Paug_defnode(lua_State *L)
+{
+ augeas *a = Paug_checkarg(L, 1);
+ const char *name = luaL_checkstring(L, 2);
+ const char *expr = luaL_checkstring(L, 3);
+ const char *value = luaL_checkstring(L, 4);
+ return pushresult(L, aug_defnode(a, name, expr, value, NULL), a, NULL);
+}
+
static int Paug_close(lua_State *L)
{
augeas *a = Paug_checkarg(L, 1);
@@ -211,6 +220,7 @@ static int Paug_print(lua_State *L)
static const luaL_reg Paug_methods[] = {
{"init", Paug_init},
{"defvar", Paug_defvar},
+ {"defnode", Paug_defnode},
{"close", Paug_close},
{"get", Paug_get},
{"set", Paug_set},