aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-01-15 11:11:22 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-01-15 11:11:22 -0200
commit54840fb25696ab30e11d2d80f3c18af6d1f01481 (patch)
treeb2d0fd6ad4dd450ba7f845e6c1ea3d73efcbd7f6 /lapi.c
parente87fddf1adab8ca60ec988c9d71d29a44d7129a3 (diff)
downloadlua-54840fb25696ab30e11d2d80f3c18af6d1f01481.tar.gz
lua-54840fb25696ab30e11d2d80f3c18af6d1f01481.tar.bz2
lua-54840fb25696ab30e11d2d80f3c18af6d1f01481.zip
new functions to manipulate C global variables
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c47
1 files changed, 44 insertions, 3 deletions
diff --git a/lapi.c b/lapi.c
index d5c16369..5f75649f 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 1.29 1998/12/03 15:45:15 roberto Exp roberto $ 2** $Id: lapi.c,v 1.30 1998/12/30 17:26:49 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -425,8 +425,42 @@ void lua_settag (int tag)
425} 425}
426 426
427 427
428
428/* 429/*
430** {======================================================
431** To manipulate the implementation global variables
429** ======================================================= 432** =======================================================
433*/
434
435lua_State *lua_setstate (lua_State *st) {
436 lua_State *old = lua_state;
437 lua_state = st;
438 return old;
439}
440
441lua_LHFunction lua_setlinehook (lua_LHFunction func) {
442 lua_LHFunction old = lua_linehook;
443 lua_linehook = func;
444 return old;
445}
446
447lua_CHFunction lua_setcallhook (lua_CHFunction func) {
448 lua_CHFunction old = lua_callhook;
449 lua_callhook = func;
450 return old;
451}
452
453int lua_setdebug (int debug) {
454 int old = lua_debug;
455 lua_debug = debug;
456 return old;
457}
458
459/* }====================================================== */
460
461
462/*
463** {======================================================
430** Debug interface 464** Debug interface
431** ======================================================= 465** =======================================================
432*/ 466*/
@@ -541,8 +575,11 @@ char *lua_getobjname (lua_Object o, char **name)
541 else return ""; 575 else return "";
542} 576}
543 577
578/* }====================================================== */
579
580
544/* 581/*
545** ======================================================= 582** {======================================================
546** BLOCK mechanism 583** BLOCK mechanism
547** ======================================================= 584** =======================================================
548*/ 585*/
@@ -582,9 +619,11 @@ lua_Object lua_getref (int ref)
582 return (o ? put_luaObject(o) : LUA_NOOBJECT); 619 return (o ? put_luaObject(o) : LUA_NOOBJECT);
583} 620}
584 621
622/* }====================================================== */
623
585 624
586/* 625/*
587** ======================================================= 626** {======================================================
588** Derived functions 627** Derived functions
589** ======================================================= 628** =======================================================
590*/ 629*/
@@ -602,6 +641,8 @@ void (lua_pushcfunction) (lua_CFunction f) { lua_pushcfunction(f); }
602 641
603int (lua_clonetag) (int t) { return lua_clonetag(t); } 642int (lua_clonetag) (int t) { return lua_clonetag(t); }
604 643
644/* }====================================================== */
645
605 646
606 647
607 648