From 3722d534650099faeb8dae0bb1900a0738db0a78 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Sun, 20 Jan 2019 12:40:13 +0330 Subject: added the luaalloc option, needs testing. will do that on the bruiser side --- text.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'text.py') diff --git a/text.py b/text.py index 109e8fd..dc80870 100644 --- a/text.py +++ b/text.py @@ -11,10 +11,10 @@ class text(): autogen_warning = "// automatically generated by faultreiber\n" last_comment = "// last line intentionally left blank\n\n" read_func_sig = "int read_structured_file(char* path)" - c_read_elem_sig = "void* ft_read_YYY(int _fd, XXX** dummy, void*** void_train, uint64_t* current_void_size, uint64_t* current_void_count) {\n" - c_read_elem_sig_h = "void* ft_read_YYY(int _fd, XXX** dummy, void*** void_train, uint64_t* current_void_size, uint64_t* current_void_count);\n" - c_read_elem_sig_c = "void* ft_read_YYY_c(int _fd, XXX** dummy, void*** void_train, uint64_t* current_void_size, uint64_t* current_void_count, uint64_t* agg_b_count) {\n" - c_read_elem_sig_h_c = "void* ft_read_YYY_c(int _fd, XXX** dummy, void*** void_train, uint64_t* current_void_size, uint64_t* current_void_count, uint64_t* agg_b_count);\n" + c_read_elem_sig = "void* ft_read_YYY(int _fd, XXX** dummy, void*** void_train, uint64_t* current_void_size, uint64_t* current_void_count ZZZ) {\n" + c_read_elem_sig_h = "void* ft_read_YYY(int _fd, XXX** dummy, void*** void_train, uint64_t* current_void_size, uint64_t* current_void_count ZZZ);\n" + c_read_elem_sig_c = "void* ft_read_YYY_c(int _fd, XXX** dummy, void*** void_train, uint64_t* current_void_size, uint64_t* current_void_count, uint64_t* agg_b_count ZZZ) {\n" + c_read_elem_sig_h_c = "void* ft_read_YYY_c(int _fd, XXX** dummy, void*** void_train, uint64_t* current_void_size, uint64_t* current_void_count, uint64_t* agg_b_count ZZZ);\n" #c_read_elem_sig_1 = "ft_read_XXX(_fd)" c_read_elem_sig_2 = "ft_read_XXX(_fd, YYY, ZZZ, current_void_size, current_void_count)" c_read_elem_sig_2_c = "ft_read_XXX_c(_fd, YYY, ZZZ, current_void_size, current_void_count, &agg_b_count)" @@ -131,3 +131,11 @@ void void_manager(void* ptr, void*** void_train, uint64_t* current_void_size, ui c_reserve_void_ptr = "malloc(XXX)" ft_calloc_def="#define ft_calloc(X1) calloc(X1, 1)\n" + ft_luanewuserdata_def="#define ft_luanewuserdata(X1) lua_newuserdata(__ls, X1)\n" + lua_udata_regindex = ''' + luaL_getmetatable(__ls, "XXX"); + lua_setmetatable(__ls, -2); + lua_pushlightuserdata(__ls, YYY); + lua_pushvalue(__ls, -2); + lua_settable(__ls, LUA_REGISTRYINDEX); + ''' -- cgit v1.2.3