diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-04-02 20:04:12 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-04-02 20:04:12 -0300 |
| commit | 075b7918c3dcc1e8b4d5e7f19ae213b081e01bf2 (patch) | |
| tree | ae1dd456984f4e7128b2d4a2e2e43e4f23b99d01 /fallback.c | |
| parent | 7c99149a76ce0c7469c9bafec5dfff529f88512c (diff) | |
| download | lua-075b7918c3dcc1e8b4d5e7f19ae213b081e01bf2.tar.gz lua-075b7918c3dcc1e8b4d5e7f19ae213b081e01bf2.tar.bz2 lua-075b7918c3dcc1e8b4d5e7f19ae213b081e01bf2.zip | |
new function "getintmethod"
Diffstat (limited to 'fallback.c')
| -rw-r--r-- | fallback.c | 13 |
1 files changed, 11 insertions, 2 deletions
| @@ -3,7 +3,7 @@ | |||
| 3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | char *rcs_fallback="$Id: fallback.c,v 1.36 1997/03/31 20:59:09 roberto Exp roberto $"; | 6 | char *rcs_fallback="$Id: fallback.c,v 1.37 1997/04/02 22:52:42 roberto Exp roberto $"; |
| 7 | 7 | ||
| 8 | #include <stdio.h> | 8 | #include <stdio.h> |
| 9 | #include <string.h> | 9 | #include <string.h> |
| @@ -223,6 +223,16 @@ TObject *luaI_getim (int tag, IMS event) | |||
| 223 | } | 223 | } |
| 224 | 224 | ||
| 225 | 225 | ||
| 226 | void luaI_getintmethod (void) | ||
| 227 | { | ||
| 228 | int t = (int)luaL_check_number(1, "getintmethod"); | ||
| 229 | int e = luaI_checkevent(luaL_check_string(2, "getintmethod"), luaI_eventname); | ||
| 230 | checktag(t); | ||
| 231 | if (validevent(t, e)) | ||
| 232 | luaI_pushobject(&luaI_IMtable[-t].int_method[e]); | ||
| 233 | } | ||
| 234 | |||
| 235 | |||
| 226 | void luaI_setintmethod (void) | 236 | void luaI_setintmethod (void) |
| 227 | { | 237 | { |
| 228 | int t = (int)luaL_check_number(1, "setintmethod"); | 238 | int t = (int)luaL_check_number(1, "setintmethod"); |
| @@ -233,7 +243,6 @@ void luaI_setintmethod (void) | |||
| 233 | lua_error("cannot change this internal method"); | 243 | lua_error("cannot change this internal method"); |
| 234 | luaL_arg_check(lua_isnil(func) || lua_isfunction(func), "setintmethod", | 244 | luaL_arg_check(lua_isnil(func) || lua_isfunction(func), "setintmethod", |
| 235 | 3, "function expected"); | 245 | 3, "function expected"); |
| 236 | luaI_pushobject(&luaI_IMtable[-t].int_method[e]); | ||
| 237 | luaI_IMtable[-t].int_method[e] = *luaI_Address(func); | 246 | luaI_IMtable[-t].int_method[e] = *luaI_Address(func); |
| 238 | } | 247 | } |
| 239 | 248 | ||
