Unified · Split
| @@ -1,34 +1,33 @@ | |||
| 1 | MANIFEST contents of Lua 5.1 distribution on Tue Feb 7 15:05:04 BRST 2006 | 1 | MANIFEST contents of Lua 5.1 distribution on Fri Feb 10 17:19:52 BRST 2006 |
| 2 | lua-5.1 | 2 | lua-5.1 |
| 3 | lua-5.1/COPYRIGHT | 3 | lua-5.1/COPYRIGHT |
| 4 | lua-5.1/HISTORY | ||
| 5 | lua-5.1/INSTALL | ||
| 6 | lua-5.1/MANIFEST | ||
| 7 | lua-5.1/Makefile | ||
| 8 | lua-5.1/README | ||
| 9 | lua-5.1/doc | 4 | lua-5.1/doc |
| 10 | lua-5.1/doc/contents.html | 5 | lua-5.1/doc/contents.html |
| 11 | lua-5.1/doc/logo.gif | 6 | lua-5.1/doc/logo.gif |
| 12 | lua-5.1/doc/lua.1 | 7 | lua-5.1/doc/lua.1 |
| 13 | lua-5.1/doc/lua.css | ||
| 14 | lua-5.1/doc/lua.html | ||
| 15 | lua-5.1/doc/luac.1 | 8 | lua-5.1/doc/luac.1 |
| 16 | lua-5.1/doc/luac.html | 9 | lua-5.1/doc/luac.html |
| 10 | lua-5.1/doc/lua.css | ||
| 11 | lua-5.1/doc/lua.html | ||
| 17 | lua-5.1/doc/manual.html | 12 | lua-5.1/doc/manual.html |
| 18 | lua-5.1/doc/readme.html | 13 | lua-5.1/doc/readme.html |
| 19 | lua-5.1/etc | 14 | lua-5.1/etc |
| 20 | lua-5.1/etc/Makefile | ||
| 21 | lua-5.1/etc/README | ||
| 22 | lua-5.1/etc/all.c | 15 | lua-5.1/etc/all.c |
| 23 | lua-5.1/etc/lua.hpp | 16 | lua-5.1/etc/lua.hpp |
| 24 | lua-5.1/etc/lua.ico | 17 | lua-5.1/etc/lua.ico |
| 25 | lua-5.1/etc/lua.pc | 18 | lua-5.1/etc/lua.pc |
| 26 | lua-5.1/etc/luavs.bat | 19 | lua-5.1/etc/luavs.bat |
| 20 | lua-5.1/etc/Makefile | ||
| 27 | lua-5.1/etc/min.c | 21 | lua-5.1/etc/min.c |
| 28 | lua-5.1/etc/noparser.c | 22 | lua-5.1/etc/noparser.c |
| 23 | lua-5.1/etc/README | ||
| 29 | lua-5.1/etc/strict.lua | 24 | lua-5.1/etc/strict.lua |
| 25 | lua-5.1/HISTORY | ||
| 26 | lua-5.1/INSTALL | ||
| 27 | lua-5.1/Makefile | ||
| 28 | lua-5.1/MANIFEST | ||
| 29 | lua-5.1/README | ||
| 30 | lua-5.1/src | 30 | lua-5.1/src |
| 31 | lua-5.1/src/Makefile | ||
| 32 | lua-5.1/src/lapi.c | 31 | lua-5.1/src/lapi.c |
| 33 | lua-5.1/src/lapi.h | 32 | lua-5.1/src/lapi.h |
| 34 | lua-5.1/src/lauxlib.c | 33 | lua-5.1/src/lauxlib.c |
| @@ -73,9 +72,9 @@ lua-5.1/src/ltablib.c · 38 unmodified lines | |||
| 73 | lua-5.1/src/ltm.c | 72 | lua-5.1/src/ltm.c |
| 74 | lua-5.1/src/ltm.h | 73 | lua-5.1/src/ltm.h |
| 75 | lua-5.1/src/lua.c | 74 | lua-5.1/src/lua.c |
| 76 | lua-5.1/src/lua.h | ||
| 77 | lua-5.1/src/luac.c | 75 | lua-5.1/src/luac.c |
| 78 | lua-5.1/src/luaconf.h | 76 | lua-5.1/src/luaconf.h |
| 77 | lua-5.1/src/lua.h | ||
| 79 | lua-5.1/src/lualib.h | 78 | lua-5.1/src/lualib.h |
| 80 | lua-5.1/src/lundump.c | 79 | lua-5.1/src/lundump.c |
| 81 | lua-5.1/src/lundump.h | 80 | lua-5.1/src/lundump.h |
| @@ -83,21 +82,22 @@ lua-5.1/src/lvm.c · 1 unmodified line | |||
| 83 | lua-5.1/src/lvm.h | 82 | lua-5.1/src/lvm.h |
| 84 | lua-5.1/src/lzio.c | 83 | lua-5.1/src/lzio.c |
| 85 | lua-5.1/src/lzio.h | 84 | lua-5.1/src/lzio.h |
| 85 | lua-5.1/src/Makefile | ||
| 86 | lua-5.1/src/print.c | 86 | lua-5.1/src/print.c |
| 87 | lua-5.1/test | 87 | lua-5.1/test |
| 88 | lua-5.1/test/README | ||
| 89 | lua-5.1/test/bisect.lua | 88 | lua-5.1/test/bisect.lua |
| 90 | lua-5.1/test/cf.lua | 89 | lua-5.1/test/cf.lua |
| 91 | lua-5.1/test/echo.lua | 90 | lua-5.1/test/echo.lua |
| 92 | lua-5.1/test/env.lua | 91 | lua-5.1/test/env.lua |
| 93 | lua-5.1/test/factorial.lua | 92 | lua-5.1/test/factorial.lua |
| 94 | lua-5.1/test/fib.lua | ||
| 95 | lua-5.1/test/fibfor.lua | 93 | lua-5.1/test/fibfor.lua |
| 94 | lua-5.1/test/fib.lua | ||
| 96 | lua-5.1/test/globals.lua | 95 | lua-5.1/test/globals.lua |
| 97 | lua-5.1/test/hello.lua | 96 | lua-5.1/test/hello.lua |
| 98 | lua-5.1/test/life.lua | 97 | lua-5.1/test/life.lua |
| 99 | lua-5.1/test/luac.lua | 98 | lua-5.1/test/luac.lua |
| 100 | lua-5.1/test/printf.lua | 99 | lua-5.1/test/printf.lua |
| 100 | lua-5.1/test/README | ||
| 101 | lua-5.1/test/readonly.lua | 101 | lua-5.1/test/readonly.lua |
| 102 | lua-5.1/test/sieve.lua | 102 | lua-5.1/test/sieve.lua |
| 103 | lua-5.1/test/sort.lua | 103 | lua-5.1/test/sort.lua |
| @@ -93,7 +93,9 @@ Lua 5.1 Reference Manual · 92 unmodified lines | |||
| 93 | <LI><A HREF="manual.html#5.9">5.9 - The Debug Library</A> | 93 | <LI><A HREF="manual.html#5.9">5.9 - The Debug Library</A> |
| 94 | </UL> | 94 | </UL> |
| 95 | <LI><A HREF="manual.html#6">6 - Lua Stand-alone</A> | 95 | <LI><A HREF="manual.html#6">6 - Lua Stand-alone</A> |
| 96 | <LI><A HREF="manual.html#incompat">Incompatibilities with the Previous Version</A> | ||
| 96 | <LI><A HREF="manual.html#BNF">The Complete Syntax of Lua</A> | 97 | <LI><A HREF="manual.html#BNF">The Complete Syntax of Lua</A> |
| 98 | |||
| 97 | </UL> | 99 | </UL> |
| 98 | 100 | ||
| 99 | <H2><A NAME="quick">Quick index</A></H2> | 101 | <H2><A NAME="quick">Quick index</A></H2> |
| @@ -396,7 +398,7 @@ Lua 5.1 Reference Manual · 296 unmodified lines | |||
| 396 | <HR> | 398 | <HR> |
| 397 | <SMALL> | 399 | <SMALL> |
| 398 | Last update: | 400 | Last update: |
| 399 | Tue Feb 7 14:37:59 BRST 2006 | 401 | Fri Feb 10 17:15:37 BRST 2006 |
| 400 | </SMALL> | 402 | </SMALL> |
| 401 | 403 | ||
| 402 | </BODY> | 404 | </BODY> |
| @@ -6059,7 +6059,7 @@ is a more portable solution.) · 6058 unmodified lines | |||
| 6059 | 6059 | ||
| 6060 | <p><hr></hr> | 6060 | <p><hr></hr> |
| 6061 | 6061 | ||
| 6062 | <p><h1>Incompatibilities with the Previous Version</h1> | 6062 | <p><a name="incompat"></a><h1>Incompatibilities with the Previous Version</h1> |
| 6063 | 6063 | ||
| 6064 | 6064 | ||
| 6065 | <p>Here we list the incompatibilities that may be found when moving a program | 6065 | <p>Here we list the incompatibilities that may be found when moving a program |
| @@ -6118,6 +6118,10 @@ Function <code>loadlib</code> was renamed <a href="#pdf-package.loadlib"><code>p · 52 unmodified lines | |||
| 6118 | Function <code>math.mod</code> was renamed <a href="#pdf-math.fmod"><code>math.fmod</code></a>. | 6118 | Function <code>math.mod</code> was renamed <a href="#pdf-math.fmod"><code>math.fmod</code></a>. |
| 6119 | (Option <code>LUA_COMPAT_MOD</code>) | 6119 | (Option <code>LUA_COMPAT_MOD</code>) |
| 6120 | 6120 | ||
| 6121 | <p><li> | ||
| 6122 | Functions <code>table.foreach</code> and <code>table.foreachi</code> are deprecated. | ||
| 6123 | You can use a for loop with <code>pairs</code> or <code>ipairs</code> instead. | ||
| 6124 | |||
| 6121 | <p><li> | 6125 | <p><li> |
| 6122 | There were substantial changes in function <a href="#pdf-require"><code>require</code></a> due to | 6126 | There were substantial changes in function <a href="#pdf-require"><code>require</code></a> due to |
| 6123 | the new module system. | 6127 | the new module system. |
| @@ -16,7 +16,7 @@ MYLIBS= -lm · 15 unmodified lines | |||
| 16 | RM= rm -f | 16 | RM= rm -f |
| 17 | 17 | ||
| 18 | default: | 18 | default: |
| 19 | @echo 'Please choose a target: min noparser one clean' | 19 | @echo 'Please choose a target: min noparser one strict clean' |
| 20 | 20 | ||
| 21 | min: min.c | 21 | min: min.c |
| 22 | $(CC) $(CFLAGS) $@.c -L$(LIB) -llua $(MYLIBS) | 22 | $(CC) $(CFLAGS) $@.c -L$(LIB) -llua $(MYLIBS) |
| @@ -5,6 +5,7 @@ · 4 unmodified lines | |||
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #include <stdio.h> | 7 | #include <stdio.h> |
| 8 | |||
| 8 | #include "lua.h" | 9 | #include "lua.h" |
| 9 | #include "lauxlib.h" | 10 | #include "lauxlib.h" |
| 10 | 11 | ||
| @@ -17,32 +18,22 @@ static int print(lua_State *L) · 6 unmodified lines | |||
| 17 | if (i>1) printf("\t"); | 18 | if (i>1) printf("\t"); |
| 18 | if (lua_isstring(L,i)) | 19 | if (lua_isstring(L,i)) |
| 19 | printf("%s",lua_tostring(L,i)); | 20 | printf("%s",lua_tostring(L,i)); |
| 20 | else if (lua_isnil(L,i)) | 21 | else if (lua_isnil(L,i)==2) |
| 21 | printf("%s","nil"); | 22 | printf("%s","nil"); |
| 22 | else if (lua_isboolean(L,i)) | 23 | else if (lua_isboolean(L,i)) |
| 23 | printf("%s",lua_toboolean(L,i) ? "true" : "false"); | 24 | printf("%s",lua_toboolean(L,i) ? "true" : "false"); |
| 24 | else | 25 | else |
| 25 | printf("%s:%p",lua_typename(L,lua_type(L,i)),lua_topointer(L,i)); | 26 | printf("%s:%p",luaL_typename(L,i),lua_topointer(L,i)); |
| 26 | } | 27 | } |
| 27 | printf("\n"); | 28 | printf("\n"); |
| 28 | return 0; | 29 | return 0; |
| 29 | } | 30 | } |
| 30 | 31 | ||
| 31 | static const char *getF(lua_State *L, void *ud, size_t *size) | ||
| 32 | { | ||
| 33 | FILE *f=(FILE *)ud; | ||
| 34 | static char buff[512]; | ||
| 35 | if (feof(f)) return NULL; | ||
| 36 | *size=fread(buff,1,sizeof(buff),f); | ||
| 37 | return (*size>0) ? buff : NULL; | ||
| 38 | } | ||
| 39 | |||
| 40 | int main(void) | 32 | int main(void) |
| 41 | { | 33 | { |
| 42 | lua_State *L=lua_open(); | 34 | lua_State *L=lua_open(); |
| 43 | lua_register(L,"print",print); | 35 | lua_register(L,"print",print); |
| 44 | if (lua_load(L,getF,stdin,"=stdin") || lua_pcall(L,0,0,0)) | 36 | if (luaL_dofile(L,NULL)!=0) fprintf(stderr,"%s\n",lua_tostring(L,-1)); |
| 45 | fprintf(stderr,"%s\n",lua_tostring(L,-1)); | ||
| 46 | lua_close(L); | 37 | lua_close(L); |
| 47 | return 0; | 38 | return 0; |
| 48 | } | 39 | } |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lobject.c,v 2.21 2006/01/10 12:50:00 roberto Exp $ | 2 | ** $Id: lobject.c,v 2.22 2006/02/10 17:43:52 roberto Exp $ |
| 3 | ** Some generic functions over Lua objects | 3 | ** Some generic functions over Lua objects |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -91,6 +91,8 @@ int luaO_str2d (const char *s, lua_Number *result) { · 85 unmodified lines | |||
| 91 | char *endptr; | 91 | char *endptr; |
| 92 | *result = lua_str2number(s, &endptr); | 92 | *result = lua_str2number(s, &endptr); |
| 93 | if (endptr == s) return 0; /* conversion failed */ | 93 | if (endptr == s) return 0; /* conversion failed */ |
| 94 | if (*endptr == 'x' || *endptr == 'X') /* maybe an hexadecimal constant? */ | ||
| 95 | *result = cast_num(strtoul(s, &endptr, 16)); | ||
| 94 | if (*endptr == '\0') return 1; /* most common case */ | 96 | if (*endptr == '\0') return 1; /* most common case */ |
| 95 | while (isspace(cast(unsigned char, *endptr))) endptr++; | 97 | while (isspace(cast(unsigned char, *endptr))) endptr++; |
| 96 | if (*endptr != '\0') return 0; /* invalid trailing characters? */ | 98 | if (*endptr != '\0') return 0; /* invalid trailing characters? */ |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: luaconf.h,v 1.80 2006/01/27 13:54:39 roberto Exp $ | 2 | ** $Id: luaconf.h,v 1.81 2006/02/10 17:44:06 roberto Exp $ |
| 3 | ** Configuration file for Lua | 3 | ** Configuration file for Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -650,9 +650,9 @@ union luai_Cast { double l_d; long l_l; }; · 644 unmodified lines | |||
| 650 | 650 | ||
| 651 | #else | 651 | #else |
| 652 | 652 | ||
| 653 | #define lua_popen(L,c,m) \ | 653 | #define lua_popen(L,c,m) ((void)((void)c, m), \ |
| 654 | ((void)c, (void)m, luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0) | 654 | luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0) |
| 655 | #define lua_pclose(L,file) ((void)L, (void)file, 0) | 655 | #define lua_pclose(L,file) ((void)((void)L, file), 0) |
| 656 | 656 | ||
| 657 | #endif | 657 | #endif |
| 658 | 658 | ||