aboutsummaryrefslogtreecommitdiff
path: root/ldblib.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldblib.c')
-rw-r--r--ldblib.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ldblib.c b/ldblib.c
index d045a82e..513a13cb 100644
--- a/ldblib.c
+++ b/ldblib.c
@@ -437,6 +437,17 @@ static int db_traceback (lua_State *L) {
437} 437}
438 438
439 439
440static int db_setCstacklimit (lua_State *L) {
441 int limit = (int)luaL_checkinteger(L, 1);
442 int res = lua_setCstacklimit(L, limit);
443 if (res == 0)
444 lua_pushboolean(L, 0);
445 else
446 lua_pushinteger(L, res);
447 return 1;
448}
449
450
440static const luaL_Reg dblib[] = { 451static const luaL_Reg dblib[] = {
441 {"debug", db_debug}, 452 {"debug", db_debug},
442 {"getuservalue", db_getuservalue}, 453 {"getuservalue", db_getuservalue},
@@ -454,6 +465,7 @@ static const luaL_Reg dblib[] = {
454 {"setmetatable", db_setmetatable}, 465 {"setmetatable", db_setmetatable},
455 {"setupvalue", db_setupvalue}, 466 {"setupvalue", db_setupvalue},
456 {"traceback", db_traceback}, 467 {"traceback", db_traceback},
468 {"setCstacklimit", db_setCstacklimit},
457 {NULL, NULL} 469 {NULL, NULL}
458}; 470};
459 471