From c52fb20b8480dad6d51ceaf215e8428062aa4541 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Sun, 20 Jan 2019 13:00:15 +0330 Subject: update --- main.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'main.py') diff --git a/main.py b/main.py index 90e239c..da982b9 100755 --- a/main.py +++ b/main.py @@ -184,6 +184,7 @@ class Argparser(object): parser.add_argument("--singlefile", action="store_true", help="the generated code will be put in a single file", default=False) parser.add_argument("--calloc", action="store_true", help="use calloc instead of malloc, defaults to false", default=False) parser.add_argument("--luaalloc", action="store_true", help="use calloc instead of malloc, defaults to false", default=False) + parser.add_argument("--luaheaders", type=str, help="the location of lua header files that need to get added to the lib files if luaalloc has been selected", default="") parser.add_argument("--singlefilename", type=str, help="name of the single file") self.args = parser.parse_args() if self.args.calloc and self.args.luaalloc: print("you have selected both calloc and lua_newuserdata. that can't possibly work.\n") @@ -282,6 +283,8 @@ class CodeGen(object): read_source.write("\n// automatically generated by faultrieber\n") read_source.write("// " + self.dnt + "\n\n") read_source.write(text.header_list) + if self.argparser.args.luaalloc: + read_source.write('#include "'+self.argparser.args.luaheaders+'"\n') read_source.write('#include "./read.h"\n') read_source.write('#include "./structs.h"\n\n') if self.argparser.args.calloc: read_source.write(text.ft_calloc_def) -- cgit v1.2.3