diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2010-10-15 09:03:36 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2010-10-15 09:03:36 +0000 |
commit | 400f059ff20a0c478d3b9945d93dc4c49a80cc56 (patch) | |
tree | 044e2f2ff30159d1d231361836933ad5dacf031c /laugeas.c | |
parent | b6440d6e68d689b4dc7a91ca0e35da6c57f68591 (diff) | |
download | lua-augeas-400f059ff20a0c478d3b9945d93dc4c49a80cc56.tar.bz2 lua-augeas-400f059ff20a0c478d3b9945d93dc4c49a80cc56.tar.xz |
implement insert()
Diffstat (limited to 'laugeas.c')
-rw-r--r-- | laugeas.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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}, |