mirror of https://github.com/rusefi/lua.git
new functions to manipulate C global variables
This commit is contained in:
parent
e87fddf1ad
commit
54840fb256
47
lapi.c
47
lapi.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lapi.c,v 1.29 1998/12/03 15:45:15 roberto Exp roberto $
|
** $Id: lapi.c,v 1.30 1998/12/30 17:26:49 roberto Exp roberto $
|
||||||
** Lua API
|
** Lua API
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -425,8 +425,42 @@ void lua_settag (int tag)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
** {======================================================
|
||||||
|
** To manipulate the implementation global variables
|
||||||
** =======================================================
|
** =======================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
lua_State *lua_setstate (lua_State *st) {
|
||||||
|
lua_State *old = lua_state;
|
||||||
|
lua_state = st;
|
||||||
|
return old;
|
||||||
|
}
|
||||||
|
|
||||||
|
lua_LHFunction lua_setlinehook (lua_LHFunction func) {
|
||||||
|
lua_LHFunction old = lua_linehook;
|
||||||
|
lua_linehook = func;
|
||||||
|
return old;
|
||||||
|
}
|
||||||
|
|
||||||
|
lua_CHFunction lua_setcallhook (lua_CHFunction func) {
|
||||||
|
lua_CHFunction old = lua_callhook;
|
||||||
|
lua_callhook = func;
|
||||||
|
return old;
|
||||||
|
}
|
||||||
|
|
||||||
|
int lua_setdebug (int debug) {
|
||||||
|
int old = lua_debug;
|
||||||
|
lua_debug = debug;
|
||||||
|
return old;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* }====================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
** {======================================================
|
||||||
** Debug interface
|
** Debug interface
|
||||||
** =======================================================
|
** =======================================================
|
||||||
*/
|
*/
|
||||||
|
@ -541,8 +575,11 @@ char *lua_getobjname (lua_Object o, char **name)
|
||||||
else return "";
|
else return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* }====================================================== */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** =======================================================
|
** {======================================================
|
||||||
** BLOCK mechanism
|
** BLOCK mechanism
|
||||||
** =======================================================
|
** =======================================================
|
||||||
*/
|
*/
|
||||||
|
@ -582,9 +619,11 @@ lua_Object lua_getref (int ref)
|
||||||
return (o ? put_luaObject(o) : LUA_NOOBJECT);
|
return (o ? put_luaObject(o) : LUA_NOOBJECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* }====================================================== */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** =======================================================
|
** {======================================================
|
||||||
** Derived functions
|
** Derived functions
|
||||||
** =======================================================
|
** =======================================================
|
||||||
*/
|
*/
|
||||||
|
@ -602,6 +641,8 @@ void (lua_pushcfunction) (lua_CFunction f) { lua_pushcfunction(f); }
|
||||||
|
|
||||||
int (lua_clonetag) (int t) { return lua_clonetag(t); }
|
int (lua_clonetag) (int t) { return lua_clonetag(t); }
|
||||||
|
|
||||||
|
/* }====================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
8
lstate.c
8
lstate.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lstate.c,v 1.5 1997/12/17 20:48:58 roberto Exp roberto $
|
** $Id: lstate.c,v 1.6 1998/06/02 20:37:04 roberto Exp roberto $
|
||||||
** Global State
|
** Global State
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -78,9 +78,3 @@ void lua_close (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
lua_State *lua_setstate (lua_State *st) {
|
|
||||||
lua_State *old = lua_state;
|
|
||||||
lua_state = st;
|
|
||||||
return old;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: luadebug.h,v 1.2 1998/06/19 16:14:09 roberto Exp roberto $
|
** $Id: luadebug.h,v 1.3 1998/09/07 18:59:59 roberto Exp roberto $
|
||||||
** Debugging API
|
** Debugging API
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -31,4 +31,9 @@ extern lua_CHFunction lua_callhook;
|
||||||
extern int lua_debug;
|
extern int lua_debug;
|
||||||
|
|
||||||
|
|
||||||
|
extern lua_LHFunction lua_setlinehook (lua_LHFunction func);
|
||||||
|
extern lua_CHFunction lua_setcallhook (lua_CHFunction func);
|
||||||
|
extern int lua_setdebug (int debug);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue