diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-08-11 18:35:16 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@nvidia.com> | 2020-12-01 18:37:14 -0500 |
| commit | f93716445925f81c5e257e276a5bcc5cd7d74afd (patch) | |
| tree | 78e32a73d1d2f058e94610b888615334c5b05768 /lib/frrlua.c | |
| parent | d473bdc7f1e65a37384acb29af568c4b12a5a207 (diff) | |
lib: remove frrlua_initialize
This was toy code used for testing purposes. Code calling Lua should be
very explicit about what is loaded into the Lua state. Also, the
allocator used is exactly the same allocator used by default w/
luaL_newstate().
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/frrlua.c')
| -rw-r--r-- | lib/frrlua.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/lib/frrlua.c b/lib/frrlua.c index 4c38e08a07..7dc8786901 100644 --- a/lib/frrlua.c +++ b/lib/frrlua.c @@ -194,38 +194,4 @@ enum frrlua_rm_status frrlua_run_rm_rule(lua_State *L, const char *rule) return status; } -/* Initialization */ - -static void *frrlua_alloc(void *ud, void *ptr, size_t osize, size_t nsize) -{ - (void)ud; - (void)osize; /* not used */ - - if (nsize == 0) { - free(ptr); - return NULL; - } else - return realloc(ptr, nsize); -} - -lua_State *frrlua_initialize(const char *file) -{ - int status; - lua_State *L = lua_newstate(frrlua_alloc, NULL); - - luaL_openlibs(L); - if (file) { - status = luaL_loadfile(L, file); - if (status) { - zlog_debug("Failure to open %s %d", file, status); - lua_close(L); - return NULL; - } - lua_pcall(L, 0, LUA_MULTRET, 0); - } - - return L; -} - - #endif |
