From 88b6772a142892b2f95cd5c4fe370feff5f8a4ef Mon Sep 17 00:00:00 2001 From: Fierelier Date: Sun, 14 May 2023 22:20:15 +0200 Subject: [PATCH] Add function blacklist --- lua_translate | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua_translate b/lua_translate index a0334f0..7e08726 100755 --- a/lua_translate +++ b/lua_translate @@ -16,6 +16,10 @@ typesOut = { "char *": "lua_pushstring" } +functionBlacklist = [ + "engine_malloc" +] + functions = toml.loads(open("modules/engine/FUNCTIONS.toml").read()) ofile = open("modules/engine/addon/lua.c","w") @@ -28,6 +32,7 @@ lua_State * engine_lua_state; ''') for func in functions: + if func in functionBlacklist: continue invarCount = 1 funcnew = "engine_luaf_" +func.replace("engine_","",1) ofile.write('int ' +funcnew+ '(lua_State *L) {\n') @@ -70,6 +75,7 @@ void engine_luaInit() { ''') for func in functions: + if func in functionBlacklist: continue funcnew = "engine_luaf_" +func.replace("engine_","",1) ofile.write('\tlua_pushcfunction(engine_lua_state,' +funcnew+ ');\n') ofile.write('\tlua_setglobal (engine_lua_state,"' +func+ '");\n')