Commit 2032d4956229d9ebe277fdae26d7aed149f4aaf0
1 parent
ad94417d
fuckit
git-svn-id: http://svn.net-core.org/repos/t-engine4@1995 51575b47-30f0-44d4-a5cc-537603b46e54
Showing
3 changed files
with
20 additions
and
1 deletions
@@ -680,7 +680,7 @@ int main(int argc, char *argv[]) | @@ -680,7 +680,7 @@ int main(int argc, char *argv[]) | ||
680 | init_gen_rand(time(NULL)); | 680 | init_gen_rand(time(NULL)); |
681 | 681 | ||
682 | // Change to line buffering | 682 | // Change to line buffering |
683 | - setvbuf(stdout, (char *) NULL, _IOLBF, 0); | 683 | +// setvbuf(stdout, (char *) NULL, _IOLBF, 0); |
684 | 684 | ||
685 | // Parse arguments | 685 | // Parse arguments |
686 | int i; | 686 | int i; |
@@ -138,9 +138,24 @@ static bool basic_serialize(lua_State *L, serial_type *s, int type, int idx) | @@ -138,9 +138,24 @@ static bool basic_serialize(lua_State *L, serial_type *s, int type, int idx) | ||
138 | dump_string(s, str, len); | 138 | dump_string(s, str, len); |
139 | writeZipFixed(s, "\"", 1); | 139 | writeZipFixed(s, "\"", 1); |
140 | } else if (type == LUA_TFUNCTION) { | 140 | } else if (type == LUA_TFUNCTION) { |
141 | +/* | ||
141 | writeZipFixed(s, "loadstring(\"", 12); | 142 | writeZipFixed(s, "loadstring(\"", 12); |
142 | lua_dump(L, dump_function, s); | 143 | lua_dump(L, dump_function, s); |
143 | writeZipFixed(s, "\")", 2); | 144 | writeZipFixed(s, "\")", 2); |
145 | +*/ | ||
146 | + lua_getglobal(L, "__dump_fct"); | ||
147 | + lua_pushvalue(L, idx-1); | ||
148 | + lua_call(L, 1, 1); | ||
149 | + | ||
150 | + size_t len; | ||
151 | + const char *str = lua_tolstring(L, -1, &len); | ||
152 | + | ||
153 | + writeZipFixed(s, "loadstring(", 11); | ||
154 | + writeZipFixed(s, str, len); | ||
155 | + writeZipFixed(s, ")", 1); | ||
156 | + | ||
157 | + lua_pop(L, 1); | ||
158 | + | ||
144 | } else if (type == LUA_TTABLE) { | 159 | } else if (type == LUA_TTABLE) { |
145 | lua_pushstring(L, "__CLASSNAME"); | 160 | lua_pushstring(L, "__CLASSNAME"); |
146 | lua_rawget(L, idx - 1); | 161 | lua_rawget(L, idx - 1); |
-
Please register or login to post a comment