summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Bannister <kbee0916@earthlink.net>2012-09-19 16:42:19 -0400
committerNatanael Copa <ncopa@alpinelinux.org>2012-09-20 11:13:36 +0200
commit209b2f995e54088881b492e22a9336dbc475537c (patch)
tree4e07df4085b50e8d1f9e5b3863b4ce681ac32e42
parent89015b4ac16feae4f71f443b70c91a263e9946d3 (diff)
downloadlua-augeas-209b2f995e54088881b492e22a9336dbc475537c.tar.bz2
lua-augeas-209b2f995e54088881b492e22a9336dbc475537c.tar.xz
Initial commit for lunadoc interface documentation.
-rw-r--r--Makefile4
-rw-r--r--laugeas.c60
2 files changed, 64 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index f53b7f6..a3cacb8 100644
--- a/Makefile
+++ b/Makefile
@@ -36,8 +36,12 @@ laugeas.o: CFLAGS+=$(AUGEAS_CFLAGS)
augeas.so: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ -fPIC -shared $^ $(LIBS)
+doc : laugeas.c
+ lunadoc -d ./doc *.c
+
clean:
rm -f augeas.so $(OBJS)
+ rm -rf doc
install: augeas.so
install -D augeas.so $(DESTDIR)$(INSTALL_CMOD)/augeas.so
diff --git a/laugeas.c b/laugeas.c
index 68606b2..1133c27 100644
--- a/laugeas.c
+++ b/laugeas.c
@@ -1,3 +1,9 @@
+/*
+--- Lua wrapper for Augeas library.
+--
+-- In general, the functions map straight to the C library. See the
+-- descriptions below for details.
+ */
#include <stdlib.h>
#include <lua.h>
@@ -281,20 +287,74 @@ static int Paug_error_details(lua_State *L)
}
static const luaL_reg Paug_methods[] = {
+/*
+--- Initializes the library.
+--
+-- * `params` Table of initialization parameters; all optional. `root` path to
+-- Augeas, `loadpath` to Augeas lenses, and string/boolean pairs for the
+-- flags in the Taug_flagmap array.
+-- * `[return]` augeas object, used as first parameter in subsequent function
+-- calls
+function init(params)
+ */
{"init", Paug_init},
{"defvar", Paug_defvar},
{"defnode", Paug_defnode},
+/*
+--- Closes the library. Optional; automatically called by garbage collector.
+--
+-- * `augobj` Augeas object from init()
+function close(augobj)
+ */
{"close", Paug_close},
+/*
+--- Gets the value for an Augeas path.
+--
+-- * `augobj` Augeas object from init()
+-- * `path` Augeas path
+-- * `[return]` Value for path
+function get(augobj, path)
+ */
{"get", Paug_get},
+/*
+--- Sets the value for an Augeas path.
+--
+-- * `augobj` Augeas object from init()
+-- * `path` Augeas path
+-- * `value` Value for path
+function set(augobj, path, value)
+ */
{"set", Paug_set},
{"setm", Paug_setm},
{"insert", Paug_insert},
{"rm", Paug_rm},
{"mv", Paug_mv},
{"matches", Paug_matches},
+/*
+--- Collects paths in the Augeas tree.
+--
+-- * `augobj` Augeas object from init()
+-- * `path` Source path to be matched
+-- * `[return]` Array of matching paths
+function match(augobj, path)
+ */
{"match", Paug_match},
{"save", Paug_save},
+/*
+--- Loads the values for the Augeas tree.
+--
+-- * `augobj` Augeas object from init()
+function load(augobj)
+ */
{"load", Paug_load},
+/*
+--- Prints the value(s) for an Augeas path.
+--
+-- * `augobj` Augeas object from init()
+-- * `path` Augeas path
+-- * `file_handle` *optional* open file for output; otherwise uses stdout
+function print(augobj, path, file_handle)
+ */
{"print", Paug_print},
{"error", Paug_error},
{"error_message", Paug_error_message},