From 400f059ff20a0c478d3b9945d93dc4c49a80cc56 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 15 Oct 2010 09:03:36 +0000 Subject: implement insert() --- laugeas.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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}, -- cgit v1.2.3