diff options
Diffstat (limited to 'lbaselib.c')
-rw-r--r-- | lbaselib.c | 22 |
1 files changed, 1 insertions, 21 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbaselib.c,v 1.108 2002/11/18 11:20:01 roberto Exp roberto $ | 2 | ** $Id: lbaselib.c,v 1.109 2002/11/22 18:01:46 roberto Exp roberto $ |
3 | ** Basic library | 3 | ** Basic library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -256,25 +256,6 @@ static int luaB_loadstring (lua_State *L) { | |||
256 | } | 256 | } |
257 | 257 | ||
258 | 258 | ||
259 | static int writer (lua_State *L, const void* b, size_t size, void* B) { | ||
260 | (void)L; | ||
261 | luaL_addlstring((luaL_Buffer*) B, (const char *)b, size); | ||
262 | return 1; | ||
263 | } | ||
264 | |||
265 | |||
266 | static int luaB_stringdump (lua_State *L) { | ||
267 | luaL_Buffer b; | ||
268 | luaL_checktype(L, 1, LUA_TFUNCTION); | ||
269 | luaL_buffinit(L,&b); | ||
270 | if (!lua_dump(L, writer, &b)) | ||
271 | luaL_error(L, "unable to dump given function"); | ||
272 | luaL_pushresult(&b); | ||
273 | return 1; | ||
274 | } | ||
275 | |||
276 | |||
277 | |||
278 | static int luaB_loadfile (lua_State *L) { | 259 | static int luaB_loadfile (lua_State *L) { |
279 | const char *fname = luaL_optstring(L, 1, NULL); | 260 | const char *fname = luaL_optstring(L, 1, NULL); |
280 | return passresults(L, luaL_loadfile(L, fname)); | 261 | return passresults(L, luaL_loadfile(L, fname)); |
@@ -526,7 +507,6 @@ static const luaL_reg base_funcs[] = { | |||
526 | {"collectgarbage", luaB_collectgarbage}, | 507 | {"collectgarbage", luaB_collectgarbage}, |
527 | {"gcinfo", luaB_gcinfo}, | 508 | {"gcinfo", luaB_gcinfo}, |
528 | {"loadfile", luaB_loadfile}, | 509 | {"loadfile", luaB_loadfile}, |
529 | {"stringdump", luaB_stringdump}, | ||
530 | {"dofile", luaB_dofile}, | 510 | {"dofile", luaB_dofile}, |
531 | {"loadstring", luaB_loadstring}, | 511 | {"loadstring", luaB_loadstring}, |
532 | {"require", luaB_require}, | 512 | {"require", luaB_require}, |