summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-02-25 18:07:26 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-02-25 18:07:26 -0300
commit6a853fcb8b9e333d768c739c36c99b144bbde607 (patch)
tree5645e5fbe3a43f15044591be30c5d4607cb7357c
parent31bea2190b25e5b6687d92d807af522378168bfa (diff)
downloadlua-6a853fcb8b9e333d768c739c36c99b144bbde607.tar.gz
lua-6a853fcb8b9e333d768c739c36c99b144bbde607.tar.bz2
lua-6a853fcb8b9e333d768c739c36c99b144bbde607.zip
details (from lhf)
-rw-r--r--lapi.c6
-rw-r--r--lauxlib.c9
-rw-r--r--llex.c4
-rw-r--r--llex.h6
-rw-r--r--lmem.c6
-rw-r--r--lopcodes.h138
-rw-r--r--lparser.c4
-rw-r--r--lparser.h4
-rw-r--r--lstrlib.c4
-rw-r--r--ltm.c4
-rw-r--r--lua.h3
-rw-r--r--lzio.c11
-rw-r--r--manual.tex10
13 files changed, 106 insertions, 103 deletions
diff --git a/lapi.c b/lapi.c
index 86acf301..e6685ee9 100644
--- a/lapi.c
+++ b/lapi.c
@@ -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) {
477int lua_next (lua_Object o, int i) { 477int 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
621char *lua_getobjname (lua_Object o, char **name) 621char *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)
diff --git a/lauxlib.c b/lauxlib.c
index c8c1f3d6..37931dc6 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -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
diff --git a/llex.c b/llex.c
index 9b74543b..88a57d97 100644
--- a/llex.c
+++ b/llex.c
@@ -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
diff --git a/llex.h b/llex.h
index b9171a8b..84c0ee99 100644
--- a/llex.h
+++ b/llex.h
@@ -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
32struct ifState { 32struct 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};
diff --git a/lmem.c b/lmem.c
index b4947b6c..82159876 100644
--- a/lmem.c
+++ b/lmem.c
@@ -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,
59void *luaM_realloc (void *block, unsigned long size) { 59void *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) {
100void *luaM_realloc (void *block, unsigned long size) { 100void *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);
diff --git a/lopcodes.h b/lopcodes.h
index f1d6a2e1..c66b4a7f 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -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 @@
17typedef enum { 17typedef enum {
18/* name parm before after side effect 18/* name parm before after side effect
19-----------------------------------------------------------------------------*/ 19-----------------------------------------------------------------------------*/
20ENDCODE,/* - - - */ 20ENDCODE,/* - - - */
21RETCODE,/* b - - */ 21RETCODE,/* b - - */
22 22
23PUSHNIL,/* b - nil_0...nil_b */ 23PUSHNIL,/* b - nil_0...nil_b */
24POP,/* b - - TOP-=b */ 24POP,/* b - - TOP-=b */
25POPDUP,/* b v v TOP-=b */ 25POPDUP,/* b v v TOP-=b */
26 26
27PUSHNUMBERW,/* w - (float)w */ 27PUSHNUMBERW,/* w - (float)w */
28PUSHNUMBER,/* b - (float)b */ 28PUSHNUMBER,/* b - (float)b */
29 29
30PUSHNUMBERNEGW,/* w - (float)-w */ 30PUSHNUMBERNEGW,/* w - (float)-w */
31PUSHNUMBERNEG,/* b - (float)-b */ 31PUSHNUMBERNEG,/* b - (float)-b */
32 32
33PUSHCONSTANTW,/*w - CNST[w] */ 33PUSHCONSTANTW,/*w - CNST[w] */
34PUSHCONSTANT,/* b - CNST[b] */ 34PUSHCONSTANT,/* b - CNST[b] */
35 35
36PUSHUPVALUE,/* b - Closure[b] */ 36PUSHUPVALUE,/* b - Closure[b] */
37 37
38PUSHLOCAL,/* b - LOC[b] */ 38PUSHLOCAL,/* b - LOC[b] */
39 39
40GETGLOBALW,/* w - VAR[CNST[w]] */ 40GETGLOBALW,/* w - VAR[CNST[w]] */
41GETGLOBAL,/* b - VAR[CNST[b]] */ 41GETGLOBAL,/* b - VAR[CNST[b]] */
42 42
43GETTABLE,/* - i t t[i] */ 43GETTABLE,/* - i t t[i] */
44 44
45GETDOTTEDW,/* w t t[CNST[w]] */ 45GETDOTTEDW,/* w t t[CNST[w]] */
46GETDOTTED,/* b t t[CNST[b]] */ 46GETDOTTED,/* b t t[CNST[b]] */
47 47
48PUSHSELFW,/* w t t t[CNST[w]] */ 48PUSHSELFW,/* w t t t[CNST[w]] */
49PUSHSELF,/* b t t t[CNST[b]] */ 49PUSHSELF,/* b t t t[CNST[b]] */
50 50
51CREATEARRAYW,/* w - newarray(size = w) */ 51CREATEARRAYW,/* w - newarray(size = w) */
52CREATEARRAY,/* b - newarray(size = b) */ 52CREATEARRAY,/* b - newarray(size = b) */
53 53
54SETLOCAL,/* b x - LOC[b]=x */ 54SETLOCAL,/* b x - LOC[b]=x */
55SETLOCALDUP,/* b x x LOC[b]=x */ 55SETLOCALDUP,/* b x x LOC[b]=x */
56 56
57SETGLOBALW,/* w x - VAR[CNST[w]]=x */ 57SETGLOBALW,/* w x - VAR[CNST[w]]=x */
58SETGLOBAL,/* b x - VAR[CNST[b]]=x */ 58SETGLOBAL,/* b x - VAR[CNST[b]]=x */
59SETGLOBALDUPW,/*w x x VAR[CNST[w]]=x */ 59SETGLOBALDUPW,/*w x x VAR[CNST[w]]=x */
60SETGLOBALDUP,/* b x x VAR[CNST[b]]=x */ 60SETGLOBALDUP,/* b x x VAR[CNST[b]]=x */
61 61
62SETTABLEPOP,/* - v i t - t[i]=v */ 62SETTABLEPOP,/* - v i t - t[i]=v */
63SETTABLEPOPDUP,/* - v i t v t[i]=v */ 63SETTABLEPOPDUP,/* - v i t v t[i]=v */
64 64
65SETTABLE,/* b v a_b...a_1 i t a_b...a_1 i t t[i]=v */ 65SETTABLE,/* b v a_b...a_1 i t a_b...a_1 i t t[i]=v */
66SETTABLEDUP,/* b v a_b...a_1 i t v a_b...a_1 i t t[i]=v */ 66SETTABLEDUP,/* b v a_b...a_1 i t v a_b...a_1 i t t[i]=v */
67 67
68SETLISTW,/* w c v_c...v_1 t - t[i+w*FPF]=v_i */ 68SETLISTW,/* w c v_c...v_1 t - t[i+w*FPF]=v_i */
69SETLIST,/* b c v_c...v_1 t - t[i+b*FPF]=v_i */ 69SETLIST,/* b c v_c...v_1 t - t[i+b*FPF]=v_i */
70 70
71SETMAP,/* b v_b k_b ...v_0 k_0 t t t[k_i]=v_i */ 71SETMAP,/* b v_b k_b ...v_0 k_0 t t t[k_i]=v_i */
72 72
73NEQOP,/* - y x (x~=y)? 1 : nil */ 73NEQOP,/* - y x (x~=y)? 1 : nil */
74EQOP,/* - y x (x==y)? 1 : nil */ 74EQOP,/* - y x (x==y)? 1 : nil */
75LTOP,/* - y x (x<y)? 1 : nil */ 75LTOP,/* - y x (x<y)? 1 : nil */
76LEOP,/* - y x (x<y)? 1 : nil */ 76LEOP,/* - y x (x<y)? 1 : nil */
77GTOP,/* - y x (x>y)? 1 : nil */ 77GTOP,/* - y x (x>y)? 1 : nil */
78GEOP,/* - y x (x>=y)? 1 : nil */ 78GEOP,/* - y x (x>=y)? 1 : nil */
79ADDOP,/* - y x x+y */ 79ADDOP,/* - y x x+y */
80SUBOP,/* - y x x-y */ 80SUBOP,/* - y x x-y */
81MULTOP,/* - y x x*y */ 81MULTOP,/* - y x x*y */
82DIVOP,/* - y x x/y */ 82DIVOP,/* - y x x/y */
83POWOP,/* - y x x^y */ 83POWOP,/* - y x x^y */
84CONCOP,/* - y x x..y */ 84CONCOP,/* - y x x..y */
85MINUSOP,/* - x -x */ 85MINUSOP,/* - x -x */
86NOTOP,/* - x (x==nil)? 1 : nil */ 86NOTOP,/* - x (x==nil)? 1 : nil */
87 87
88ONTJMPW,/* w x (x!=nil)? x : - (x!=nil)? PC+=w */ 88ONTJMPW,/* w x (x!=nil)? x : - (x!=nil)? PC+=w */
89ONTJMP,/* b x (x!=nil)? x : - (x!=nil)? PC+=b */ 89ONTJMP,/* b x (x!=nil)? x : - (x!=nil)? PC+=b */
90ONFJMPW,/* w x (x==nil)? x : - (x==nil)? PC+=w */ 90ONFJMPW,/* w x (x==nil)? x : - (x==nil)? PC+=w */
91ONFJMP,/* b x (x==nil)? x : - (x==nil)? PC+=b */ 91ONFJMP,/* b x (x==nil)? x : - (x==nil)? PC+=b */
92JMPW,/* w - - PC+=w */ 92JMPW,/* w - - PC+=w */
93JMP,/* b - - PC+=b */ 93JMP,/* b - - PC+=b */
94IFFJMPW,/* w x - (x==nil)? PC+=w */ 94IFFJMPW,/* w x - (x==nil)? PC+=w */
95IFFJMP,/* b x - (x==nil)? PC+=b */ 95IFFJMP,/* b x - (x==nil)? PC+=b */
96IFTUPJMPW,/* w x - (x!=nil)? PC-=w */ 96IFTUPJMPW,/* w x - (x!=nil)? PC-=w */
97IFTUPJMP,/* b x - (x!=nil)? PC-=b */ 97IFTUPJMP,/* b x - (x!=nil)? PC-=b */
98IFFUPJMPW,/* w x - (x==nil)? PC-=w */ 98IFFUPJMPW,/* w x - (x==nil)? PC-=w */
99IFFUPJMP,/* b x - (x==nil)? PC-=b */ 99IFFUPJMP,/* b x - (x==nil)? PC-=b */
100 100
101CLOSUREW,/* w c v_c...v_1 closure(CNST[w], v_c...v_1) */ 101CLOSUREW,/* w c v_c...v_1 closure(CNST[w], v_c...v_1) */
102CLOSURE,/* b c v_c...v_1 closure(CNST[b], v_c...v_1) */ 102CLOSURE,/* b c v_c...v_1 closure(CNST[b], v_c...v_1) */
103 103
104CALLFUNC,/* b c v_c...v_1 f r_b...r_1 f(v1,...,v_c) */ 104CALLFUNC,/* b c v_c...v_1 f r_b...r_1 f(v1,...,v_c) */
105 105
106SETLINEW,/* w - - LINE=w */ 106SETLINEW,/* w - - LINE=w */
107SETLINE,/* b - - LINE=b */ 107SETLINE,/* b - - LINE=b */
108 108
109LONGARGW,/* w (add w*(1<<16) to arg of next instruction) */ 109LONGARGW,/* w (add w*(1<<16) to arg of next instruction) */
110LONGARG,/* b (add b*(1<<16) to arg of next instruction) */ 110LONGARG,/* b (add b*(1<<16) to arg of next instruction) */
111 111
112CHECKSTACK /* b (assert #temporaries == b; only for internal debuging!) */ 112CHECKSTACK /* b (assert #temporaries == b; only for internal debuging!) */
113 113
diff --git a/lparser.c b/lparser.c
index 4978f8e3..3cd05a6d 100644
--- a/lparser.c
+++ b/lparser.c
@@ -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
diff --git a/lparser.h b/lparser.h
index f94045d2..1bd3517c 100644
--- a/lparser.h
+++ b/lparser.h
@@ -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
diff --git a/lstrlib.c b/lstrlib.c
index eec14d34..551bd445 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -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},
diff --git a/ltm.c b/ltm.c
index 78620286..4a02ac8d 100644
--- a/ltm.c
+++ b/ltm.c
@@ -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
83void luaT_realtag (int tag) { 83void 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
diff --git a/lua.h b/lua.h
index c6374a44..30e4a867 100644
--- a/lua.h
+++ b/lua.h
@@ -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******************************************************************************/
diff --git a/lzio.c b/lzio.c
index 8e11ef4d..04fba442 100644
--- a/lzio.c
+++ b/lzio.c
@@ -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 --- */
67int zread (ZIO *z, void *b, int n) 67int 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;
diff --git a/manual.tex b/manual.tex
index be5672d5..cbde48e0 100644
--- a/manual.tex
+++ b/manual.tex
@@ -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
123The Lua language and this implementation have been entirely designed and 123The Lua language and this implementation have been entirely designed and
124written by Waldemar Celes, Roberto Ierusalimschy and Luiz Henrique de 124written by Waldemar Celes, Roberto Ierusalimschy and Luiz Henrique de
125Figueiredo at TeCGraf, PUC-Rio. This implementation contains no third-party 125Figueiredo at TeCGraf, PUC-Rio.
126code. 126
127\noindent
128This implementation contains no third-party code.
127\end{quotation} 129\end{quotation}
128 130
129\newpage 131\newpage