summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-10-15 09:57:28 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-10-15 09:57:28 +0000
commitf8177d23ffc1e3fa3f66770eb2720a1143d051fe (patch)
tree30905c8a9be6b8ec14cb6475ac6d97d8329f03b3
parent6cf12867f2d5e078d9a988607315a8257380d8ba (diff)
downloadlua-augeas-f8177d23ffc1e3fa3f66770eb2720a1143d051fe.tar.bz2
lua-augeas-f8177d23ffc1e3fa3f66770eb2720a1143d051fe.tar.xz
implement error* functions
Implement the following: error() error_message() error_minor_message() error_detalils()
-rw-r--r--laugeas.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/laugeas.c b/laugeas.c
index 1962a66..8e0a593 100644
--- a/laugeas.c
+++ b/laugeas.c
@@ -248,6 +248,34 @@ static int Paug_print(lua_State *L)
return pushresult(L, aug_print(a, f, path), a, path);
}
+static int Paug_error(lua_State *L)
+{
+ augeas *a = Paug_checkarg(L, 1);
+ lua_pushinteger(L, aug_error(a));
+ return 1;
+}
+
+static int Paug_error_message(lua_State *L)
+{
+ augeas *a = Paug_checkarg(L, 1);
+ lua_pushstring(L, aug_error_message(a));
+ return 1;
+}
+
+static int Paug_error_minor_message(lua_State *L)
+{
+ augeas *a = Paug_checkarg(L, 1);
+ lua_pushstring(L, aug_error_minor_message(a));
+ return 1;
+}
+
+static int Paug_error_details(lua_State *L)
+{
+ augeas *a = Paug_checkarg(L, 1);
+ lua_pushstring(L, aug_error_details(a));
+ return 1;
+}
+
static const luaL_reg Paug_methods[] = {
{"init", Paug_init},
{"defvar", Paug_defvar},
@@ -264,6 +292,10 @@ static const luaL_reg Paug_methods[] = {
{"save", Paug_save},
{"load", Paug_load},
{"print", Paug_print},
+ {"error", Paug_error},
+ {"error_message", Paug_error_message},
+ {"error_minor_message", Paug_error_minor_message},
+ {"error_details", Paug_error_details},
{NULL, NULL}
};