summaryrefslogtreecommitdiff
path: root/lib/frrscript.h
diff options
context:
space:
mode:
authorDonald Lee <dlqs@gmx.com>2021-06-25 00:05:37 +0800
committerDonald Lee <dlqs@gmx.com>2021-06-25 17:29:15 +0800
commit19eee398d4f25af835837894b276e2a1796a98f5 (patch)
tree52427d36b5a784d89140e70094b116b20e025fdd /lib/frrscript.h
parent951f0849761f39dc5e60612b493612c3cf6de568 (diff)
lib: add comments for functions
Signed-off-by: Donald Lee <dlqs@gmx.com>
Diffstat (limited to 'lib/frrscript.h')
-rw-r--r--lib/frrscript.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/frrscript.h b/lib/frrscript.h
index 502921539a..8612c602f3 100644
--- a/lib/frrscript.h
+++ b/lib/frrscript.h
@@ -109,6 +109,15 @@ void frrscript_init(const char *scriptdir);
DECODE_ARGS_WITH_STATE(L, value); \
} while (0)
+/*
+ * Maps the type of value to its encoder/decoder.
+ * Add new mappings here.
+ *
+ * L
+ * Lua state
+ * scriptdir
+ * Directory in which to look for scripts
+ */
#define ENCODE_ARGS_WITH_STATE(L, value) \
_Generic((value), \
long long * : lua_pushintegerp, \
@@ -145,14 +154,21 @@ const struct prefix * : lua_decode_noop \
* fs
* The script to call; this is obtained from frrscript_load().
*
- * env
- * The script's environment. Specify this as an array of frrscript_env.
- *
* Returns:
* 0 if the script ran successfully, nonzero otherwise.
*/
int _frrscript_call(struct frrscript *fs);
+/*
+ * Wrapper for call script. Maps values passed in to their encoder
+ * and decoder types.
+ *
+ * fs
+ * The script to call; this is obtained from frrscript_load().
+ *
+ * Returns:
+ * 0 if the script ran successfully, nonzero otherwise.
+ */
#define frrscript_call(fs, ...) \
({ \
lua_State *L = fs->L; \