]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: Add lua noop decoder
authorDonald Lee <dlqs@gmx.com>
Sun, 20 Jun 2021 00:06:16 +0000 (08:06 +0800)
committerDonald Lee <dlqs@gmx.com>
Mon, 21 Jun 2021 21:03:12 +0000 (05:03 +0800)
Use this noop decoder for const values (since we can't mutate a const
value passed into frrscript_call anyways) or values we don't want to
write a decoder for.

Signed-off-by: Donald Lee <dlqs@gmx.com>
lib/frrlua.c
lib/frrlua.h

index 9fb744cde21f693b0e55aa9c0a51528d1e36b446..d6a0ef328e57ef92f30a4c6bdb6ca5a44a3027b0 100644 (file)
@@ -290,6 +290,10 @@ void *lua_tostringp(lua_State *L, int idx)
        return string;
 }
 
+void lua_decode_noop(lua_State *L, int idx, const void *ptr)
+{
+}
+
 /*
  * Logging.
  *
index 3ca5b1f778fb6c6593ad962ad24545115bc66bb9..c4de82740c3c709bc321ef37c64c76e618cd4149 100644 (file)
@@ -161,6 +161,11 @@ void lua_decode_stringp(lua_State *L, int idx, char *str);
  */
 void *lua_tostringp(lua_State *L, int idx);
 
+/*
+ * No-op decocder
+ */
+void lua_decode_noop(lua_State *L, int idx, const void *ptr);
+
 /*
  * Retrieve an integer from table on the top of the stack.
  *