summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/frrscript.c4
-rw-r--r--lib/frrscript.h5
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/frrscript.c b/lib/frrscript.c
index 9b27ca745..246ae25fd 100644
--- a/lib/frrscript.c
+++ b/lib/frrscript.c
@@ -30,7 +30,7 @@
struct encoder {
char *typename;
- int (*encoder)(struct lua_State *, const void *);
+ encoder_func encoder;
};
struct hash *encoder_hash;
@@ -82,7 +82,7 @@ int frrscript_lua_call(struct frrscript *fs, ...)
}
void frrscript_register_type_encoder(const char *typename,
- int (*encoder)(lua_State *L, void *))
+ encoder_func encoder)
{
struct encoder e = {
.typename = (char *) typename,
diff --git a/lib/frrscript.h b/lib/frrscript.h
index 2988d90aa..6891200de 100644
--- a/lib/frrscript.h
+++ b/lib/frrscript.h
@@ -27,6 +27,8 @@ extern "C" {
#define FRRSCRIPT_PATH "/etc/frr/scripts"
+typedef int (*encoder_func)(struct lua_State *, const void *);
+
struct frrscript {
/* Script name */
char *name;
@@ -59,8 +61,7 @@ void frrscript_unload(struct frrscript *fs);
* associated with the chosen 'tname' to the provided stack.
*
*/
-void frrscript_register_type_encoder(const char *tname,
- int (*encoder)(lua_State *, void *));
+void frrscript_register_type_encoder(const char *tname, encoder_func encoder);
/*
* Initialize scripting subsystem. Call this before anything else.