diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-04-18 10:22:48 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-04-18 10:22:48 -0300 |
| commit | 53f9499f7f7bf1fb41a37382ffef8a6796a528c1 (patch) | |
| tree | 68aea55eb493117598b0f3d709eedcd1c425e90e /lapi.c | |
| parent | 575befc394adc9714978a51e1b48ebb610bd3147 (diff) | |
| download | lua-53f9499f7f7bf1fb41a37382ffef8a6796a528c1.tar.gz lua-53f9499f7f7bf1fb41a37382ffef8a6796a528c1.tar.bz2 lua-53f9499f7f7bf1fb41a37382ffef8a6796a528c1.zip | |
"light C function" is a better name than "C-function pointer"
Diffstat (limited to 'lapi.c')
| -rw-r--r-- | lapi.c | 10 |
1 files changed, 5 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lapi.c,v 2.120 2010/04/05 14:21:38 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.121 2010/04/13 20:48:12 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 | */ |
| @@ -56,7 +56,7 @@ static TValue *index2addr (lua_State *L, int idx) { | |||
| 56 | else { /* upvalues */ | 56 | else { /* upvalues */ |
| 57 | idx = LUA_REGISTRYINDEX - idx; | 57 | idx = LUA_REGISTRYINDEX - idx; |
| 58 | api_check(L, idx <= UCHAR_MAX + 1, "upvalue index too large"); | 58 | api_check(L, idx <= UCHAR_MAX + 1, "upvalue index too large"); |
| 59 | if (ttiscfp(ci->func)) /* C-function pointer? */ | 59 | if (ttislcf(ci->func)) /* light C function? */ |
| 60 | return cast(TValue *, luaO_nilobject); /* it has no upvalues */ | 60 | return cast(TValue *, luaO_nilobject); /* it has no upvalues */ |
| 61 | else { | 61 | else { |
| 62 | Closure *func = clvalue(ci->func); | 62 | Closure *func = clvalue(ci->func); |
| @@ -241,7 +241,7 @@ LUA_API const char *lua_typename (lua_State *L, int t) { | |||
| 241 | 241 | ||
| 242 | LUA_API int lua_iscfunction (lua_State *L, int idx) { | 242 | LUA_API int lua_iscfunction (lua_State *L, int idx) { |
| 243 | StkId o = index2addr(L, idx); | 243 | StkId o = index2addr(L, idx); |
| 244 | return (ttiscfp(o) || (ttisclosure(o) && clvalue(o)->c.isC)); | 244 | return (ttislcf(o) || (ttisclosure(o) && clvalue(o)->c.isC)); |
| 245 | } | 245 | } |
| 246 | 246 | ||
| 247 | 247 | ||
| @@ -367,7 +367,7 @@ LUA_API size_t lua_rawlen (lua_State *L, int idx) { | |||
| 367 | 367 | ||
| 368 | LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) { | 368 | LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) { |
| 369 | StkId o = index2addr(L, idx); | 369 | StkId o = index2addr(L, idx); |
| 370 | if (ttiscfp(o)) return fvalue(o); | 370 | if (ttislcf(o)) return fvalue(o); |
| 371 | else if (ttisclosure(o) && clvalue(o)->c.isC) | 371 | else if (ttisclosure(o) && clvalue(o)->c.isC) |
| 372 | return clvalue(o)->c.f; | 372 | return clvalue(o)->c.f; |
| 373 | else return NULL; /* not a C function */ | 373 | else return NULL; /* not a C function */ |
| @@ -395,7 +395,7 @@ LUA_API const void *lua_topointer (lua_State *L, int idx) { | |||
| 395 | switch (ttype(o)) { | 395 | switch (ttype(o)) { |
| 396 | case LUA_TTABLE: return hvalue(o); | 396 | case LUA_TTABLE: return hvalue(o); |
| 397 | case LUA_TFUNCTION: return clvalue(o); | 397 | case LUA_TFUNCTION: return clvalue(o); |
| 398 | case LUA_TCFP: return cast(void *, cast(size_t, fvalue(o))); | 398 | case LUA_TLCF: return cast(void *, cast(size_t, fvalue(o))); |
| 399 | case LUA_TTHREAD: return thvalue(o); | 399 | case LUA_TTHREAD: return thvalue(o); |
| 400 | case LUA_TUSERDATA: | 400 | case LUA_TUSERDATA: |
| 401 | case LUA_TLIGHTUSERDATA: | 401 | case LUA_TLIGHTUSERDATA: |
