summaryrefslogtreecommitdiffstats
path: root/laugeas.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-10-15 09:03:36 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-10-15 09:03:36 +0000
commit400f059ff20a0c478d3b9945d93dc4c49a80cc56 (patch)
tree044e2f2ff30159d1d231361836933ad5dacf031c /laugeas.c
parentb6440d6e68d689b4dc7a91ca0e35da6c57f68591 (diff)
downloadlua-augeas-400f059ff20a0c478d3b9945d93dc4c49a80cc56.tar.bz2
lua-augeas-400f059ff20a0c478d3b9945d93dc4c49a80cc56.tar.xz
implement insert()
Diffstat (limited to 'laugeas.c')
-rw-r--r--laugeas.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/laugeas.c b/laugeas.c
index fd77d73..73d5bf8 100644
--- a/laugeas.c
+++ b/laugeas.c
@@ -152,6 +152,15 @@ static int Paug_setm(lua_State *L)
return pushresult(L, aug_setm(a, base, sub, value), a, NULL);
}
+static int Paug_insert(lua_State *L)
+{
+ augeas *a = Paug_checkarg(L, 1);
+ const char *path = luaL_checkstring(L, 2);
+ const char *label = luaL_checkstring(L, 3);
+ int before = lua_toboolean(L, 4);
+ return pushresult(L, aug_insert(a, path, label, before), a, path);
+}
+
static int Paug_rm(lua_State *L)
{
augeas *a = Paug_checkarg(L, 1);
@@ -189,6 +198,7 @@ static const luaL_reg Paug_methods[] = {
{"get", Paug_get},
{"set", Paug_set},
{"setm", Paug_setm},
+ {"insert", Paug_insert},
{"rm", Paug_rm},
{"save", Paug_save},
{"load", Paug_load},