aboutsummaryrefslogtreecommitdiff
path: root/iolib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-04-02 20:04:12 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-04-02 20:04:12 -0300
commit075b7918c3dcc1e8b4d5e7f19ae213b081e01bf2 (patch)
treeae1dd456984f4e7128b2d4a2e2e43e4f23b99d01 /iolib.c
parent7c99149a76ce0c7469c9bafec5dfff529f88512c (diff)
downloadlua-075b7918c3dcc1e8b4d5e7f19ae213b081e01bf2.tar.gz
lua-075b7918c3dcc1e8b4d5e7f19ae213b081e01bf2.tar.bz2
lua-075b7918c3dcc1e8b4d5e7f19ae213b081e01bf2.zip
new function "getintmethod"
Diffstat (limited to 'iolib.c')
-rw-r--r--iolib.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/iolib.c b/iolib.c
index fa105828..1a2a9009 100644
--- a/iolib.c
+++ b/iolib.c
@@ -288,9 +288,10 @@ static void getbyte (void)
288 lua_pushnumber(lua_getbindatasize(ud)); 288 lua_pushnumber(lua_getbindatasize(ud));
289 else { 289 else {
290 i--; 290 i--;
291 luaL_arg_check(0 <= i && i < lua_getbindatasize(ud), "getbyte", 2, 291 if (0 <= i && i < lua_getbindatasize(ud))
292 "out of range"); 292 lua_pushnumber(*(((char *)lua_getbinarydata(ud))+i));
293 lua_pushnumber(*(((char *)lua_getbinarydata(ud))+i)); 293 else
294 lua_pushnil();
294 } 295 }
295} 296}
296 297
@@ -341,7 +342,7 @@ static struct luaL_reg iolib[] = {
341 342
342void iolib_open (void) 343void iolib_open (void)
343{ 344{
344 lua_tagio = lua_newtag("userdata"); 345 lua_tagio = lua_newtag();
345 lua_infile=stdin; lua_outfile=stdout; 346 lua_infile=stdin; lua_outfile=stdout;
346 luaL_openlib(iolib, (sizeof(iolib)/sizeof(iolib[0]))); 347 luaL_openlib(iolib, (sizeof(iolib)/sizeof(iolib[0])));
347 lua_seterrormethod(errorfb); 348 lua_seterrormethod(errorfb);