diff options
-rw-r--r-- | lapi.c | 6 | ||||
-rw-r--r-- | lauxlib.c | 9 | ||||
-rw-r--r-- | llex.c | 4 | ||||
-rw-r--r-- | llex.h | 6 | ||||
-rw-r--r-- | lmem.c | 6 | ||||
-rw-r--r-- | lopcodes.h | 138 | ||||
-rw-r--r-- | lparser.c | 4 | ||||
-rw-r--r-- | lparser.h | 4 | ||||
-rw-r--r-- | lstrlib.c | 4 | ||||
-rw-r--r-- | ltm.c | 4 | ||||
-rw-r--r-- | lua.h | 3 | ||||
-rw-r--r-- | lzio.c | 11 | ||||
-rw-r--r-- | manual.tex | 10 |
13 files changed, 106 insertions, 103 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 1.37 1999/02/22 19:13:12 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.38 1999/02/23 14:57:28 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 | */ |
@@ -477,7 +477,7 @@ int luaA_next (Hash *t, int i) { | |||
477 | int lua_next (lua_Object o, int i) { | 477 | int lua_next (lua_Object o, int i) { |
478 | TObject *t = Address(o); | 478 | TObject *t = Address(o); |
479 | if (ttype(t) != LUA_T_ARRAY) | 479 | if (ttype(t) != LUA_T_ARRAY) |
480 | lua_error("API error: object is not a table in `lua_next'"); | 480 | lua_error("API error - object is not a table in `lua_next'"); |
481 | i = luaA_next(avalue(t), i); | 481 | i = luaA_next(avalue(t), i); |
482 | top2LC((i==0) ? 0 : 2); | 482 | top2LC((i==0) ? 0 : 2); |
483 | return i; | 483 | return i; |
@@ -620,7 +620,7 @@ static int checkfunc (TObject *o) | |||
620 | 620 | ||
621 | char *lua_getobjname (lua_Object o, char **name) | 621 | char *lua_getobjname (lua_Object o, char **name) |
622 | { /* try to find a name for given function */ | 622 | { /* try to find a name for given function */ |
623 | set_normalized(L->stack.top, Address(o)); /* to be accessed by "checkfunc */ | 623 | set_normalized(L->stack.top, Address(o)); /* to be accessed by "checkfunc" */ |
624 | if ((*name = luaT_travtagmethods(checkfunc)) != NULL) | 624 | if ((*name = luaT_travtagmethods(checkfunc)) != NULL) |
625 | return "tag-method"; | 625 | return "tag-method"; |
626 | else if ((*name = luaS_travsymbol(checkfunc)) != NULL) | 626 | else if ((*name = luaS_travsymbol(checkfunc)) != NULL) |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.c,v 1.12 1998/06/19 16:14:09 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.13 1998/09/07 18:59:59 roberto Exp roberto $ |
3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -10,9 +10,10 @@ | |||
10 | #include <string.h> | 10 | #include <string.h> |
11 | 11 | ||
12 | /* Please Notice: This file uses only the official API of Lua | 12 | /* Please Notice: This file uses only the official API of Lua |
13 | ** Any function declared here could be written as an application | 13 | ** Any function declared here could be written as an application function. |
14 | ** function. With care, these functions can be used by other libraries. | 14 | ** With care, these functions can be used by other libraries. |
15 | */ | 15 | */ |
16 | |||
16 | #include "lauxlib.h" | 17 | #include "lauxlib.h" |
17 | #include "lua.h" | 18 | #include "lua.h" |
18 | #include "luadebug.h" | 19 | #include "luadebug.h" |
@@ -33,7 +34,7 @@ void luaL_argerror (int numarg, char *extramsg) { | |||
33 | lua_getobjname(f, &funcname); | 34 | lua_getobjname(f, &funcname); |
34 | numarg -= lua_nups(f); | 35 | numarg -= lua_nups(f); |
35 | if (funcname == NULL) | 36 | if (funcname == NULL) |
36 | funcname = "???"; | 37 | funcname = "(unknown)"; |
37 | if (extramsg == NULL) | 38 | if (extramsg == NULL) |
38 | luaL_verror("bad argument #%d to function `%.50s'", numarg, funcname); | 39 | luaL_verror("bad argument #%d to function `%.50s'", numarg, funcname); |
39 | else | 40 | else |
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.c,v 1.28 1999/02/04 17:47:59 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 1.29 1999/02/25 15:17:01 roberto Exp roberto $ |
3 | ** Lexical Analizer | 3 | ** Lexical Analyzer |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
6 | 6 | ||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.h,v 1.9 1998/06/19 16:14:09 roberto Exp roberto $ | 2 | ** $Id: llex.h,v 1.10 1998/07/24 18:02:38 roberto Exp roberto $ |
3 | ** Lexical Analizer | 3 | ** Lexical Analyzer |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
6 | 6 | ||
@@ -30,7 +30,7 @@ enum RESERVED { | |||
30 | /* "ifstate" keeps the state of each nested $if the lexical is dealing with. */ | 30 | /* "ifstate" keeps the state of each nested $if the lexical is dealing with. */ |
31 | 31 | ||
32 | struct ifState { | 32 | struct ifState { |
33 | int elsepart; /* true if its in the $else part */ | 33 | int elsepart; /* true if it's in the $else part */ |
34 | int condition; /* true if $if condition is true */ | 34 | int condition; /* true if $if condition is true */ |
35 | int skip; /* true if part must be skipped */ | 35 | int skip; /* true if part must be skipped */ |
36 | }; | 36 | }; |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lmem.c,v 1.10 1999/02/24 17:55:51 roberto Exp roberto $ | 2 | ** $Id: lmem.c,v 1.11 1999/02/25 15:16:26 roberto Exp roberto $ |
3 | ** Interface to Memory Manager | 3 | ** Interface to Memory Manager |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -59,7 +59,7 @@ void *luaM_growaux (void *block, unsigned long nelems, int inc, int size, | |||
59 | void *luaM_realloc (void *block, unsigned long size) { | 59 | void *luaM_realloc (void *block, unsigned long size) { |
60 | size_t s = (size_t)size; | 60 | size_t s = (size_t)size; |
61 | if (s != size) | 61 | if (s != size) |
62 | lua_error("Allocation Error: Block too big"); | 62 | lua_error("memory allocation error: block too big"); |
63 | if (size == 0) { | 63 | if (size == 0) { |
64 | free(block); /* block may be NULL, that is OK for free */ | 64 | free(block); /* block may be NULL, that is OK for free */ |
65 | return NULL; | 65 | return NULL; |
@@ -100,7 +100,7 @@ static void *checkblock (void *block) { | |||
100 | void *luaM_realloc (void *block, unsigned long size) { | 100 | void *luaM_realloc (void *block, unsigned long size) { |
101 | unsigned long realsize = HEADER+size+1; | 101 | unsigned long realsize = HEADER+size+1; |
102 | if (realsize != (size_t)realsize) | 102 | if (realsize != (size_t)realsize) |
103 | lua_error("Allocation Error: Block too big"); | 103 | lua_error("memory allocation error: block too big"); |
104 | if (size == 0) { | 104 | if (size == 0) { |
105 | if (block) { | 105 | if (block) { |
106 | unsigned long *b = (unsigned long *)((char *)block - HEADER); | 106 | unsigned long *b = (unsigned long *)((char *)block - HEADER); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lopcodes.h,v 1.26 1999/02/23 13:38:38 roberto Exp roberto $ | 2 | ** $Id: lopcodes.h,v 1.27 1999/02/24 17:55:51 roberto Exp roberto $ |
3 | ** Opcodes for Lua virtual machine | 3 | ** Opcodes for Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -17,97 +17,97 @@ | |||
17 | typedef enum { | 17 | typedef enum { |
18 | /* name parm before after side effect | 18 | /* name parm before after side effect |
19 | -----------------------------------------------------------------------------*/ | 19 | -----------------------------------------------------------------------------*/ |
20 | ENDCODE,/* - - - */ | 20 | ENDCODE,/* - - - */ |
21 | RETCODE,/* b - - */ | 21 | RETCODE,/* b - - */ |
22 | 22 | ||
23 | PUSHNIL,/* b - nil_0...nil_b */ | 23 | PUSHNIL,/* b - nil_0...nil_b */ |
24 | POP,/* b - - TOP-=b */ | 24 | POP,/* b - - TOP-=b */ |
25 | POPDUP,/* b v v TOP-=b */ | 25 | POPDUP,/* b v v TOP-=b */ |
26 | 26 | ||
27 | PUSHNUMBERW,/* w - (float)w */ | 27 | PUSHNUMBERW,/* w - (float)w */ |
28 | PUSHNUMBER,/* b - (float)b */ | 28 | PUSHNUMBER,/* b - (float)b */ |
29 | 29 | ||
30 | PUSHNUMBERNEGW,/* w - (float)-w */ | 30 | PUSHNUMBERNEGW,/* w - (float)-w */ |
31 | PUSHNUMBERNEG,/* b - (float)-b */ | 31 | PUSHNUMBERNEG,/* b - (float)-b */ |
32 | 32 | ||
33 | PUSHCONSTANTW,/*w - CNST[w] */ | 33 | PUSHCONSTANTW,/*w - CNST[w] */ |
34 | PUSHCONSTANT,/* b - CNST[b] */ | 34 | PUSHCONSTANT,/* b - CNST[b] */ |
35 | 35 | ||
36 | PUSHUPVALUE,/* b - Closure[b] */ | 36 | PUSHUPVALUE,/* b - Closure[b] */ |
37 | 37 | ||
38 | PUSHLOCAL,/* b - LOC[b] */ | 38 | PUSHLOCAL,/* b - LOC[b] */ |
39 | 39 | ||
40 | GETGLOBALW,/* w - VAR[CNST[w]] */ | 40 | GETGLOBALW,/* w - VAR[CNST[w]] */ |
41 | GETGLOBAL,/* b - VAR[CNST[b]] */ | 41 | GETGLOBAL,/* b - VAR[CNST[b]] */ |
42 | 42 | ||
43 | GETTABLE,/* - i t t[i] */ | 43 | GETTABLE,/* - i t t[i] */ |
44 | 44 | ||
45 | GETDOTTEDW,/* w t t[CNST[w]] */ | 45 | GETDOTTEDW,/* w t t[CNST[w]] */ |
46 | GETDOTTED,/* b t t[CNST[b]] */ | 46 | GETDOTTED,/* b t t[CNST[b]] */ |
47 | 47 | ||
48 | PUSHSELFW,/* w t t t[CNST[w]] */ | 48 | PUSHSELFW,/* w t t t[CNST[w]] */ |
49 | PUSHSELF,/* b t t t[CNST[b]] */ | 49 | PUSHSELF,/* b t t t[CNST[b]] */ |
50 | 50 | ||
51 | CREATEARRAYW,/* w - newarray(size = w) */ | 51 | CREATEARRAYW,/* w - newarray(size = w) */ |
52 | CREATEARRAY,/* b - newarray(size = b) */ | 52 | CREATEARRAY,/* b - newarray(size = b) */ |
53 | 53 | ||
54 | SETLOCAL,/* b x - LOC[b]=x */ | 54 | SETLOCAL,/* b x - LOC[b]=x */ |
55 | SETLOCALDUP,/* b x x LOC[b]=x */ | 55 | SETLOCALDUP,/* b x x LOC[b]=x */ |
56 | 56 | ||
57 | SETGLOBALW,/* w x - VAR[CNST[w]]=x */ | 57 | SETGLOBALW,/* w x - VAR[CNST[w]]=x */ |
58 | SETGLOBAL,/* b x - VAR[CNST[b]]=x */ | 58 | SETGLOBAL,/* b x - VAR[CNST[b]]=x */ |
59 | SETGLOBALDUPW,/*w x x VAR[CNST[w]]=x */ | 59 | SETGLOBALDUPW,/*w x x VAR[CNST[w]]=x */ |
60 | SETGLOBALDUP,/* b x x VAR[CNST[b]]=x */ | 60 | SETGLOBALDUP,/* b x x VAR[CNST[b]]=x */ |
61 | 61 | ||
62 | SETTABLEPOP,/* - v i t - t[i]=v */ | 62 | SETTABLEPOP,/* - v i t - t[i]=v */ |
63 | SETTABLEPOPDUP,/* - v i t v t[i]=v */ | 63 | SETTABLEPOPDUP,/* - v i t v t[i]=v */ |
64 | 64 | ||
65 | SETTABLE,/* b v a_b...a_1 i t a_b...a_1 i t t[i]=v */ | 65 | SETTABLE,/* b v a_b...a_1 i t a_b...a_1 i t t[i]=v */ |
66 | SETTABLEDUP,/* b v a_b...a_1 i t v a_b...a_1 i t t[i]=v */ | 66 | SETTABLEDUP,/* b v a_b...a_1 i t v a_b...a_1 i t t[i]=v */ |
67 | 67 | ||
68 | SETLISTW,/* w c v_c...v_1 t - t[i+w*FPF]=v_i */ | 68 | SETLISTW,/* w c v_c...v_1 t - t[i+w*FPF]=v_i */ |
69 | SETLIST,/* b c v_c...v_1 t - t[i+b*FPF]=v_i */ | 69 | SETLIST,/* b c v_c...v_1 t - t[i+b*FPF]=v_i */ |
70 | 70 | ||
71 | SETMAP,/* b v_b k_b ...v_0 k_0 t t t[k_i]=v_i */ | 71 | SETMAP,/* b v_b k_b ...v_0 k_0 t t t[k_i]=v_i */ |
72 | 72 | ||
73 | NEQOP,/* - y x (x~=y)? 1 : nil */ | 73 | NEQOP,/* - y x (x~=y)? 1 : nil */ |
74 | EQOP,/* - y x (x==y)? 1 : nil */ | 74 | EQOP,/* - y x (x==y)? 1 : nil */ |
75 | LTOP,/* - y x (x<y)? 1 : nil */ | 75 | LTOP,/* - y x (x<y)? 1 : nil */ |
76 | LEOP,/* - y x (x<y)? 1 : nil */ | 76 | LEOP,/* - y x (x<y)? 1 : nil */ |
77 | GTOP,/* - y x (x>y)? 1 : nil */ | 77 | GTOP,/* - y x (x>y)? 1 : nil */ |
78 | GEOP,/* - y x (x>=y)? 1 : nil */ | 78 | GEOP,/* - y x (x>=y)? 1 : nil */ |
79 | ADDOP,/* - y x x+y */ | 79 | ADDOP,/* - y x x+y */ |
80 | SUBOP,/* - y x x-y */ | 80 | SUBOP,/* - y x x-y */ |
81 | MULTOP,/* - y x x*y */ | 81 | MULTOP,/* - y x x*y */ |
82 | DIVOP,/* - y x x/y */ | 82 | DIVOP,/* - y x x/y */ |
83 | POWOP,/* - y x x^y */ | 83 | POWOP,/* - y x x^y */ |
84 | CONCOP,/* - y x x..y */ | 84 | CONCOP,/* - y x x..y */ |
85 | MINUSOP,/* - x -x */ | 85 | MINUSOP,/* - x -x */ |
86 | NOTOP,/* - x (x==nil)? 1 : nil */ | 86 | NOTOP,/* - x (x==nil)? 1 : nil */ |
87 | 87 | ||
88 | ONTJMPW,/* w x (x!=nil)? x : - (x!=nil)? PC+=w */ | 88 | ONTJMPW,/* w x (x!=nil)? x : - (x!=nil)? PC+=w */ |
89 | ONTJMP,/* b x (x!=nil)? x : - (x!=nil)? PC+=b */ | 89 | ONTJMP,/* b x (x!=nil)? x : - (x!=nil)? PC+=b */ |
90 | ONFJMPW,/* w x (x==nil)? x : - (x==nil)? PC+=w */ | 90 | ONFJMPW,/* w x (x==nil)? x : - (x==nil)? PC+=w */ |
91 | ONFJMP,/* b x (x==nil)? x : - (x==nil)? PC+=b */ | 91 | ONFJMP,/* b x (x==nil)? x : - (x==nil)? PC+=b */ |
92 | JMPW,/* w - - PC+=w */ | 92 | JMPW,/* w - - PC+=w */ |
93 | JMP,/* b - - PC+=b */ | 93 | JMP,/* b - - PC+=b */ |
94 | IFFJMPW,/* w x - (x==nil)? PC+=w */ | 94 | IFFJMPW,/* w x - (x==nil)? PC+=w */ |
95 | IFFJMP,/* b x - (x==nil)? PC+=b */ | 95 | IFFJMP,/* b x - (x==nil)? PC+=b */ |
96 | IFTUPJMPW,/* w x - (x!=nil)? PC-=w */ | 96 | IFTUPJMPW,/* w x - (x!=nil)? PC-=w */ |
97 | IFTUPJMP,/* b x - (x!=nil)? PC-=b */ | 97 | IFTUPJMP,/* b x - (x!=nil)? PC-=b */ |
98 | IFFUPJMPW,/* w x - (x==nil)? PC-=w */ | 98 | IFFUPJMPW,/* w x - (x==nil)? PC-=w */ |
99 | IFFUPJMP,/* b x - (x==nil)? PC-=b */ | 99 | IFFUPJMP,/* b x - (x==nil)? PC-=b */ |
100 | 100 | ||
101 | CLOSUREW,/* w c v_c...v_1 closure(CNST[w], v_c...v_1) */ | 101 | CLOSUREW,/* w c v_c...v_1 closure(CNST[w], v_c...v_1) */ |
102 | CLOSURE,/* b c v_c...v_1 closure(CNST[b], v_c...v_1) */ | 102 | CLOSURE,/* b c v_c...v_1 closure(CNST[b], v_c...v_1) */ |
103 | 103 | ||
104 | CALLFUNC,/* b c v_c...v_1 f r_b...r_1 f(v1,...,v_c) */ | 104 | CALLFUNC,/* b c v_c...v_1 f r_b...r_1 f(v1,...,v_c) */ |
105 | 105 | ||
106 | SETLINEW,/* w - - LINE=w */ | 106 | SETLINEW,/* w - - LINE=w */ |
107 | SETLINE,/* b - - LINE=b */ | 107 | SETLINE,/* b - - LINE=b */ |
108 | 108 | ||
109 | LONGARGW,/* w (add w*(1<<16) to arg of next instruction) */ | 109 | LONGARGW,/* w (add w*(1<<16) to arg of next instruction) */ |
110 | LONGARG,/* b (add b*(1<<16) to arg of next instruction) */ | 110 | LONGARG,/* b (add b*(1<<16) to arg of next instruction) */ |
111 | 111 | ||
112 | CHECKSTACK /* b (assert #temporaries == b; only for internal debuging!) */ | 112 | CHECKSTACK /* b (assert #temporaries == b; only for internal debuging!) */ |
113 | 113 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.c,v 1.22 1999/02/24 17:55:51 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 1.23 1999/02/25 15:16:26 roberto Exp roberto $ |
3 | ** LL(1) Parser and code generator for Lua | 3 | ** LL(1) Parser and code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -926,7 +926,7 @@ static void exp1 (LexState *ls) { | |||
926 | exp0(ls, &v); | 926 | exp0(ls, &v); |
927 | lua_pushvar(ls, &v); | 927 | lua_pushvar(ls, &v); |
928 | if (is_in(ls->token, expfollow) < 0) | 928 | if (is_in(ls->token, expfollow) < 0) |
929 | luaX_error(ls, "ill formed expression"); | 929 | luaX_error(ls, "ill-formed expression"); |
930 | } | 930 | } |
931 | 931 | ||
932 | 932 | ||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.h,v 1.1 1997/09/16 19:25:59 roberto Exp roberto $ | 2 | ** $Id: lparser.h,v 1.2 1997/12/22 20:57:18 roberto Exp roberto $ |
3 | ** Syntax analizer and code generator | 3 | ** LL(1) Parser and code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
6 | 6 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstrlib.c,v 1.25 1999/02/05 11:22:58 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.26 1999/02/12 19:23:02 roberto Exp roberto $ |
3 | ** Standard library for strings and pattern-matching | 3 | ** Standard library for strings and pattern-matching |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -532,7 +532,7 @@ static struct luaL_reg strlib[] = { | |||
532 | {"strupper", str_upper}, | 532 | {"strupper", str_upper}, |
533 | {"strchar", str_char}, | 533 | {"strchar", str_char}, |
534 | {"strrep", str_rep}, | 534 | {"strrep", str_rep}, |
535 | {"ascii", str_byte}, /* for compatibility */ | 535 | {"ascii", str_byte}, /* for compatibility with 3.0 and earlier */ |
536 | {"strbyte", str_byte}, | 536 | {"strbyte", str_byte}, |
537 | {"format", str_format}, | 537 | {"format", str_format}, |
538 | {"strfind", str_find}, | 538 | {"strfind", str_find}, |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltm.c,v 1.21 1999/02/04 18:59:31 roberto Exp roberto $ | 2 | ** $Id: ltm.c,v 1.22 1999/02/25 15:16:26 roberto Exp roberto $ |
3 | ** Tag methods | 3 | ** Tag methods |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -82,7 +82,7 @@ static void checktag (int tag) { | |||
82 | 82 | ||
83 | void luaT_realtag (int tag) { | 83 | void luaT_realtag (int tag) { |
84 | if (!(L->last_tag <= tag && tag < LUA_T_NIL)) | 84 | if (!(L->last_tag <= tag && tag < LUA_T_NIL)) |
85 | luaL_verror("tag %d is not result of `newtag'", tag); | 85 | luaL_verror("tag %d was not created by `newtag'", tag); |
86 | } | 86 | } |
87 | 87 | ||
88 | 88 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.h,v 1.28 1999/02/22 19:13:12 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.29 1999/02/23 14:57:28 roberto Exp roberto $ |
3 | ** Lua - An Extensible Extension Language | 3 | ** Lua - An Extensible Extension Language |
4 | ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil | 4 | ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil |
5 | ** e-mail: lua@tecgraf.puc-rio.br | 5 | ** e-mail: lua@tecgraf.puc-rio.br |
@@ -188,5 +188,6 @@ lua_Object lua_setfallback (char *event, lua_CFunction fallback); | |||
188 | * The Lua language and this implementation have been entirely designed and | 188 | * The Lua language and this implementation have been entirely designed and |
189 | * written by Waldemar Celes Filho, Roberto Ierusalimschy and | 189 | * written by Waldemar Celes Filho, Roberto Ierusalimschy and |
190 | * Luiz Henrique de Figueiredo at TeCGraf, PUC-Rio. | 190 | * Luiz Henrique de Figueiredo at TeCGraf, PUC-Rio. |
191 | * | ||
191 | * This implementation contains no third-party code. | 192 | * This implementation contains no third-party code. |
192 | ******************************************************************************/ | 193 | ******************************************************************************/ |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lzio.c,v 1.3 1997/12/22 20:57:18 roberto Exp roberto $ | 2 | ** $Id: lzio.c,v 1.4 1998/12/28 13:44:54 roberto Exp roberto $ |
3 | ** a generic input stream interface | 3 | ** a generic input stream interface |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -64,16 +64,15 @@ ZIO* zFopen (ZIO* z, FILE* f, char *name) | |||
64 | 64 | ||
65 | 65 | ||
66 | /* --------------------------------------------------------------- read --- */ | 66 | /* --------------------------------------------------------------- read --- */ |
67 | int zread (ZIO *z, void *b, int n) | 67 | int zread (ZIO *z, void *b, int n) { |
68 | { | ||
69 | while (n) { | 68 | while (n) { |
70 | int m; | 69 | int m; |
71 | if (z->n == 0) { | 70 | if (z->n == 0) { |
72 | if (z->filbuf(z) == EOZ) | 71 | if (z->filbuf(z) == EOZ) |
73 | return n; /* retorna quantos faltaram ler */ | 72 | return n; /* return number of missing bytes */ |
74 | zungetc(z); /* poe o resultado de filbuf no buffer */ | 73 | zungetc(z); /* put result from 'filbuf' in the buffer */ |
75 | } | 74 | } |
76 | m = (n <= z->n) ? n : z->n; /* minimo de n e z->n */ | 75 | m = (n <= z->n) ? n : z->n; /* min. between n and z->n */ |
77 | memcpy(b, z->p, m); | 76 | memcpy(b, z->p, m); |
78 | z->n -= m; | 77 | z->n -= m; |
79 | z->p += m; | 78 | z->p += m; |
@@ -1,4 +1,4 @@ | |||
1 | % $Id: manual.tex,v 1.22 1999/02/05 12:15:07 roberto Exp roberto $ | 1 | % $Id: manual.tex,v 1.23 1999/02/12 19:23:02 roberto Exp roberto $ |
2 | 2 | ||
3 | \documentclass[11pt]{article} | 3 | \documentclass[11pt]{article} |
4 | \usepackage{fullpage,bnf} | 4 | \usepackage{fullpage,bnf} |
@@ -41,7 +41,7 @@ Waldemar Celes | |||
41 | \tecgraf\ --- Computer Science Department --- PUC-Rio | 41 | \tecgraf\ --- Computer Science Department --- PUC-Rio |
42 | } | 42 | } |
43 | 43 | ||
44 | %\date{\small \verb$Date: 1999/02/05 12:15:07 $} | 44 | %\date{\small \verb$Date: 1999/02/12 19:23:02 $} |
45 | 45 | ||
46 | \maketitle | 46 | \maketitle |
47 | 47 | ||
@@ -122,8 +122,10 @@ and its documentation. | |||
122 | \noindent | 122 | \noindent |
123 | The Lua language and this implementation have been entirely designed and | 123 | The Lua language and this implementation have been entirely designed and |
124 | written by Waldemar Celes, Roberto Ierusalimschy and Luiz Henrique de | 124 | written by Waldemar Celes, Roberto Ierusalimschy and Luiz Henrique de |
125 | Figueiredo at TeCGraf, PUC-Rio. This implementation contains no third-party | 125 | Figueiredo at TeCGraf, PUC-Rio. |
126 | code. | 126 | |
127 | \noindent | ||
128 | This implementation contains no third-party code. | ||
127 | \end{quotation} | 129 | \end{quotation} |
128 | 130 | ||
129 | \newpage | 131 | \newpage |