diff options
Diffstat (limited to 'main.py')
-rwxr-xr-x | main.py | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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) |