forked from Fierelier/me.fier.engine
Add function blacklist
This commit is contained in:
parent
c6244ae65f
commit
88b6772a14
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user