diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-04-04 19:24:51 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-04-04 19:24:51 -0300 |
commit | 42fa305649199712aad1c96beadb944b01277e3f (patch) | |
tree | d20afcf78aebc8b7fad91ce4e3b9061c2a29b000 /iolib.c | |
parent | 9319735744404831f7153653930d56826a4d2f6a (diff) | |
download | lua-42fa305649199712aad1c96beadb944b01277e3f.tar.gz lua-42fa305649199712aad1c96beadb944b01277e3f.tar.bz2 lua-42fa305649199712aad1c96beadb944b01277e3f.zip |
better error messages;
better names for some API functions.
Diffstat (limited to 'iolib.c')
-rw-r--r-- | iolib.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -33,7 +33,7 @@ static void pushresult (int i) | |||
33 | #ifndef NOSTRERROR | 33 | #ifndef NOSTRERROR |
34 | lua_pushstring(strerror(errno)); | 34 | lua_pushstring(strerror(errno)); |
35 | #else | 35 | #else |
36 | lua_pushstring("system unable to define the error"); | 36 | lua_pushstring("O.S. unable to define the error"); |
37 | #endif | 37 | #endif |
38 | } | 38 | } |
39 | } | 39 | } |
@@ -124,7 +124,7 @@ static void io_read (void) | |||
124 | } | 124 | } |
125 | else if (*p == '}') { | 125 | else if (*p == '}') { |
126 | if (inskip == 0) | 126 | if (inskip == 0) |
127 | lua_error("unbalanced `{...}' in read pattern"); | 127 | lua_error("unbalanced braces in read pattern"); |
128 | inskip--; | 128 | inskip--; |
129 | p++; | 129 | p++; |
130 | } | 130 | } |
@@ -248,7 +248,7 @@ static void lua_printstack (FILE *f) | |||
248 | fprintf(f, "function %s", name); | 248 | fprintf(f, "function %s", name); |
249 | break; | 249 | break; |
250 | case 'f': | 250 | case 'f': |
251 | fprintf(f, "`%s' fallback", name); | 251 | fprintf(f, "`%s' iternal method", name); |
252 | break; | 252 | break; |
253 | default: { | 253 | default: { |
254 | char *filename; | 254 | char *filename; |
@@ -289,7 +289,7 @@ static void getbyte (void) | |||
289 | else { | 289 | else { |
290 | i--; | 290 | i--; |
291 | if (0 <= i && i < lua_getbindatasize(ud)) | 291 | if (0 <= i && i < lua_getbindatasize(ud)) |
292 | lua_pushnumber(*(((char *)lua_getbinarydata(ud))+i)); | 292 | lua_pushnumber(*(((char *)lua_getbindata(ud))+i)); |
293 | else | 293 | else |
294 | lua_pushnil(); | 294 | lua_pushnil(); |
295 | } | 295 | } |
@@ -307,7 +307,7 @@ static void createuserdata (void) | |||
307 | lua_beginblock(); | 307 | lua_beginblock(); |
308 | lua_pushobject(t); | 308 | lua_pushobject(t); |
309 | lua_pushnumber(i+1); | 309 | lua_pushnumber(i+1); |
310 | o = lua_basicindex(); | 310 | o = lua_rawgettable(); |
311 | if (lua_isnil(o)) { | 311 | if (lua_isnil(o)) { |
312 | lua_endblock(); | 312 | lua_endblock(); |
313 | break; | 313 | break; |
@@ -317,7 +317,7 @@ static void createuserdata (void) | |||
317 | luaI_addchar(lua_getnumber(o)); | 317 | luaI_addchar(lua_getnumber(o)); |
318 | lua_endblock(); | 318 | lua_endblock(); |
319 | } | 319 | } |
320 | lua_pushbinarydata(luaI_addchar(0), i, tag); | 320 | lua_pushbindata(luaI_addchar(0), i, tag); |
321 | } | 321 | } |
322 | 322 | ||
323 | 323 | ||