diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-04-16 14:08:28 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-04-16 14:08:28 -0300 |
| commit | c11d374c592d10b8ed649ffe501191039ee18757 (patch) | |
| tree | 52a3b434d6197ae36c7f132b370c9807251effe0 /lapi.c | |
| parent | 13230c451ba2feaef1c92c391451ee6471b15bb7 (diff) | |
| download | lua-c11d374c592d10b8ed649ffe501191039ee18757.tar.gz lua-c11d374c592d10b8ed649ffe501191039ee18757.tar.bz2 lua-c11d374c592d10b8ed649ffe501191039ee18757.zip | |
`panic' function configurable via API
Diffstat (limited to 'lapi.c')
| -rw-r--r-- | lapi.c | 11 |
1 files changed, 10 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lapi.c,v 1.182 2002/04/02 20:43:18 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.183 2002/04/05 18:54:31 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 | */ |
| @@ -98,6 +98,15 @@ LUA_API int lua_checkstack (lua_State *L, int size) { | |||
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | 100 | ||
| 101 | LUA_API lua_CFunction lua_setpanicf (lua_State *L, lua_CFunction panicf) { | ||
| 102 | lua_CFunction old; | ||
| 103 | lua_lock(L); | ||
| 104 | old = G(L)->panic; | ||
| 105 | G(L)->panic = panicf; | ||
| 106 | lua_unlock(L); | ||
| 107 | return old; | ||
| 108 | } | ||
| 109 | |||
| 101 | 110 | ||
| 102 | /* | 111 | /* |
| 103 | ** basic stack manipulation | 112 | ** basic stack manipulation |
