From 7e058da5bc23555d8dca571f7ee10b4cc171dd8c Mon Sep 17 00:00:00 2001 From: Donald Lee Date: Sun, 20 Jun 2021 08:06:16 +0800 Subject: [PATCH] lib: Add lua noop decoder 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 --- lib/frrlua.c | 4 ++++ lib/frrlua.h | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/lib/frrlua.c b/lib/frrlua.c index 9fb744cde2..d6a0ef328e 100644 --- a/lib/frrlua.c +++ b/lib/frrlua.c @@ -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. * diff --git a/lib/frrlua.h b/lib/frrlua.h index 3ca5b1f778..c4de82740c 100644 --- a/lib/frrlua.h +++ b/lib/frrlua.h @@ -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. * -- 2.39.5