History

Lua 5.1-rc3

Lua Team committed 20 years ago

Commit 010ebd01 parent 2fee0d617 files · +480 −377Browse files

Unified · Split

17 files
  1. HISTORY +1 −1
  2. INSTALL +3 −0
  3. MANIFEST +14 −14
  4. Makefile +24 −11
  5. doc/contents.html +21 −7
  6. doc/lua.html +1 −1
  7. doc/luac.html +5 −5
  8. doc/manual.html +362 −306
  9. etc/Makefile +15 −6
  10. etc/README +7 −2
  11. etc/lua.pc +9 −9
  12. src/Makefile +2 −0
  13. src/liolib.c +2 −2
  14. src/llex.c +2 −2
  15. src/loslib.c +5 −4
  16. src/lstate.h +5 −5
  17. src/luaconf.h +2 −2
HISTORY+1−1
@@ -14,7 +14,7 @@ HISTORY for Lua 5.1 · 13 unmodified lines
1414 API:
1515 + new functions: lua_createtable, lua_get(set)field, lua_push(to)integer.
1616 + user supplies memory allocator (lua_open becomes lua_newstate).
17− + luaopen_* functionst be called through Lua.
17+ + luaopen_* functionst must be called through Lua.
1818 Implementation:
1919 + new configuration scheme via luaconf.h.
2020 + incremental garbage collection.
INSTALL+3−0
@@ -23,6 +23,9 @@ INSTALL for Lua 5.1 · 22 unmodified lines
2323 place and the way to install files are defined in Makefile. You must
2424 have the right permissions to install files.
2525
26+ If you want to build and install Lua in one step, do "make xxx install",
27+ where xxx is your platform name.
28+
2629 If you want to install Lua locally, then do "make local". This will
2730 create directories bin, include, lib, man, and install Lua there as
2831 follows:
MANIFEST+14−14
@@ -1,33 +1,34 @@
1−MANIFEST contents of Lua 5.1 distribution on Tue Jan 24 16:12:03 BRST 2006
1+MANIFEST contents of Lua 5.1 distribution on Tue Feb 7 15:05:04 BRST 2006
22 lua-5.1
33 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
49 lua-5.1/doc
510 lua-5.1/doc/contents.html
611 lua-5.1/doc/logo.gif
712 lua-5.1/doc/lua.1
8−lua-5.1/doc/luac.1
9−lua-5.1/doc/luac.html
1013 lua-5.1/doc/lua.css
1114 lua-5.1/doc/lua.html
15+lua-5.1/doc/luac.1
16+lua-5.1/doc/luac.html
1217 lua-5.1/doc/manual.html
1318 lua-5.1/doc/readme.html
1419 lua-5.1/etc
20+lua-5.1/etc/Makefile
21+lua-5.1/etc/README
1522 lua-5.1/etc/all.c
1623 lua-5.1/etc/lua.hpp
1724 lua-5.1/etc/lua.ico
1825 lua-5.1/etc/lua.pc
1926 lua-5.1/etc/luavs.bat
20−lua-5.1/etc/Makefile
2127 lua-5.1/etc/min.c
2228 lua-5.1/etc/noparser.c
23−lua-5.1/etc/README
2429 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
3030 lua-5.1/src
31+lua-5.1/src/Makefile
3132 lua-5.1/src/lapi.c
3233 lua-5.1/src/lapi.h
3334 lua-5.1/src/lauxlib.c
@@ -72,9 +73,9 @@ lua-5.1/src/ltablib.c · 38 unmodified lines
7273 lua-5.1/src/ltm.c
7374 lua-5.1/src/ltm.h
7475 lua-5.1/src/lua.c
76+lua-5.1/src/lua.h
7577 lua-5.1/src/luac.c
7678 lua-5.1/src/luaconf.h
77−lua-5.1/src/lua.h
7879 lua-5.1/src/lualib.h
7980 lua-5.1/src/lundump.c
8081 lua-5.1/src/lundump.h
@@ -82,22 +83,21 @@ lua-5.1/src/lvm.c · 1 unmodified line
8283 lua-5.1/src/lvm.h
8384 lua-5.1/src/lzio.c
8485 lua-5.1/src/lzio.h
85−lua-5.1/src/Makefile
8686 lua-5.1/src/print.c
8787 lua-5.1/test
88+lua-5.1/test/README
8889 lua-5.1/test/bisect.lua
8990 lua-5.1/test/cf.lua
9091 lua-5.1/test/echo.lua
9192 lua-5.1/test/env.lua
9293 lua-5.1/test/factorial.lua
93−lua-5.1/test/fibfor.lua
9494 lua-5.1/test/fib.lua
95+lua-5.1/test/fibfor.lua
9596 lua-5.1/test/globals.lua
9697 lua-5.1/test/hello.lua
9798 lua-5.1/test/life.lua
9899 lua-5.1/test/luac.lua
99100 lua-5.1/test/printf.lua
100−lua-5.1/test/README
101101 lua-5.1/test/readonly.lua
102102 lua-5.1/test/sieve.lua
103103 lua-5.1/test/sort.lua
Makefile+24−11
@@ -22,10 +22,17 @@ INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V · 21 unmodified lines
2222 # How to install. You may prefer "install" instead of "cp" if you have it.
2323 # To remove debug information from binaries, use "install -s" in INSTALL_EXEC.
2424 #
25−INSTALL_EXEC= cp
26−INSTALL_DATA= cp
27−#INSTALL_EXEC= install -m 0755
28−#INSTALL_DATA= install -m 0644
25+INSTALL_EXEC= $(CP)
26+INSTALL_DATA= $(CP)
27+#INSTALL_EXEC= $(INSTALL) -m 0755
28+#INSTALL_DATA= $(INSTALL) -m 0644
29+
30+# Utilities.
31+CP= cp
32+FIND= find
33+INSTALL= install
34+MKDIR= mkdir
35+RANLIB= ranlib
2936
3037 # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
3138
@@ -46,15 +53,16 @@ all: $(PLAT) · 14 unmodified lines
4653 $(PLATS) clean:
4754 cd src; $(MAKE) $@
4855
49−test: all
56+test: dummy
5057 src/lua test/hello.lua
5158
52−install:
53− cd src; mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
59+install: dummy
60+ cd src; $(MKDIR) -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
5461 cd src; $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
5562 cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
5663 cd src; $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
5764 cd doc; $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
65+# $(RANLIB) $(INSTALL_LIB)/$(TO_LIB)
5866
5967 local:
6068 $(MAKE) install INSTALL_TOP=.. INSTALL_EXEC="cp -p" INSTALL_DATA="cp -p"
@@ -62,6 +70,9 @@ local: · 1 unmodified line
6270 none:
6371 @echo "Please choose a platform: $(PLATS)"
6472
73+# make may get confused with test/ and INSTALL in a case-insensitive OS
74+dummy:
75+
6576 # echo config parameters
6677 echo:
6778 @echo ""
@@ -77,11 +88,10 @@ echo: · 9 unmodified lines
7788 @echo "INSTALL_INC = $(INSTALL_INC)"
7889 @echo "INSTALL_LIB = $(INSTALL_LIB)"
7990 @echo "INSTALL_MAN = $(INSTALL_MAN)"
80− @echo "INSTALL_EXEC = $(INSTALL_EXEC)"
81− @echo "INSTALL_DATA = $(INSTALL_DATA)"
8291 @echo "INSTALL_LMOD = $(INSTALL_LMOD)"
8392 @echo "INSTALL_CMOD = $(INSTALL_CMOD)"
84− @echo "INSTALL_CMOD = $(INSTALL_CMOD)"
93+ @echo "INSTALL_EXEC = $(INSTALL_EXEC)"
94+ @echo "INSTALL_DATA = $(INSTALL_DATA)"
8595 @echo ""
8696 @echo "See also src/luaconf.h ."
8797 @echo ""
@@ -104,6 +114,9 @@ lecho: · 16 unmodified lines
104114
105115 # show what has changed since we unpacked
106116 newer:
107− @find . -newer MANIFEST -type f
117+ @$(FIND) . -newer MANIFEST -type f
118+
119+# list targets that do not create files (but not all makes understand .PHONY)
120+.PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho newer
108121
109122 # (end of Makefile)
doc/contents.html+21−7
@@ -154,24 +154,31 @@ Lua 5.1 Reference Manual · 153 unmodified lines
154154 <A HREF="manual.html#pdf-math.abs">math.abs</A><BR>
155155 <A HREF="manual.html#pdf-math.acos">math.acos</A><BR>
156156 <A HREF="manual.html#pdf-math.asin">math.asin</A><BR>
157−<A HREF="manual.html#pdf-math.atan">math.atan</A><BR>
158157 <A HREF="manual.html#pdf-math.atan2">math.atan2</A><BR>
158+<A HREF="manual.html#pdf-math.atan">math.atan</A><BR>
159159 <A HREF="manual.html#pdf-math.ceil">math.ceil</A><BR>
160−<A HREF="manual.html#pdf-math.cos">math.cos</A><BR>
161160 <A HREF="manual.html#pdf-math.cosh">math.cosh</A><BR>
162−<A HREF="manual.html#pdf-math.def">math.def</A><BR>
161+<A HREF="manual.html#pdf-math.cos">math.cos</A><BR>
162+<A HREF="manual.html#pdf-math.deg">math.deg</A><BR>
163163 <A HREF="manual.html#pdf-math.exp">math.exp</A><BR>
164164 <A HREF="manual.html#pdf-math.floor">math.floor</A><BR>
165165 <A HREF="manual.html#pdf-math.fmod">math.fmod</A><BR>
166+<A HREF="manual.html#pdf-math.frexp">math.frexp</A><BR>
166167 <A HREF="manual.html#pdf-math.ldexp">math.ldexp</A><BR>
167−<A HREF="manual.html#pdf-math.log">math.log</A><BR>
168168 <A HREF="manual.html#pdf-math.log10">math.log10</A><BR>
169+<A HREF="manual.html#pdf-math.log">math.log</A><BR>
170+<A HREF="manual.html#pdf-math.max">math.max</A><BR>
171+<A HREF="manual.html#pdf-math.min">math.min</A><BR>
172+<A HREF="manual.html#pdf-math.modf">math.modf</A><BR>
169173 <A HREF="manual.html#pdf-math.pow">math.pow</A><BR>
170−<A HREF="manual.html#pdf-math.sin">math.sin</A><BR>
174+<A HREF="manual.html#pdf-math.rad">math.rad</A><BR>
175+<A HREF="manual.html#pdf-math.random">math.random</A><BR>
176+<A HREF="manual.html#pdf-math.randomseed">math.randomseed</A><BR>
171177 <A HREF="manual.html#pdf-math.sinh">math.sinh</A><BR>
178+<A HREF="manual.html#pdf-math.sin">math.sin</A><BR>
172179 <A HREF="manual.html#pdf-math.sqrt">math.sqrt</A><BR>
173−<A HREF="manual.html#pdf-math.tan">math.tan</A><BR>
174180 <A HREF="manual.html#pdf-math.tanh">math.tanh</A><BR>
181+<A HREF="manual.html#pdf-math.tan">math.tan</A><BR>
175182 <A HREF="manual.html#pdf-module">module</A><BR>
176183 <A HREF="manual.html#pdf-next">next</A><BR>
177184 <A HREF="manual.html#pdf-os.clock">os.clock</A><BR>
@@ -225,6 +232,7 @@ Lua 5.1 Reference Manual · 47 unmodified lines
225232 <A HREF="manual.html#pdf-type">type</A><BR>
226233 <A HREF="manual.html#pdf-unpack">unpack</A><BR>
227234 <A HREF="manual.html#pdf-xpcall">xpcall</A><BR>
235+
228236 </TD>
229237 <TD>
230238 <H3>API</H3>
@@ -251,6 +259,7 @@ Lua 5.1 Reference Manual · 20 unmodified lines
251259 <A HREF="manual.html#lua_getallocf">lua_getallocf</A><BR>
252260 <A HREF="manual.html#lua_getfenv">lua_getfenv</A><BR>
253261 <A HREF="manual.html#lua_getfield">lua_getfield</A><BR>
262+<A HREF="manual.html#lua_getglobal">lua_getglobal</A><BR>
254263 <A HREF="manual.html#lua_gethook">lua_gethook</A><BR>
255264 <A HREF="manual.html#lua_gethookcount">lua_gethookcount</A><BR>
256265 <A HREF="manual.html#lua_gethookmask">lua_gethookmask</A><BR>
@@ -300,12 +309,14 @@ Lua 5.1 Reference Manual · 43 unmodified lines
300309 <A HREF="manual.html#lua_rawgeti">lua_rawgeti</A><BR>
301310 <A HREF="manual.html#lua_rawset">lua_rawset</A><BR>
302311 <A HREF="manual.html#lua_rawseti">lua_rawseti</A><BR>
312+<A HREF="manual.html#lua_register">lua_register</A><BR>
303313 <A HREF="manual.html#lua_remove">lua_remove</A><BR>
304314 <A HREF="manual.html#lua_replace">lua_replace</A><BR>
305315 <A HREF="manual.html#lua_resume">lua_resume</A><BR>
306316 <A HREF="manual.html#lua_setallocf">lua_setallocf</A><BR>
307317 <A HREF="manual.html#lua_setfenv">lua_setfenv</A><BR>
308318 <A HREF="manual.html#lua_setfield">lua_setfield</A><BR>
319+<A HREF="manual.html#lua_setglobal">lua_setglobal</A><BR>
309320 <A HREF="manual.html#lua_sethook">lua_sethook</A><BR>
310321 <A HREF="manual.html#lua_setlocal">lua_setlocal</A><BR>
311322 <A HREF="manual.html#lua_setmetatable">lua_setmetatable</A><BR>
@@ -326,6 +337,7 @@ Lua 5.1 Reference Manual · 14 unmodified lines
326337 <A HREF="manual.html#lua_typename">lua_typename</A><BR>
327338 <A HREF="manual.html#lua_xmove">lua_xmove</A><BR>
328339 <A HREF="manual.html#lua_yield">lua_yield</A><BR>
340+
329341 </TD>
330342 <TD>
331343 <H3>Auxiliary library</H3>
@@ -360,6 +372,7 @@ Lua 5.1 Reference Manual · 28 unmodified lines
360372 <A HREF="manual.html#luaL_loadstring">luaL_loadstring</A><BR>
361373 <A HREF="manual.html#luaL_newmetatable">luaL_newmetatable</A><BR>
362374 <A HREF="manual.html#luaL_newstate">luaL_newstate</A><BR>
375+<A HREF="manual.html#luaL_openlibs">luaL_openlibs</A><BR>
363376 <A HREF="manual.html#luaL_optint">luaL_optint</A><BR>
364377 <A HREF="manual.html#luaL_optinteger">luaL_optinteger</A><BR>
365378 <A HREF="manual.html#luaL_optlong">luaL_optlong</A><BR>
@@ -374,6 +387,7 @@ Lua 5.1 Reference Manual · 8 unmodified lines
374387 <A HREF="manual.html#luaL_typerror">luaL_typerror</A><BR>
375388 <A HREF="manual.html#luaL_unref">luaL_unref</A><BR>
376389 <A HREF="manual.html#luaL_where">luaL_where</A><BR>
390+
377391 </TD>
378392 </TR>
379393 </TABLE>
@@ -382,7 +396,7 @@ Lua 5.1 Reference Manual · 2 unmodified lines
382396 <HR>
383397 <SMALL>
384398 Last update:
385−Tue Jan 10 10:10:22 BRST 2006
399+Tue Feb 7 14:37:59 BRST 2006
386400 </SMALL>
387401
388402 </BODY>
doc/lua.html+1−1
@@ -149,7 +149,7 @@ is executed. · 148 unmodified lines
149149 <P>
150150 <B>-l </B><I>name</I>
151151 call
152−<B>require(' name</B><I>')</I>
152+<B>require</B>('<I>name</I>')
153153 before executing
154154 <I>script</I>.
155155 Typically used to load libraries.
doc/luac.html+5−5
@@ -28,13 +28,13 @@ protecting source code from accidental user changes, · 27 unmodified lines
2828 and
2929 off-line syntax checking.
3030 <P>
31−Pre-compiling does not imply faster execution
31+Precompiling does not imply faster execution
3232 because in Lua chunks are always compiled into bytecodes before being executed.
3333 <B>luac</B>
3434 simply allows those bytecodes to be saved in a file for later execution.
3535 <P>
36−Pre-compiled chunks are not necessarily smaller than the corresponding source.
37−The main goal in pre-compiling is faster loading.
36+Precompiled chunks are not necessarily smaller than the corresponding source.
37+The main goal in precompiling is faster loading.
3838 <P>
3939 The binary files created by
4040 <B>luac</B>
@@ -54,9 +54,9 @@ In the command line, · 13 unmodified lines
5454 you can mix
5555 text files containing Lua source and
5656 binary files containing precompiled chunks.
57−This is useful to combine several precompiled chunks,
57+This is useful because several precompiled chunks,
5858 even from different (but compatible) platforms,
59−into a single precompiled chunk.
59+can be combined into a single precompiled chunk.
6060 <P>
6161 You can use
6262 <B>'-'</B>
doc/manual.html+362−306
@@ -8,9 +8,9 @@ · 7 unmodified lines
88
99 <body bgcolor="#FFFFFF">
1010
11−<hr />
11+<hr></hr>
1212 <h1>
13−<a href="http://www.lua.org/home.html"><img src="logo.gif" alt="[Lua logo]" border="0" /></a>
13+<a href="http://www.lua.org/home.html"><img src="logo.gif" alt="[Lua logo]" border="0"></img></a>
1414 Lua 5.1 Reference Manual
1515 </h1>
1616
@@ -20,7 +20,7 @@ by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, Waldemar Celes · 3 unmodified lines
2020 <a href="http://www.lua.org/copyright.html">Copyright</a>
2121 &copy; 2006 Lua.org, PUC-Rio. All rights reserved.
2222 </small>
23−<hr />
23+<hr></hr>
2424
2525 <p>
2626 <p>
@@ -302,7 +302,7 @@ Any arithmetic operation applied to a string tries to convert · 275 unmodified lines
302302 that string to a number, following the usual conversion rules.
303303 Conversely, whenever a number is used where a string is expected,
304304 the number is converted to a string, in a reasonable format.
305−For complete control of how numbers are converted to strings,
305+For complete control over how numbers are converted to strings,
306306 use the <code>format</code> function from the string library
307307 (see <a href="#pdf-string.format"><code>string.format</code></a>).
308308
@@ -1554,9 +1554,9 @@ They are used as the default environment for other Lua functions · 1245 unmodified lines
15541554 created by that function.
15551555
15561556 <p>You can change the environment of a Lua function or the
1557−running thread calling <a href="#pdf-setfenv"><code>setfenv</code></a>.
1557+running thread by calling <a href="#pdf-setfenv"><code>setfenv</code></a>.
15581558 You can get the environment of a Lua function or the running thread
1559−calling <a href="#pdf-getfenv"><code>getfenv</code></a>.
1559+by calling <a href="#pdf-getfenv"><code>getfenv</code></a>.
15601560 To manipulate the environment of other objects
15611561 (userdata, C functions, other threads) you must
15621562 use the C API.
@@ -1565,7 +1565,7 @@ use the C API. · 2 unmodified lines
15651565
15661566 <p>Lua performs automatic memory management.
15671567 That means that
1568−you do not have to worry neither about allocating memory for new objects
1568+you have to worry neither about allocating memory for new objects
15691569 nor about freeing it when the objects are no longer needed.
15701570 Lua manages memory automatically by running
15711571 a <em>garbage collector</em> from time to time
@@ -1577,7 +1577,7 @@ tables, userdata, functions, threads, and strings. · 5 unmodified lines
15771577 <p>Lua implements an incremental mark-and-sweep collector.
15781578 It uses two numbers to control its garbage-collection cycles:
15791579 the <em>garbage-collector pause</em> and
1580−the <em>garbage-collector multiplier</em>.
1580+the <em>garbage-collector step multiplier</em>.
15811581
15821582 <p>The garbage-collector pause
15831583 controls how long the collector waits before starting a new cycle.
@@ -1587,7 +1587,7 @@ start a new cycle. · 3 unmodified lines
15871587 A value of 2 means that the collector waits more or less to double
15881588 the total memory in use before starting a new cycle.
15891589
1590−<p>The garbage-collector multiplier
1590+<p>The step multiplier
15911591 controls the relative speed of the collector relative to
15921592 memory allocation.
15931593 Larger values make the collector more aggressive but also increases
@@ -1898,7 +1898,7 @@ or a light userdata with the address of a C object in your code. · 304 unmodified lines
18981898
18991899 <p>The integer keys in the registry are used by the reference mechanism,
19001900 implemented by the auxiliary library,
1901−and therefore should not be used by other purposes.
1901+and therefore should not be used for other purposes.
19021902
19031903 <p><a name="3.6"></a><h2>3.6 - Error Handling in C</h2>
19041904
@@ -1930,7 +1930,7 @@ so they never raise an error: · 25 unmodified lines
19301930 alphabetical order.
19311931
19321932 <p><a name="lua_Alloc"></a>
1933−<hr /><h3><code>lua_Alloc</code></h3>
1933+<hr></hr><h3><code>lua_Alloc</code></h3>
19341934 <pre>
19351935 typedef void * (*lua_Alloc) (void *ud,
19361936 void *ptr,
@@ -1979,7 +1979,7 @@ static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { · 42 unmodified lines
19791979 </pre>
19801980
19811981 <p><a name="lua_atpanic"></a>
1982−<hr /><h3><code>lua_atpanic</code></h3>
1982+<hr></hr><h3><code>lua_atpanic</code></h3>
19831983 <pre>
19841984 lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf);
19851985 </pre>
@@ -1997,7 +1997,7 @@ never returning (e.g., doing a long jump). · 11 unmodified lines
19971997 <p>The panic function can access the error message at the top of the stack.
19981998
19991999 <p><a name="lua_call"></a>
2000−<hr /><h3><code>lua_call</code></h3>
2000+<hr></hr><h3><code>lua_call</code></h3>
20012001 <pre>
20022002 void lua_call (lua_State *L, int nargs, int nresults);
20032003 </pre>
@@ -2047,7 +2047,7 @@ at its end, the stack is back to its original configuration. · 43 unmodified lines
20472047 This is considered good programming practice.
20482048
20492049 <p><a name="lua_CFunction"></a>
2050−<hr /><h3><code>lua_CFunction</code></h3>
2050+<hr></hr><h3><code>lua_CFunction</code></h3>
20512051 <pre>
20522052 typedef int (*lua_CFunction) (lua_State *L);
20532053 </pre>
@@ -2093,20 +2093,20 @@ of numerical arguments and returns their average and sum: · 39 unmodified lines
20932093 </pre>
20942094
20952095 <p><a name="lua_checkstack"></a>
2096−<hr /><h3><code>lua_checkstack</code></h3>
2096+<hr></hr><h3><code>lua_checkstack</code></h3>
20972097 <pre>
20982098 int lua_checkstack (lua_State *L, int extra);
20992099 </pre>
21002100
21012101
21022102 <p>Ensures that there are at least <code>extra</code> free stack slots in the stack.
2103−it returns false if it cannot grow the stack to that size.
2103+It returns false if it cannot grow the stack to that size.
21042104 This function never shrinks the stack;
21052105 if the stack is already larger than the new size,
21062106 it is left unchanged.
21072107
21082108 <p><a name="lua_close"></a>
2109−<hr /><h3><code>lua_close</code></h3>
2109+<hr></hr><h3><code>lua_close</code></h3>
21102110 <pre>
21112111 void lua_close (lua_State *L);
21122112 </pre>
@@ -2123,7 +2123,7 @@ might need to release states as soon as they are not needed, · 10 unmodified lines
21232123 to avoid growing too large.
21242124
21252125 <p><a name="lua_concat"></a>
2126−<hr /><h3><code>lua_concat</code></h3>
2126+<hr></hr><h3><code>lua_concat</code></h3>
21272127 <pre>
21282128 void lua_concat (lua_State *L, int n);
21292129 </pre>
@@ -2138,7 +2138,7 @@ Concatenation is done following the usual semantics of Lua · 8 unmodified lines
21382138 (see <a href="#concat">2.5.4</a>).
21392139
21402140 <p><a name="lua_cpcall"></a>
2141−<hr /><h3><code>lua_cpcall</code></h3>
2141+<hr></hr><h3><code>lua_cpcall</code></h3>
21422142 <pre>
21432143 int lua_cpcall (lua_State *L, lua_CFunction func, void *ud);
21442144 </pre>
@@ -2154,7 +2154,7 @@ otherwise, it returns zero, and does not change the stack. · 9 unmodified lines
21542154 All values returned by <code>func</code> are discarded.
21552155
21562156 <p><a name="lua_createtable"></a>
2157−<hr /><h3><code>lua_createtable</code></h3>
2157+<hr></hr><h3><code>lua_createtable</code></h3>
21582158 <pre>
21592159 void lua_createtable (lua_State *L, int narr, int nrec);
21602160 </pre>
@@ -2168,7 +2168,7 @@ the table will have. · 7 unmodified lines
21682168 Otherwise you can use the function <a href="#lua_newtable"><code>lua_newtable</code></a>.
21692169
21702170 <p><a name="lua_dump"></a>
2171−<hr /><h3><code>lua_dump</code></h3>
2171+<hr></hr><h3><code>lua_dump</code></h3>
21722172 <pre>
21732173 int lua_dump (lua_State *L, lua_Writer writer, void *data);
21742174 </pre>
@@ -2191,7 +2191,7 @@ call to the writer; · 16 unmodified lines
21912191 <p>This function does not pop the function from the stack.
21922192
21932193 <p><a name="lua_equal"></a>
2194−<hr /><h3><code>lua_equal</code></h3>
2194+<hr></hr><h3><code>lua_equal</code></h3>
21952195 <pre>
21962196 int lua_equal (lua_State *L, int index1, int index2);
21972197 </pre>
@@ -2205,7 +2205,7 @@ Otherwise returns 0. · 7 unmodified lines
22052205 Also returns 0 if any of the indices is non valid.
22062206
22072207 <p><a name="lua_error"></a>
2208−<hr /><h3><code>lua_error</code></h3>
2208+<hr></hr><h3><code>lua_error</code></h3>
22092209 <pre>
22102210 int lua_error (lua_State *L);
22112211 </pre>
@@ -2219,7 +2219,7 @@ and therefore never returns. · 7 unmodified lines
22192219 (see <a href="#pdf-luaL_error"><code>luaL_error</code></a>).
22202220
22212221 <p><a name="lua_gc"></a>
2222−<hr /><h3><code>lua_gc</code></h3>
2222+<hr></hr><h3><code>lua_gc</code></h3>
22232223 <pre>
22242224 int lua_gc (lua_State *L, int what, int data);
22252225 </pre>
@@ -2257,7 +2257,7 @@ The function returns the previous value of the step multiplier. · 31 unmodified lines
22572257 </ul>
22582258
22592259 <p><a name="lua_getallocf"></a>
2260−<hr /><h3><code>lua_getallocf</code></h3>
2260+<hr></hr><h3><code>lua_getallocf</code></h3>
22612261 <pre>
22622262 lua_Alloc lua_getallocf (lua_State *L, void **ud);
22632263 </pre>
@@ -2268,7 +2268,7 @@ If <code>ud</code> is not <code>NULL</code>, Lua stores in <code>*ud</code> the · 4 unmodified lines
22682268 opaque pointer passed to <a href="#lua_newstate"><code>lua_newstate</code></a>.
22692269
22702270 <p><a name="lua_getfenv"></a>
2271−<hr /><h3><code>lua_getfenv</code></h3>
2271+<hr></hr><h3><code>lua_getfenv</code></h3>
22722272 <pre>
22732273 void lua_getfenv (lua_State *L, int index);
22742274 </pre>
@@ -2278,7 +2278,7 @@ opaque pointer passed to <a href="#lua_newstate"><code>lua_newstate</code></a>. · 3 unmodified lines
22782278 the value at the given index.
22792279
22802280 <p><a name="lua_getfield"></a>
2281−<hr /><h3><code>lua_getfield</code></h3>
2281+<hr></hr><h3><code>lua_getfield</code></h3>
22822282 <pre>
22832283 void lua_getfield (lua_State *L, int index, const char *k);
22842284 </pre>
@@ -2289,8 +2289,21 @@ where <code>t</code> is the value at the given valid index <code>index</code>. · 4 unmodified lines
22892289 As in Lua, this function may trigger a metamethod
22902290 for the "index" event (see <a href="#metatable">2.8</a>).
22912291
2292+<p><a name="lua_getglobal"></a>
2293+<hr></hr><h3><code>lua_getglobal</code></h3>
2294+<pre>
2295+ void lua_getglobal (lua_State *L, const char *name);
2296+</pre>
2297+
2298+
2299+<p>Pushes onto the stack the value of the global <code>name</code>.
2300+It is defined as a macro:
2301+<pre>
2302+#define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, s)
2303+</pre>
2304+
22922305 <p><a name="lua_getmetatable"></a>
2293−<hr /><h3><code>lua_getmetatable</code></h3>
2306+<hr></hr><h3><code>lua_getmetatable</code></h3>
22942307 <pre>
22952308 int lua_getmetatable (lua_State *L, int index);
22962309 </pre>
@@ -2300,10 +2313,10 @@ for the "index" event (see <a href="#metatable">2.8</a>). · 3 unmodified lines
23002313 acceptable index.
23012314 If the index is not valid,
23022315 or if the value does not have a metatable,
2303−returns 0 and pushes nothing on the stack.
2316+the function returns 0 and pushes nothing on the stack.
23042317
23052318 <p><a name="lua_gettable"></a>
2306−<hr /><h3><code>lua_gettable</code></h3>
2319+<hr></hr><h3><code>lua_gettable</code></h3>
23072320 <pre>
23082321 void lua_gettable (lua_State *L, int index);
23092322 </pre>
@@ -2319,7 +2332,7 @@ As in Lua, this function may trigger a metamethod · 9 unmodified lines
23192332 for the "index" event (see <a href="#metatable">2.8</a>).
23202333
23212334 <p><a name="lua_gettop"></a>
2322−<hr /><h3><code>lua_gettop</code></h3>
2335+<hr></hr><h3><code>lua_gettop</code></h3>
23232336 <pre>
23242337 int lua_gettop (lua_State *L);
23252338 </pre>
@@ -2331,7 +2344,7 @@ that result is equal to the number of elements in the stack · 5 unmodified lines
23312344 (and so 0 means an empty stack).
23322345
23332346 <p><a name="lua_insert"></a>
2334−<hr /><h3><code>lua_insert</code></h3>
2347+<hr></hr><h3><code>lua_insert</code></h3>
23352348 <pre>
23362349 void lua_insert (lua_State *L, int index);
23372350 </pre>
@@ -2343,7 +2356,7 @@ Cannot be called with a pseudo-index, · 5 unmodified lines
23432356 because a pseudo-index is not an actual stack position.
23442357
23452358 <p><a name="lua_Integer"></a>
2346−<hr /><h3><code>lua_Integer</code></h3>
2359+<hr></hr><h3><code>lua_Integer</code></h3>
23472360 <pre>
23482361 typedef ptrdiff_t lua_Integer;
23492362 </pre>
@@ -2356,7 +2369,7 @@ which is usually the largest integral type the machine handles · 6 unmodified lines
23562369 "comfortably".
23572370
23582371 <p><a name="lua_isboolean"></a>
2359−<hr /><h3><code>lua_isboolean</code></h3>
2372+<hr></hr><h3><code>lua_isboolean</code></h3>
23602373 <pre>
23612374 int lua_isboolean (lua_State *L, int index);
23622375 </pre>
@@ -2366,7 +2379,7 @@ which is usually the largest integral type the machine handles · 3 unmodified lines
23662379 and 0 otherwise.
23672380
23682381 <p><a name="lua_iscfunction"></a>
2369−<hr /><h3><code>lua_iscfunction</code></h3>
2382+<hr></hr><h3><code>lua_iscfunction</code></h3>
23702383 <pre>
23712384 int lua_iscfunction (lua_State *L, int index);
23722385 </pre>
@@ -2376,7 +2389,7 @@ and 0 otherwise. · 3 unmodified lines
23762389 and 0 otherwise.
23772390
23782391 <p><a name="lua_isfunction"></a>
2379−<hr /><h3><code>lua_isfunction</code></h3>
2392+<hr></hr><h3><code>lua_isfunction</code></h3>
23802393 <pre>
23812394 int lua_isfunction (lua_State *L, int index);
23822395 </pre>
@@ -2386,7 +2399,7 @@ and 0 otherwise. · 3 unmodified lines
23862399 (either C or Lua), and 0 otherwise.
23872400
23882401 <p><a name="lua_islightuserdata"></a>
2389−<hr /><h3><code>lua_islightuserdata</code></h3>
2402+<hr></hr><h3><code>lua_islightuserdata</code></h3>
23902403 <pre>
23912404 int lua_islightuserdata (lua_State *L, int index);
23922405 </pre>
@@ -2396,7 +2409,7 @@ and 0 otherwise. · 3 unmodified lines
23962409 and 0 otherwise.
23972410
23982411 <p><a name="lua_isnil"></a>
2399−<hr /><h3><code>lua_isnil</code></h3>
2412+<hr></hr><h3><code>lua_isnil</code></h3>
24002413 <pre>
24012414 int lua_isnil (lua_State *L, int index);
24022415 </pre>
@@ -2406,7 +2419,7 @@ and 0 otherwise. · 3 unmodified lines
24062419 and 0 otherwise.
24072420
24082421 <p><a name="lua_isnumber"></a>
2409−<hr /><h3><code>lua_isnumber</code></h3>
2422+<hr></hr><h3><code>lua_isnumber</code></h3>
24102423 <pre>
24112424 int lua_isnumber (lua_State *L, int index);
24122425 </pre>
@@ -2417,7 +2430,7 @@ or a string convertible to a number, · 4 unmodified lines
24172430 and 0 otherwise.
24182431
24192432 <p><a name="lua_isstring"></a>
2420−<hr /><h3><code>lua_isstring</code></h3>
2433+<hr></hr><h3><code>lua_isstring</code></h3>
24212434 <pre>
24222435 int lua_isstring (lua_State *L, int index);
24232436 </pre>
@@ -2428,7 +2441,7 @@ or a number (which is always convertible to a string), · 4 unmodified lines
24282441 and 0 otherwise.
24292442
24302443 <p><a name="lua_istable"></a>
2431−<hr /><h3><code>lua_istable</code></h3>
2444+<hr></hr><h3><code>lua_istable</code></h3>
24322445 <pre>
24332446 int lua_istable (lua_State *L, int index);
24342447 </pre>
@@ -2438,7 +2451,7 @@ and 0 otherwise. · 3 unmodified lines
24382451 and 0 otherwise.
24392452
24402453 <p><a name="lua_isthread"></a>
2441−<hr /><h3><code>lua_isthread</code></h3>
2454+<hr></hr><h3><code>lua_isthread</code></h3>
24422455 <pre>
24432456 int lua_isthread (lua_State *L, int index);
24442457 </pre>
@@ -2448,7 +2461,7 @@ and 0 otherwise. · 3 unmodified lines
24482461 and 0 otherwise.
24492462
24502463 <p><a name="lua_isuserdata"></a>
2451−<hr /><h3><code>lua_isuserdata</code></h3>
2464+<hr></hr><h3><code>lua_isuserdata</code></h3>
24522465 <pre>
24532466 int lua_isuserdata (lua_State *L, int index);
24542467 </pre>
@@ -2458,7 +2471,7 @@ and 0 otherwise. · 3 unmodified lines
24582471 (either full or light), and 0 otherwise.
24592472
24602473 <p><a name="lua_lessthan"></a>
2461−<hr /><h3><code>lua_lessthan</code></h3>
2474+<hr></hr><h3><code>lua_lessthan</code></h3>
24622475 <pre>
24632476 int lua_lessthan (lua_State *L, int index1, int index2);
24642477 </pre>
@@ -2472,7 +2485,7 @@ Otherwise returns 0. · 7 unmodified lines
24722485 Also returns 0 if any of the indices is non valid.
24732486
24742487 <p><a name="lua_load"></a>
2475−<hr /><h3><code>lua_load</code></h3>
2488+<hr></hr><h3><code>lua_load</code></h3>
24762489 <pre>
24772490 int lua_load (lua_State *L, lua_Reader reader, void *data,
24782491 const char *chunkname);
@@ -2505,7 +2518,7 @@ The <code>data</code> argument is an opaque value passed to the reader function. · 26 unmodified lines
25052518 which is used for error messages and in debug information (see <a href="#debugI">3.8</a>).
25062519
25072520 <p><a name="lua_newstate"></a>
2508−<hr /><h3><code>lua_newstate</code></h3>
2521+<hr></hr><h3><code>lua_newstate</code></h3>
25092522 <pre>
25102523 lua_State *lua_newstate (lua_Alloc f, void *ud);
25112524 </pre>
@@ -2520,7 +2533,7 @@ The second argument, <code>ud</code>, is an opaque pointer that Lua · 8 unmodified lines
25202533 simply passes to the allocator in every call.
25212534
25222535 <p><a name="lua_newtable"></a>
2523−<hr /><h3><code>lua_newtable</code></h3>
2536+<hr></hr><h3><code>lua_newtable</code></h3>
25242537 <pre>
25252538 void lua_newtable (lua_State *L);
25262539 </pre>
@@ -2530,7 +2543,7 @@ simply passes to the allocator in every call. · 3 unmodified lines
25302543 Equivalent to <code>lua_createtable(L, 0, 0)</code>.
25312544
25322545 <p><a name="lua_newthread"></a>
2533−<hr /><h3><code>lua_newthread</code></h3>
2546+<hr></hr><h3><code>lua_newthread</code></h3>
25342547 <pre>
25352548 lua_State *lua_newthread (lua_State *L);
25362549 </pre>
@@ -2547,7 +2560,7 @@ Threads are subject to garbage collection, · 10 unmodified lines
25472560 like any Lua object.
25482561
25492562 <p><a name="lua_newuserdata"></a>
2550−<hr /><h3><code>lua_newuserdata</code></h3>
2563+<hr></hr><h3><code>lua_newuserdata</code></h3>
25512564 <pre>
25522565 void *lua_newuserdata (lua_State *L, size_t size);
25532566 </pre>
@@ -2570,7 +2583,7 @@ When that userdata is collected again then · 16 unmodified lines
25702583 Lua frees its corresponding memory.
25712584
25722585 <p><a name="lua_next"></a>
2573−<hr /><h3><code>lua_next</code></h3>
2586+<hr></hr><h3><code>lua_next</code></h3>
25742587 <pre>
25752588 int lua_next (lua_State *L, int index);
25762589 </pre>
@@ -2602,7 +2615,7 @@ the value at the given index; · 25 unmodified lines
26022615 this confuses the next call to <a href="#lua_next"><code>lua_next</code></a>.
26032616
26042617 <p><a name="lua_Number"></a>
2605−<hr /><h3><code>lua_Number</code></h3>
2618+<hr></hr><h3><code>lua_Number</code></h3>
26062619 <pre>
26072620 typedef double lua_Number;
26082621 </pre>
@@ -2612,10 +2625,10 @@ this confuses the next call to <a href="#lua_next"><code>lua_next</code></a>. · 3 unmodified lines
26122625 By default, it is double, but that can be changed in <code>luaconf.h</code>.
26132626
26142627 <p>Through the configuration file you can change
2615−Lua to operate with other type for numbers (e.g., float or long).
2628+Lua to operate with another type for numbers (e.g., float or long).
26162629
26172630 <p><a name="lua_objlen"></a>
2618−<hr /><h3><code>lua_objlen</code></h3>
2631+<hr></hr><h3><code>lua_objlen</code></h3>
26192632 <pre>
26202633 size_t lua_objlen (lua_State *L, int index);
26212634 </pre>
@@ -2629,7 +2642,7 @@ for the userdata; · 7 unmodified lines
26292642 for other values, it is 0.
26302643
26312644 <p><a name="lua_pcall"></a>
2632−<hr /><h3><code>lua_pcall</code></h3>
2645+<hr></hr><h3><code>lua_pcall</code></h3>
26332646 <pre>
26342647 lua_pcall (lua_State *L, int nargs, int nresults, int errfunc);
26352648 </pre>
@@ -2676,7 +2689,7 @@ error while running the error handler function. · 40 unmodified lines
26762689 </ul>
26772690
26782691 <p><a name="lua_pop"></a>
2679−<hr /><h3><code>lua_pop</code></h3>
2692+<hr></hr><h3><code>lua_pop</code></h3>
26802693 <pre>
26812694 void lua_pop (lua_State *L, int n);
26822695 </pre>
@@ -2685,7 +2698,7 @@ error while running the error handler function. · 2 unmodified lines
26852698 <p>Pops <code>n</code> elements from the stack.
26862699
26872700 <p><a name="lua_pushboolean"></a>
2688−<hr /><h3><code>lua_pushboolean</code></h3>
2701+<hr></hr><h3><code>lua_pushboolean</code></h3>
26892702 <pre>
26902703 void lua_pushboolean (lua_State *L, int b);
26912704 </pre>
@@ -2694,7 +2707,7 @@ error while running the error handler function. · 2 unmodified lines
26942707 <p>Pushes a boolean value with value <code>b</code> onto the stack.
26952708
26962709 <p><a name="lua_pushcclosure"></a>
2697−<hr /><h3><code>lua_pushcclosure</code></h3>
2710+<hr></hr><h3><code>lua_pushcclosure</code></h3>
26982711 <pre>
26992712 void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n);
27002713 </pre>
@@ -2716,17 +2729,26 @@ associated with the function. · 15 unmodified lines
27162729 <a href="#lua_pushcclosure"><code>lua_pushcclosure</code></a> also pops these values from the stack.
27172730
27182731 <p><a name="lua_pushcfunction"></a>
2719−<hr /><h3><code>lua_pushcfunction</code></h3>
2732+<hr></hr><h3><code>lua_pushcfunction</code></h3>
27202733 <pre>
27212734 void lua_pushcfunction (lua_State *L, lua_CFunction f);
27222735 </pre>
27232736
27242737
27252738 <p>Pushes a C function onto the stack.
2726−This function is equivalent to <code>lua_pushcclosure(L, f, 0);</code>.
2739+This function receives a pointer to a C function
2740+and pushes on the stack a Lua value of type <code>function</code> that,
2741+when called, invokes the corresponding C function.
2742+
2743+<p>Any function to be registered in Lua must
2744+follow the correct protocol to receive its parameters
2745+and return its results (see <a href="#lua_CFunction"><code>lua_CFunction</code></a>).
2746+
2747+<p>The call <code>lua_pushcfunction(L, f)</code> is equivalent to
2748+<code>lua_pushcclosure(L, f, 0)</code>.
27272749
27282750 <p><a name="lua_pushfstring"></a>
2729−<hr /><h3><code>lua_pushfstring</code></h3>
2751+<hr></hr><h3><code>lua_pushfstring</code></h3>
27302752 <pre>
27312753 const char *lua_pushfstring (lua_State *L, const char *fmt, ...);
27322754 </pre>
@@ -2752,7 +2774,7 @@ The conversion specifiers can only be · 19 unmodified lines
27522774 </ul>
27532775
27542776 <p><a name="lua_pushinteger"></a>
2755−<hr /><h3><code>lua_pushinteger</code></h3>
2777+<hr></hr><h3><code>lua_pushinteger</code></h3>
27562778 <pre>
27572779 void lua_pushinteger (lua_State *L, lua_Integer n);
27582780 </pre>
@@ -2761,7 +2783,7 @@ The conversion specifiers can only be · 2 unmodified lines
27612783 <p>Pushes a number with value <code>n</code> onto the stack.
27622784
27632785 <p><a name="lua_pushlightuserdata"></a>
2764−<hr /><h3><code>lua_pushlightuserdata</code></h3>
2786+<hr></hr><h3><code>lua_pushlightuserdata</code></h3>
27652787 <pre>
27662788 void lua_pushlightuserdata (lua_State *L, void *p);
27672789 </pre>
@@ -2778,7 +2800,7 @@ A light userdata is equal to "any" · 10 unmodified lines
27782800 light userdata with the same C address.
27792801
27802802 <p><a name="lua_pushlstring"></a>
2781−<hr /><h3><code>lua_pushlstring</code></h3>
2803+<hr></hr><h3><code>lua_pushlstring</code></h3>
27822804 <pre>
27832805 void lua_pushlstring (lua_State *L, const char *s, size_t len);
27842806 </pre>
@@ -2792,7 +2814,7 @@ the function returns. · 7 unmodified lines
27922814 The string can contain embedded zeros.
27932815
27942816 <p><a name="lua_pushnil"></a>
2795−<hr /><h3><code>lua_pushnil</code></h3>
2817+<hr></hr><h3><code>lua_pushnil</code></h3>
27962818 <pre>
27972819 void lua_pushnil (lua_State *L);
27982820 </pre>
@@ -2801,7 +2823,7 @@ The string can contain embedded zeros. · 2 unmodified lines
28012823 <p>Pushes a nil value onto the stack.
28022824
28032825 <p><a name="lua_pushnumber"></a>
2804−<hr /><h3><code>lua_pushnumber</code></h3>
2826+<hr></hr><h3><code>lua_pushnumber</code></h3>
28052827 <pre>
28062828 void lua_pushnumber (lua_State *L, lua_Number n);
28072829 </pre>
@@ -2810,7 +2832,7 @@ The string can contain embedded zeros. · 2 unmodified lines
28102832 <p>Pushes a number with value <code>n</code> onto the stack.
28112833
28122834 <p><a name="lua_pushstring"></a>
2813−<hr /><h3><code>lua_pushstring</code></h3>
2835+<hr></hr><h3><code>lua_pushstring</code></h3>
28142836 <pre>
28152837 void lua_pushstring (lua_State *L, const char *s);
28162838 </pre>
@@ -2825,7 +2847,7 @@ The string cannot contain embedded zeros; · 8 unmodified lines
28252847 it is assumed to end at the first zero.
28262848
28272849 <p><a name="lua_pushthread"></a>
2828−<hr /><h3><code>lua_pushthread</code></h3>
2850+<hr></hr><h3><code>lua_pushthread</code></h3>
28292851 <pre>
28302852 void lua_pushthread (lua_State *L);
28312853 </pre>
@@ -2834,7 +2856,7 @@ it is assumed to end at the first zero. · 2 unmodified lines
28342856 <p>Pushes the thread represented by <code>L</code> onto the stack.
28352857
28362858 <p><a name="lua_pushvalue"></a>
2837−<hr /><h3><code>lua_pushvalue</code></h3>
2859+<hr></hr><h3><code>lua_pushvalue</code></h3>
28382860 <pre>
28392861 void lua_pushvalue (lua_State *L, int index);
28402862 </pre>
@@ -2844,7 +2866,7 @@ it is assumed to end at the first zero. · 3 unmodified lines
28442866 onto the stack.
28452867
28462868 <p><a name="lua_pushvfstring"></a>
2847−<hr /><h3><code>lua_pushvfstring</code></h3>
2869+<hr></hr><h3><code>lua_pushvfstring</code></h3>
28482870 <pre>
28492871 const char *lua_pushvfstring (lua_State *L, const char *fmt, va_list argp);
28502872 </pre>
@@ -2854,7 +2876,7 @@ onto the stack. · 3 unmodified lines
28542876 instead of a variable number of arguments.
28552877
28562878 <p><a name="lua_rawequal"></a>
2857−<hr /><h3><code>lua_rawequal</code></h3>
2879+<hr></hr><h3><code>lua_rawequal</code></h3>
28582880 <pre>
28592881 int lua_rawequal (lua_State *L, int index1, int index2);
28602882 </pre>
@@ -2867,7 +2889,7 @@ Otherwise returns 0. · 6 unmodified lines
28672889 Also returns 0 if any of the indices are non valid.
28682890
28692891 <p><a name="lua_rawget"></a>
2870−<hr /><h3><code>lua_rawget</code></h3>
2892+<hr></hr><h3><code>lua_rawget</code></h3>
28712893 <pre>
28722894 void lua_rawget (lua_State *L, int index);
28732895 </pre>
@@ -2877,7 +2899,7 @@ Also returns 0 if any of the indices are non valid. · 3 unmodified lines
28772899 (i.e., without metamethods).
28782900
28792901 <p><a name="lua_rawgeti"></a>
2880−<hr /><h3><code>lua_rawgeti</code></h3>
2902+<hr></hr><h3><code>lua_rawgeti</code></h3>
28812903 <pre>
28822904 void lua_rawgeti (lua_State *L, int index, int n);
28832905 </pre>
@@ -2889,7 +2911,7 @@ The access is raw; · 5 unmodified lines
28892911 that is, it does not invoke metamethods.
28902912
28912913 <p><a name="lua_rawset"></a>
2892−<hr /><h3><code>lua_rawset</code></h3>
2914+<hr></hr><h3><code>lua_rawset</code></h3>
28932915 <pre>
28942916 void lua_rawset (lua_State *L, int index);
28952917 </pre>
@@ -2899,7 +2921,7 @@ that is, it does not invoke metamethods. · 3 unmodified lines
28992921 (i.e., without metamethods).
29002922
29012923 <p><a name="lua_rawseti"></a>
2902−<hr /><h3><code>lua_rawseti</code></h3>
2924+<hr></hr><h3><code>lua_rawseti</code></h3>
29032925 <pre>
29042926 void lua_rawseti (lua_State *L, int index, int n);
29052927 </pre>
@@ -2914,7 +2936,7 @@ The assignment is raw; · 8 unmodified lines
29142936 that is, it does not invoke metamethods.
29152937
29162938 <p><a name="lua_Reader"></a>
2917−<hr /><h3><code>lua_Reader</code></h3>
2939+<hr></hr><h3><code>lua_Reader</code></h3>
29182940 <pre>
29192941 typedef const char * (*lua_Reader)
29202942 (lua_State *L, void *data, size_t *size);
@@ -2933,8 +2955,21 @@ The block must exist until the reader function is called again. · 12 unmodified lines
29332955 To signal the end of the chunk, the reader must return <code>NULL</code>.
29342956 The reader function may return pieces of any size greater than zero.
29352957
2958+<p><a name="lua_register"></a>
2959+<hr></hr><h3><code>lua_register</code></h3>
2960+<pre>
2961+ void lua_register (lua_State *L, const char *name, lua_CFunction f);
2962+</pre>
2963+
2964+
2965+<p>Sets the C function <code>f</code> as the new value of global <code>name</code>.
2966+It is defined as a macro:
2967+<pre>
2968+#define lua_register(L,n,f) (lua_pushcfunction(L, f), lua_setglobal(L, n))
2969+</pre>
2970+
29362971 <p><a name="lua_remove"></a>
2937−<hr /><h3><code>lua_remove</code></h3>
2972+<hr></hr><h3><code>lua_remove</code></h3>
29382973 <pre>
29392974 void lua_remove (lua_State *L, int index);
29402975 </pre>
@@ -2946,7 +2981,7 @@ Cannot be called with a pseudo-index, · 5 unmodified lines
29462981 because a pseudo-index is not an actual stack position.
29472982
29482983 <p><a name="lua_replace"></a>
2949−<hr /><h3><code>lua_replace</code></h3>
2984+<hr></hr><h3><code>lua_replace</code></h3>
29502985 <pre>
29512986 void lua_replace (lua_State *L, int index);
29522987 </pre>
@@ -2957,7 +2992,7 @@ without shifting any element · 4 unmodified lines
29572992 (therefore replacing the value at the given position).
29582993
29592994 <p><a name="lua_resume"></a>
2960−<hr /><h3><code>lua_resume</code></h3>
2995+<hr></hr><h3><code>lua_resume</code></h3>
29612996 <pre>
29622997 int lua_resume (lua_State *L, int narg);
29632998 </pre>
@@ -2987,7 +3022,7 @@ be passed as results from <code>yield</code>, · 23 unmodified lines
29873022 and then call <a href="#lua_resume"><code>lua_resume</code></a>.
29883023
29893024 <p><a name="lua_setallocf"></a>
2990−<hr /><h3><code>lua_setallocf</code></h3>
3025+<hr></hr><h3><code>lua_setallocf</code></h3>
29913026 <pre>
29923027 void lua_setallocf (lua_State *L, lua_Alloc f, void *ud);
29933028 </pre>
@@ -2997,7 +3032,7 @@ and then call <a href="#lua_resume"><code>lua_resume</code></a>. · 3 unmodified lines
29973032 with user data <code>ud</code>.
29983033
29993034 <p><a name="lua_setfenv"></a>
3000−<hr /><h3><code>lua_setfenv</code></h3>
3035+<hr></hr><h3><code>lua_setfenv</code></h3>
30013036 <pre>
30023037 int lua_setfenv (lua_State *L, int index);
30033038 </pre>
@@ -3011,7 +3046,7 @@ neither a function nor a thread nor a userdata, · 7 unmodified lines
30113046 Otherwise it returns 1.
30123047
30133048 <p><a name="lua_setfield"></a>
3014−<hr /><h3><code>lua_setfield</code></h3>
3049+<hr></hr><h3><code>lua_setfield</code></h3>
30153050 <pre>
30163051 void lua_setfield (lua_State *L, int index, const char *k);
30173052 </pre>
@@ -3025,8 +3060,22 @@ and <code>v</code> is the value at the top of the stack, · 7 unmodified lines
30253060 As in Lua, this function may trigger a metamethod
30263061 for the "newindex" event (see <a href="#metatable">2.8</a>).
30273062
3063+<p><a name="lua_setglobal"></a>
3064+<hr></hr><h3><code>lua_setglobal</code></h3>
3065+<pre>
3066+ void lua_setglobal (lua_State *L, const char *name);
3067+</pre>
3068+
3069+
3070+<p>Pops a value from the stack and
3071+sets it as the new value of global <code>name</code>.
3072+It is defined as a macro:
3073+<pre>
3074+#define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, s)
3075+</pre>
3076+
30283077 <p><a name="lua_setmetatable"></a>
3029−<hr /><h3><code>lua_setmetatable</code></h3>
3078+<hr></hr><h3><code>lua_setmetatable</code></h3>
30303079 <pre>
30313080 int lua_setmetatable (lua_State *L, int index);
30323081 </pre>
@@ -3037,7 +3086,7 @@ sets it as the new metatable for the value at the given · 4 unmodified lines
30373086 acceptable index.
30383087
30393088 <p><a name="lua_settable"></a>
3040−<hr /><h3><code>lua_settable</code></h3>
3089+<hr></hr><h3><code>lua_settable</code></h3>
30413090 <pre>
30423091 void lua_settable (lua_State *L, int index);
30433092 </pre>
@@ -3053,7 +3102,7 @@ As in Lua, this function may trigger a metamethod · 9 unmodified lines
30533102 for the "newindex" event (see <a href="#metatable">2.8</a>).
30543103
30553104 <p><a name="lua_settop"></a>
3056−<hr /><h3><code>lua_settop</code></h3>
3105+<hr></hr><h3><code>lua_settop</code></h3>
30573106 <pre>
30583107 void lua_settop (lua_State *L, int index);
30593108 </pre>
@@ -3066,7 +3115,7 @@ then the new elements are filled with <b>nil</b>. · 6 unmodified lines
30663115 If <code>index</code> is 0, then all stack elements are removed.
30673116
30683117 <p><a name="lua_State"></a>
3069−<hr /><h3><code>lua_State</code></h3>
3118+<hr></hr><h3><code>lua_State</code></h3>
30703119 <pre>
30713120 typedef struct lua_State lua_State;
30723121 </pre>
@@ -3082,7 +3131,7 @@ every function in the library, except to <a href="#lua_newstate"><code>lua_newst · 9 unmodified lines
30823131 which creates a Lua state from scratch.
30833132
30843133 <p><a name="lua_status"></a>
3085−<hr /><h3><code>lua_status</code></h3>
3134+<hr></hr><h3><code>lua_status</code></h3>
30863135 <pre>
30873136 int lua_status (lua_State *L);
30883137 </pre>
@@ -3090,19 +3139,19 @@ which creates a Lua state from scratch. · 1 unmodified line
30903139
30913140 <p>Returns the status of the thread <code>L</code>.
30923141
3093−<p>The status can by 0 for a normal thread,
3142+<p>The status can be 0 for a normal thread,
30943143 an error code if the thread finished its execution with an error,
30953144 or <code>LUA_YIELD</code> if the thread is suspended.
30963145
30973146 <p><a name="lua_toboolean"></a>
3098−<hr /><h3><code>lua_toboolean</code></h3>
3147+<hr></hr><h3><code>lua_toboolean</code></h3>
30993148 <pre>
31003149 int lua_toboolean (lua_State *L, int index);
31013150 </pre>
31023151
31033152
31043153 <p>Converts the Lua value at the given acceptable index to a C boolean
3105−value ((0 or 1).
3154+value (0 or 1).
31063155 Like all tests in Lua,
31073156 <a href="#lua_toboolean"><code>lua_toboolean</code></a> returns 1 for any Lua value
31083157 different from <b>false</b> and <b>nil</b>;
@@ -3112,7 +3161,7 @@ It also returns 0 when called with a non-valid index. · 3 unmodified lines
31123161 use <a href="#lua_isboolean"><code>lua_isboolean</code></a> to test the value's type.)
31133162
31143163 <p><a name="lua_tocfunction"></a>
3115−<hr /><h3><code>lua_tocfunction</code></h3>
3164+<hr></hr><h3><code>lua_tocfunction</code></h3>
31163165 <pre>
31173166 lua_CFunction lua_tocfunction (lua_State *L, int index);
31183167 </pre>
@@ -3123,7 +3172,7 @@ That value must be a C function; · 4 unmodified lines
31233172 otherwise, returns <code>NULL</code>.
31243173
31253174 <p><a name="lua_tointeger"></a>
3126−<hr /><h3><code>lua_tointeger</code></h3>
3175+<hr></hr><h3><code>lua_tointeger</code></h3>
31273176 <pre>
31283177 lua_Integer lua_tointeger (lua_State *L, int idx);
31293178 </pre>
@@ -3131,7 +3180,7 @@ otherwise, returns <code>NULL</code>. · 1 unmodified line
31313180
31323181 <p>Converts the Lua value at the given acceptable index
31333182 to the signed integral type <a href="#lua_Integer"><code>lua_Integer</code></a>.
3134−The Lua value must be a number or a string convertible to number
3183+The Lua value must be a number or a string convertible to a number
31353184 (see <a href="#coercion">2.2.1</a>);
31363185 otherwise, <a href="#lua_tointeger"><code>lua_tointeger</code></a> returns 0.
31373186
@@ -3139,7 +3188,7 @@ otherwise, <a href="#lua_tointeger"><code>lua_tointeger</code></a> returns 0. · 1 unmodified line
31393188 it is truncated in some non-specified way.
31403189
31413190 <p><a name="lua_tolstring"></a>
3142−<hr /><h3><code>lua_tolstring</code></h3>
3191+<hr></hr><h3><code>lua_tolstring</code></h3>
31433192 <pre>
31443193 const char *lua_tolstring (lua_State *L, int index, size_t *len);
31453194 </pre>
@@ -3167,7 +3216,7 @@ there is no guarantee that the pointer returned by <a href="#lua_tolstring"><cod · 21 unmodified lines
31673216 will be valid after the corresponding value is removed from the stack.
31683217
31693218 <p><a name="lua_tonumber"></a>
3170−<hr /><h3><code>lua_tonumber</code></h3>
3219+<hr></hr><h3><code>lua_tonumber</code></h3>
31713220 <pre>
31723221 lua_Number lua_tonumber (lua_State *L, int index);
31733222 </pre>
@@ -3175,12 +3224,12 @@ will be valid after the corresponding value is removed from the stack. · 1 unmodified line
31753224
31763225 <p>Converts the Lua value at the given acceptable index
31773226 to a number (see <a href="#lua_Number"><code>lua_Number</code></a>).
3178−The Lua value must be a number or a string convertible to number
3227+The Lua value must be a number or a string convertible to a number
31793228 (see <a href="#coercion">2.2.1</a>);
31803229 otherwise, <a href="#lua_tonumber"><code>lua_tonumber</code></a> returns 0.
31813230
31823231 <p><a name="lua_topointer"></a>
3183−<hr /><h3><code>lua_topointer</code></h3>
3232+<hr></hr><h3><code>lua_topointer</code></h3>
31843233 <pre>
31853234 const void *lua_topointer (lua_State *L, int index);
31863235 </pre>
@@ -3196,7 +3245,7 @@ There is no direct way to convert the pointer back to its original value. · 9 unmodified lines
31963245 <p>Typically this function is used only for debug information.
31973246
31983247 <p><a name="lua_tostring"></a>
3199−<hr /><h3><code>lua_tostring</code></h3>
3248+<hr></hr><h3><code>lua_tostring</code></h3>
32003249 <pre>
32013250 const char *lua_tostring (lua_State *L, int index);
32023251 </pre>
@@ -3205,7 +3254,7 @@ There is no direct way to convert the pointer back to its original value. · 2 unmodified lines
32053254 <p>Equivalent to <a href="#lua_tolstring"><code>lua_tolstring</code></a> with <code>len</code> equal to <code>NULL</code>.
32063255
32073256 <p><a name="lua_tothread"></a>
3208−<hr /><h3><code>lua_tothread</code></h3>
3257+<hr></hr><h3><code>lua_tothread</code></h3>
32093258 <pre>
32103259 lua_State *lua_tothread (lua_State *L, int index);
32113260 </pre>
@@ -3217,7 +3266,7 @@ This value must be a thread; · 5 unmodified lines
32173266 otherwise, the function returns <code>NULL</code>.
32183267
32193268 <p><a name="lua_touserdata"></a>
3220−<hr /><h3><code>lua_touserdata</code></h3>
3269+<hr></hr><h3><code>lua_touserdata</code></h3>
32213270 <pre>
32223271 void *lua_touserdata (lua_State *L, int index);
32233272 </pre>
@@ -3230,13 +3279,13 @@ returns its pointer. · 6 unmodified lines
32303279 Otherwise, returns <code>NULL</code>.
32313280
32323281 <p><a name="lua_type"></a>
3233−<hr /><h3><code>lua_type</code></h3>
3282+<hr></hr><h3><code>lua_type</code></h3>
32343283 <pre>
32353284 int lua_type (lua_State *L, int index);
32363285 </pre>
32373286
32383287
3239−<p>Returns the type of a value in the given acceptable index,
3288+<p>Returns the type of the value in the given acceptable index,
32403289 or <code>LUA_TNONE</code> for a non-valid index
32413290 (that is, an index to an "empty" stack position).
32423291 The types returned by <a href="#lua_type"><code>lua_type</code></a> are coded by the following constants
@@ -3253,7 +3302,7 @@ and · 10 unmodified lines
32533302 <code>LUA_TLIGHTUSERDATA</code>.
32543303
32553304 <p><a name="lua_typename"></a>
3256−<hr /><h3><code>lua_typename</code></h3>
3305+<hr></hr><h3><code>lua_typename</code></h3>
32573306 <pre>
32583307 const char *lua_typename (lua_State *L, int tp);
32593308 </pre>
@@ -3263,7 +3312,7 @@ and · 3 unmodified lines
32633312 which must be one the values returned by <a href="#lua_type"><code>lua_type</code></a>.
32643313
32653314 <p><a name="lua_Writer"></a>
3266−<hr /><h3><code>lua_Writer</code></h3>
3315+<hr></hr><h3><code>lua_Writer</code></h3>
32673316 <pre>
32683317 typedef int (*lua_Writer)
32693318 (lua_State *L, const void* p, size_t sz, void* ud);
@@ -3284,7 +3333,7 @@ any other value means an error and stops <a href="#lua_dump"><code>lua_dump</cod · 14 unmodified lines
32843333 calling the writer again.
32853334
32863335 <p><a name="lua_xmove"></a>
3287−<hr /><h3><code>lua_xmove</code></h3>
3336+<hr></hr><h3><code>lua_xmove</code></h3>
32883337 <pre>
32893338 void lua_xmove (lua_State *from, lua_State *to, int n);
32903339 </pre>
@@ -3293,10 +3342,10 @@ calling the writer again. · 2 unmodified lines
32933342 <p>Exchange values between different threads of the <em>same</em> global state.
32943343
32953344 <p>This function pops <code>n</code> values from the stack <code>from</code>,
3296−and pushes them into the stack <code>to</code>.
3345+and pushes them onto the stack <code>to</code>.
32973346
32983347 <p><a name="lua_yield"></a>
3299−<hr /><h3><code>lua_yield</code></h3>
3348+<hr></hr><h3><code>lua_yield</code></h3>
33003349 <pre>
33013350 int lua_yield (lua_State *L, int nresults);
33023351 </pre>
@@ -3326,7 +3375,7 @@ kinds of debuggers, profilers, and other tools · 23 unmodified lines
33263375 that need "inside information" from the interpreter.
33273376
33283377 <p><a name="lua_Debug"></a>
3329−<hr /><h3><code>lua_Debug</code></h3>
3378+<hr></hr><h3><code>lua_Debug</code></h3>
33303379 <pre>
33313380 typedef struct lua_Debug {
33323381 int event;
@@ -3408,7 +3457,7 @@ the number of upvalues of the function. · 75 unmodified lines
34083457 <p></ul>
34093458
34103459 <p><a name="lua_gethook"></a>
3411−<hr /><h3><code>lua_gethook</code></h3>
3460+<hr></hr><h3><code>lua_gethook</code></h3>
34123461 <pre>
34133462 lua_Hook lua_gethook (lua_State *L);
34143463 </pre>
@@ -3417,7 +3466,7 @@ the number of upvalues of the function. · 2 unmodified lines
34173466 <p>Returns the current hook function.
34183467
34193468 <p><a name="lua_gethookcount"></a>
3420−<hr /><h3><code>lua_gethookcount</code></h3>
3469+<hr></hr><h3><code>lua_gethookcount</code></h3>
34213470 <pre>
34223471 int lua_gethookcount (lua_State *L);
34233472 </pre>
@@ -3426,7 +3475,7 @@ the number of upvalues of the function. · 2 unmodified lines
34263475 <p>Returns the current hook count.
34273476
34283477 <p><a name="lua_gethookmask"></a>
3429−<hr /><h3><code>lua_gethookmask</code></h3>
3478+<hr></hr><h3><code>lua_gethookmask</code></h3>
34303479 <pre>
34313480 int lua_gethookmask (lua_State *L);
34323481 </pre>
@@ -3435,7 +3484,7 @@ the number of upvalues of the function. · 2 unmodified lines
34353484 <p>Returns the current hook mask.
34363485
34373486 <p><a name="lua_getinfo"></a>
3438−<hr /><h3><code>lua_getinfo</code></h3>
3487+<hr></hr><h3><code>lua_getinfo</code></h3>
34393488 <pre>
34403489 int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);
34413490 </pre>
@@ -3469,7 +3518,7 @@ you can write the following code: · 27 unmodified lines
34693518 </pre>
34703519
34713520 <p><a name="lua_getlocal"></a>
3472−<hr /><h3><code>lua_getlocal</code></h3>
3521+<hr></hr><h3><code>lua_getlocal</code></h3>
34733522 <pre>
34743523 const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n);
34753524 </pre>
@@ -3494,7 +3543,7 @@ when the index is greater than · 18 unmodified lines
34943543 the number of active local variables.
34953544
34963545 <p><a name="lua_getstack"></a>
3497−<hr /><h3><code>lua_getstack</code></h3>
3546+<hr></hr><h3><code>lua_getstack</code></h3>
34983547 <pre>
34993548 int lua_getstack (lua_State *L, int level, lua_Debug *ar);
35003549 </pre>
@@ -3512,7 +3561,7 @@ when called with a level greater than the stack depth, · 11 unmodified lines
35123561 it returns 0.
35133562
35143563 <p><a name="lua_getupvalue"></a>
3515−<hr /><h3><code>lua_getupvalue</code></h3>
3564+<hr></hr><h3><code>lua_getupvalue</code></h3>
35163565 <pre>
35173566 const char *lua_getupvalue (lua_State *L, int funcindex, int n);
35183567 </pre>
@@ -3536,7 +3585,7 @@ For C functions, this function uses the empty string <code>""</code> · 17 unmodified lines
35363585 as a name for all upvalues.
35373586
35383587 <p><a name="lua_Hook"></a>
3539−<hr /><h3><code>lua_Hook</code></h3>
3588+<hr></hr><h3><code>lua_Hook</code></h3>
35403589 <pre>
35413590 typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);
35423591 </pre>
@@ -3564,7 +3613,7 @@ Therefore, if a hook calls back Lua to execute a function or a chunk, · 21 unmodified lines
35643613 that execution occurs without any calls to hooks.
35653614
35663615 <p><a name="lua_sethook"></a>
3567−<hr /><h3><code>lua_sethook</code></h3>
3616+<hr></hr><h3><code>lua_sethook</code></h3>
35683617 <pre>
35693618 int lua_sethook (lua_State *L, lua_Hook func, int mask, int count);
35703619 </pre>
@@ -3601,7 +3650,7 @@ or when it jumps back in the code (even to the same line). · 30 unmodified lines
36013650 <p>A hook is disabled by setting <code>mask</code> to zero.
36023651
36033652 <p><a name="lua_setlocal"></a>
3604−<hr /><h3><code>lua_setlocal</code></h3>
3653+<hr></hr><h3><code>lua_setlocal</code></h3>
36053654 <pre>
36063655 const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n);
36073656 </pre>
@@ -3619,7 +3668,7 @@ when the index is greater than · 11 unmodified lines
36193668 the number of active local variables.
36203669
36213670 <p><a name="lua_setupvalue"></a>
3622−<hr /><h3><code>lua_setupvalue</code></h3>
3671+<hr></hr><h3><code>lua_setupvalue</code></h3>
36233672 <pre>
36243673 const char *lua_setupvalue (lua_State *L, int funcindex, int n);
36253674 </pre>
@@ -3668,7 +3717,7 @@ you should not use these functions for other stack values. · 42 unmodified lines
36683717 in alphabetical order.
36693718
36703719 <p><a name="luaL_addchar"></a>
3671−<hr /><h3><code>luaL_addchar</code></h3>
3720+<hr></hr><h3><code>luaL_addchar</code></h3>
36723721 <pre>
36733722 void luaL_addchar (luaL_Buffer B, char c);
36743723 </pre>
@@ -3678,7 +3727,7 @@ in alphabetical order. · 3 unmodified lines
36783727 (see <a href="#luaL_Buffer"><code>luaL_Buffer</code></a>).
36793728
36803729 <p><a name="luaL_addlstring"></a>
3681−<hr /><h3><code>luaL_addlstring</code></h3>
3730+<hr></hr><h3><code>luaL_addlstring</code></h3>
36823731 <pre>
36833732 void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l);
36843733 </pre>
@@ -3690,7 +3739,7 @@ the buffer <code>B</code> · 5 unmodified lines
36903739 The string may contain embedded zeros.
36913740
36923741 <p><a name="luaL_addsize"></a>
3693−<hr /><h3><code>luaL_addsize</code></h3>
3742+<hr></hr><h3><code>luaL_addsize</code></h3>
36943743 <pre>
36953744 void luaL_addsize (luaL_Buffer B, size_t n);
36963745 </pre>
@@ -3701,7 +3750,7 @@ buffer area (see <a href="#luaL_prepbuffer"><code>luaL_prepbuffer</code></a>) to · 4 unmodified lines
37013750 (see <a href="#luaL_Buffer"><code>luaL_Buffer</code></a>).
37023751
37033752 <p><a name="luaL_addstring"></a>
3704−<hr /><h3><code>luaL_addstring</code></h3>
3753+<hr></hr><h3><code>luaL_addstring</code></h3>
37053754 <pre>
37063755 void luaL_addstring (luaL_Buffer *B, const char *s);
37073756 </pre>
@@ -3713,7 +3762,7 @@ to the buffer <code>B</code> · 5 unmodified lines
37133762 The string may not contain embedded zeros.
37143763
37153764 <p><a name="luaL_addvalue"></a>
3716−<hr /><h3><code>luaL_addvalue</code></h3>
3765+<hr></hr><h3><code>luaL_addvalue</code></h3>
37173766 <pre>
37183767 void luaL_addvalue (luaL_Buffer *B);
37193768 </pre>
@@ -3729,7 +3778,7 @@ be called with an extra element on the stack, · 9 unmodified lines
37293778 which is the value to be added to the buffer.
37303779
37313780 <p><a name="luaL_argcheck"></a>
3732−<hr /><h3><code>luaL_argcheck</code></h3>
3781+<hr></hr><h3><code>luaL_argcheck</code></h3>
37333782 <pre>
37343783 void luaL_argcheck (lua_State *L, int cond, int numarg,
37353784 const char *extramsg);
@@ -3742,7 +3791,7 @@ If not, raises an error with message · 6 unmodified lines
37423791 where <code>func</code> is retrieved from the call stack.
37433792
37443793 <p><a name="luaL_argerror"></a>
3745−<hr /><h3><code>luaL_argerror</code></h3>
3794+<hr></hr><h3><code>luaL_argerror</code></h3>
37463795 <pre>
37473796 int luaL_argerror (lua_State *L, int numarg, const char *extramsg);
37483797 </pre>
@@ -3757,7 +3806,7 @@ but it is an idiom to use it as <code>return luaL_argerror ...</code> · 8 unmodified lines
37573806 in C functions.
37583807
37593808 <p><a name="luaL_Buffer"></a>
3760−<hr /><h3><code>luaL_Buffer</code></h3>
3809+<hr></hr><h3><code>luaL_Buffer</code></h3>
37613810 <pre>
37623811 typedef struct luaL_Buffer luaL_Buffer;
37633812 </pre>
@@ -3772,7 +3821,7 @@ Its pattern of use is as follows: · 8 unmodified lines
37723821 <li> Then you initialize it with a call <code>luaL_buffinit(L, &#038;b)</code>.
37733822 <li> Then you add string pieces to the buffer calling any of
37743823 the <code>luaL_add*</code> functions.
3775−<li> You finish calling <code>luaL_pushresult(&#038;b)</code>.
3824+<li> You finish by calling <code>luaL_pushresult(&#038;b)</code>.
37763825 That call leaves the final string on the top of the stack.
37773826 </ul>
37783827
@@ -3792,7 +3841,7 @@ level when the buffer was initialized, · 13 unmodified lines
37923841 plus the final string on its top.
37933842
37943843 <p><a name="luaL_buffinit"></a>
3795−<hr /><h3><code>luaL_buffinit</code></h3>
3844+<hr></hr><h3><code>luaL_buffinit</code></h3>
37963845 <pre>
37973846 void luaL_buffinit (lua_State *L, luaL_Buffer *B);
37983847 </pre>
@@ -3804,7 +3853,7 @@ the buffer must be declared as a variable · 5 unmodified lines
38043853 (see <a href="#luaL_Buffer"><code>luaL_Buffer</code></a>).
38053854
38063855 <p><a name="luaL_callmeta"></a>
3807−<hr /><h3><code>luaL_callmeta</code></h3>
3856+<hr></hr><h3><code>luaL_callmeta</code></h3>
38083857 <pre>
38093858 int luaL_callmeta (lua_State *L, int obj, const char *e);
38103859 </pre>
@@ -3821,7 +3870,7 @@ If there is no metatable or no metamethod, · 10 unmodified lines
38213870 this function returns 0 (without pushing any value on the stack).
38223871
38233872 <p><a name="luaL_checkany"></a>
3824−<hr /><h3><code>luaL_checkany</code></h3>
3873+<hr></hr><h3><code>luaL_checkany</code></h3>
38253874 <pre>
38263875 void luaL_checkany (lua_State *L, int narg);
38273876 </pre>
@@ -3831,7 +3880,7 @@ this function returns 0 (without pushing any value on the stack). · 3 unmodified lines
38313880 of any type (including <b>nil</b>) at position <code>narg</code>.
38323881
38333882 <p><a name="luaL_checkint"></a>
3834−<hr /><h3><code>luaL_checkint</code></h3>
3883+<hr></hr><h3><code>luaL_checkint</code></h3>
38353884 <pre>
38363885 int luaL_checkint (lua_State *L, int narg);
38373886 </pre>
@@ -3841,7 +3890,7 @@ of any type (including <b>nil</b>) at position <code>narg</code>. · 3 unmodified lines
38413890 and returns that number cast to an <code>int</code>.
38423891
38433892 <p><a name="luaL_checkinteger"></a>
3844−<hr /><h3><code>luaL_checkinteger</code></h3>
3893+<hr></hr><h3><code>luaL_checkinteger</code></h3>
38453894 <pre>
38463895 lua_Integer luaL_checkinteger (lua_State *L, int narg);
38473896 </pre>
@@ -3851,7 +3900,7 @@ and returns that number cast to an <code>int</code>. · 3 unmodified lines
38513900 and returns that number cast to a <a href="#lua_Integer"><code>lua_Integer</code></a>.
38523901
38533902 <p><a name="luaL_checklong"></a>
3854−<hr /><h3><code>luaL_checklong</code></h3>
3903+<hr></hr><h3><code>luaL_checklong</code></h3>
38553904 <pre>
38563905 long luaL_checklong (lua_State *L, int narg);
38573906 </pre>
@@ -3861,9 +3910,9 @@ and returns that number cast to a <a href="#lua_Integer"><code>lua_Integer</code · 3 unmodified lines
38613910 and returns that number cast to a <code>long</code>.
38623911
38633912 <p><a name="luaL_checklstring"></a>
3864−<hr /><h3><code>luaL_checklstring</code></h3>
3913+<hr></hr><h3><code>luaL_checklstring</code></h3>
38653914 <pre>
3866− const char *luaL_checklstring (lua_State *L, int numArg, size_t *l);
3915+ const char *luaL_checklstring (lua_State *L, int narg, size_t *l);
38673916 </pre>
38683917
38693918
@@ -3873,9 +3922,9 @@ if <code>l</code> is not <code>NULL</code> fills <code>*l</code> · 3 unmodified lines
38733922 with the string's length.
38743923
38753924 <p><a name="luaL_checknumber"></a>
3876−<hr /><h3><code>luaL_checknumber</code></h3>
3925+<hr></hr><h3><code>luaL_checknumber</code></h3>
38773926 <pre>
3878− lua_Number luaL_checknumber (lua_State *L, int numArg);
3927+ lua_Number luaL_checknumber (lua_State *L, int narg);
38793928 </pre>
38803929
38813930
@@ -3883,7 +3932,7 @@ with the string's length. · 1 unmodified line
38833932 and returns that number.
38843933
38853934 <p><a name="luaL_checkoption"></a>
3886−<hr /><h3><code>luaL_checkoption</code></h3>
3935+<hr></hr><h3><code>luaL_checkoption</code></h3>
38873936 <pre>
38883937 int luaL_checkoption (lua_State *L, int narg, const char *def,
38893938 const char *const lst[]);
@@ -3902,11 +3951,11 @@ Raises an error if the argument is not a string or · 12 unmodified lines
39023951 if the string cannot be found.
39033952
39043953 <p>This is a useful function for mapping strings to C enums.
3905−The usual interfaces in Lua libraries is to use strings instead of numbers
3954+The usual convention in Lua libraries is to use strings instead of numbers
39063955 to select options.
39073956
39083957 <p><a name="luaL_checkstack"></a>
3909−<hr /><h3><code>luaL_checkstack</code></h3>
3958+<hr></hr><h3><code>luaL_checkstack</code></h3>
39103959 <pre>
39113960 void luaL_checkstack (lua_State *L, int sz, const char *msg);
39123961 </pre>
@@ -3917,7 +3966,7 @@ raising an error if the stack cannot grow to that size. · 4 unmodified lines
39173966 <code>msg</code> is an additional text to go into the error message.
39183967
39193968 <p><a name="luaL_checkstring"></a>
3920−<hr /><h3><code>luaL_checkstring</code></h3>
3969+<hr></hr><h3><code>luaL_checkstring</code></h3>
39213970 <pre>
39223971 const char *luaL_checkstring (lua_State *L, int narg);
39233972 </pre>
@@ -3927,7 +3976,7 @@ raising an error if the stack cannot grow to that size. · 3 unmodified lines
39273976 and returns that string.
39283977
39293978 <p><a name="luaL_checktype"></a>
3930−<hr /><h3><code>luaL_checktype</code></h3>
3979+<hr></hr><h3><code>luaL_checktype</code></h3>
39313980 <pre>
39323981 void luaL_checktype (lua_State *L, int narg, int t);
39333982 </pre>
@@ -3936,9 +3985,9 @@ and returns that string. · 2 unmodified lines
39363985 <p>Checks whether the function argument <code>narg</code> has type <code>t</code>.
39373986
39383987 <p><a name="luaL_checkudata"></a>
3939−<hr /><h3><code>luaL_checkudata</code></h3>
3988+<hr></hr><h3><code>luaL_checkudata</code></h3>
39403989 <pre>
3941− void *luaL_checkudata (lua_State *L, int ud, const char *tname);
3990+ void *luaL_checkudata (lua_State *L, int narg, const char *tname);
39423991 </pre>
39433992
39443993
@@ -3946,7 +3995,7 @@ and returns that string. · 1 unmodified line
39463995 of the type <code>tname</code> (see <a href="#luaL_newmetatable"><code>luaL_newmetatable</code></a>).
39473996
39483997 <p><a name="luaL_error"></a>
3949−<hr /><h3><code>luaL_error</code></h3>
3998+<hr></hr><h3><code>luaL_error</code></h3>
39503999 <pre>
39514000 int luaL_error (lua_State *L, const char *fmt, ...);
39524001 </pre>
@@ -3954,7 +4003,7 @@ of the type <code>tname</code> (see <a href="#luaL_newmetatable"><code>luaL_newm · 1 unmodified line
39544003
39554004 <p>Raises an error.
39564005 The error message format is given by <code>fmt</code>
3957−plus any extra argument,
4006+plus any extra arguments,
39584007 following the same rules of <a href="#lua_pushfstring"><code>lua_pushfstring</code></a>.
39594008 It also adds at the beginning of the message the file name and
39604009 the line number where the error occurred,
@@ -3965,7 +4014,7 @@ but it is an idiom to use it as <code>return luaL_error ...</code> · 4 unmodified lines
39654014 in C functions.
39664015
39674016 <p><a name="luaL_getmetafield"></a>
3968−<hr /><h3><code>luaL_getmetafield</code></h3>
4017+<hr></hr><h3><code>luaL_getmetafield</code></h3>
39694018 <pre>
39704019 int luaL_getmetafield (lua_State *L, int obj, const char *e);
39714020 </pre>
@@ -3978,7 +4027,7 @@ or if the metatable does not have that field, · 6 unmodified lines
39784027 returns 0 and pushes nothing.
39794028
39804029 <p><a name="luaL_getmetatable"></a>
3981−<hr /><h3><code>luaL_getmetatable</code></h3>
4030+<hr></hr><h3><code>luaL_getmetatable</code></h3>
39824031 <pre>
39834032 void luaL_getmetatable (lua_State *L, const char *tname);
39844033 </pre>
@@ -3988,7 +4037,7 @@ returns 0 and pushes nothing. · 3 unmodified lines
39884037 in the registry (see <a href="#luaL_newmetatable"><code>luaL_newmetatable</code></a>).
39894038
39904039 <p><a name="luaL_gsub"></a>
3991−<hr /><h3><code>luaL_gsub</code></h3>
4040+<hr></hr><h3><code>luaL_gsub</code></h3>
39924041 <pre>
39934042 const char *luaL_gsub (lua_State *L, const char *s,
39944043 const char *p, const char *r);
@@ -4001,7 +4050,7 @@ with the string <code>r</code>. · 6 unmodified lines
40014050 Pushes the resulting string on the stack and returns it.
40024051
40034052 <p><a name="luaL_loadbuffer"></a>
4004−<hr /><h3><code>luaL_loadbuffer</code></h3>
4053+<hr></hr><h3><code>luaL_loadbuffer</code></h3>
40054054 <pre>
40064055 int luaL_loadbuffer (lua_State *L, const char *buff,
40074056 size_t sz, const char *name);
@@ -4017,7 +4066,7 @@ buffer pointed by <code>buff</code> with size <code>sz</code>. · 9 unmodified lines
40174066 used for debug information and error messages.
40184067
40194068 <p><a name="luaL_loadfile"></a>
4020−<hr /><h3><code>luaL_loadfile</code></h3>
4069+<hr></hr><h3><code>luaL_loadfile</code></h3>
40214070 <pre>
40224071 int luaL_loadfile (lua_State *L, const char *filename);
40234072 </pre>
@@ -4035,7 +4084,7 @@ but it has an extra error code <code>LUA_ERRFILE</code> · 11 unmodified lines
40354084 if it cannot open/read the file.
40364085
40374086 <p><a name="luaL_loadstring"></a>
4038−<hr /><h3><code>luaL_loadstring</code></h3>
4087+<hr></hr><h3><code>luaL_loadstring</code></h3>
40394088 <pre>
40404089 int luaL_loadstring (lua_State *L, const char *s);
40414090 </pre>
@@ -4048,24 +4097,24 @@ the zero-terminated string <code>s</code>. · 6 unmodified lines
40484097 <p>This function returns the same results as <a href="#lua_load"><code>lua_load</code></a>.
40494098
40504099 <p><a name="luaL_newmetatable"></a>
4051−<hr /><h3><code>luaL_newmetatable</code></h3>
4100+<hr></hr><h3><code>luaL_newmetatable</code></h3>
40524101 <pre>
40534102 int luaL_newmetatable (lua_State *L, const char *tname);
40544103 </pre>
40554104
40564105
4057−<p>If the registry already has the key <code>"tname"</code>,
4106+<p>If the registry already has the key <code>tname</code>,
40584107 returns 0.
40594108 Otherwise,
40604109 creates a new table to be used as a metatable for userdata,
4061−adds it to the registry with key <code>"tname"</code>,
4110+adds it to the registry with key <code>tname</code>,
40624111 and returns 1.
40634112
40644113 <p>In both cases pushes on the stack the final value associated
4065−with <code>"tname"</code> in the registry.
4114+with <code>tname</code> in the registry.
40664115
40674116 <p><a name="luaL_newstate"></a>
4068−<hr /><h3><code>luaL_newstate</code></h3>
4117+<hr></hr><h3><code>luaL_newstate</code></h3>
40694118 <pre>
40704119 lua_State *luaL_newstate (void);
40714120 </pre>
@@ -4080,8 +4129,17 @@ errors. · 8 unmodified lines
40804129 <p>Returns the new state,
40814130 or <code>NULL</code> if there is a memory allocation error.
40824131
4132+<p><a name="luaL_openlibs"></a>
4133+<hr></hr><h3><code>luaL_openlibs</code></h3>
4134+<pre>
4135+ void luaL_openlibs (lua_State *L);
4136+</pre>
4137+
4138+
4139+<p>Opens all standard Lua libraries into the given state.
4140+
40834141 <p><a name="luaL_optint"></a>
4084−<hr /><h3><code>luaL_optint</code></h3>
4142+<hr></hr><h3><code>luaL_optint</code></h3>
40854143 <pre>
40864144 int luaL_optint (lua_State *L, int narg, int d);
40874145 </pre>
@@ -4094,9 +4152,9 @@ returns <code>d</code>. · 6 unmodified lines
40944152 Otherwise, raises an error.
40954153
40964154 <p><a name="luaL_optinteger"></a>
4097−<hr /><h3><code>luaL_optinteger</code></h3>
4155+<hr></hr><h3><code>luaL_optinteger</code></h3>
40984156 <pre>
4099− lua_Integer luaL_optinteger (lua_State *L, int nArg, lua_Integer d);
4157+ lua_Integer luaL_optinteger (lua_State *L, int narg, lua_Integer d);
41004158 </pre>
41014159
41024160
@@ -4107,7 +4165,7 @@ returns <code>d</code>. · 4 unmodified lines
41074165 Otherwise, raises an error.
41084166
41094167 <p><a name="luaL_optlong"></a>
4110−<hr /><h3><code>luaL_optlong</code></h3>
4168+<hr></hr><h3><code>luaL_optlong</code></h3>
41114169 <pre>
41124170 long luaL_optlong (lua_State *L, int narg, long d);
41134171 </pre>
@@ -4120,9 +4178,9 @@ returns <code>d</code>. · 6 unmodified lines
41204178 Otherwise, raises an error.
41214179
41224180 <p><a name="luaL_optlstring"></a>
4123−<hr /><h3><code>luaL_optlstring</code></h3>
4181+<hr></hr><h3><code>luaL_optlstring</code></h3>
41244182 <pre>
4125− const char *luaL_optlstring (lua_State *L, int numArg,
4183+ const char *luaL_optlstring (lua_State *L, int narg,
41264184 const char *d, size_t *l);
41274185 </pre>
41284186
@@ -4137,9 +4195,9 @@ Otherwise, raises an error. · 8 unmodified lines
41374195 fills the position <code>*l</code> with the results's length.
41384196
41394197 <p><a name="luaL_optnumber"></a>
4140−<hr /><h3><code>luaL_optnumber</code></h3>
4198+<hr></hr><h3><code>luaL_optnumber</code></h3>
41414199 <pre>
4142− lua_Number luaL_optnumber (lua_State *L, int nArg, lua_Number d);
4200+ lua_Number luaL_optnumber (lua_State *L, int narg, lua_Number d);
41434201 </pre>
41444202
41454203
@@ -4150,7 +4208,7 @@ returns <code>d</code>. · 4 unmodified lines
41504208 Otherwise, raises an error.
41514209
41524210 <p><a name="luaL_optstring"></a>
4153−<hr /><h3><code>luaL_optstring</code></h3>
4211+<hr></hr><h3><code>luaL_optstring</code></h3>
41544212 <pre>
41554213 const char *luaL_optstring (lua_State *L, int narg, const char *d);
41564214 </pre>
@@ -4163,7 +4221,7 @@ returns <code>d</code>. · 6 unmodified lines
41634221 Otherwise, raises an error.
41644222
41654223 <p><a name="luaL_prepbuffer"></a>
4166−<hr /><h3><code>luaL_prepbuffer</code></h3>
4224+<hr></hr><h3><code>luaL_prepbuffer</code></h3>
41674225 <pre>
41684226 char *luaL_prepbuffer (luaL_Buffer *B);
41694227 </pre>
@@ -4177,7 +4235,7 @@ After copying the string into that space you must call · 7 unmodified lines
41774235 it to the buffer.
41784236
41794237 <p><a name="luaL_pushresult"></a>
4180−<hr /><h3><code>luaL_pushresult</code></h3>
4238+<hr></hr><h3><code>luaL_pushresult</code></h3>
41814239 <pre>
41824240 void luaL_pushresult (luaL_Buffer *B);
41834241 </pre>
@@ -4187,7 +4245,7 @@ it to the buffer. · 3 unmodified lines
41874245 the top of the stack.
41884246
41894247 <p><a name="luaL_ref"></a>
4190−<hr /><h3><code>luaL_ref</code></h3>
4248+<hr></hr><h3><code>luaL_ref</code></h3>
41914249 <pre>
41924250 int luaL_ref (lua_State *L, int t);
41934251 </pre>
@@ -4205,12 +4263,12 @@ by calling <code>lua_rawgeti(L, t, r)</code>. · 11 unmodified lines
42054263 Function <a href="#luaL_unref"><code>luaL_unref</code></a> frees a reference and its associated object.
42064264
42074265 <p>If the object at the top of the stack is <b>nil</b>,
4208−<a href="#luaL_ref"><code>luaL_ref</code></a> returns the same reference <code>LUA_REFNIL</code>.
4266+<a href="#luaL_ref"><code>luaL_ref</code></a> returns the constant <code>LUA_REFNIL</code>.
42094267 The constant <code>LUA_NOREF</code> is guaranteed to be different
42104268 from any reference returned by <a href="#luaL_ref"><code>luaL_ref</code></a>.
42114269
42124270 <p><a name="luaL_Reg"></a>
4213−<hr /><h3><code>luaL_Reg</code></h3>
4271+<hr></hr><h3><code>luaL_Reg</code></h3>
42144272 <pre>
42154273 typedef struct luaL_Reg {
42164274 const char *name;
@@ -4228,7 +4286,7 @@ Any array of <a href="#luaL_Reg"><code>luaL_Reg</code></a> must end with an sent · 11 unmodified lines
42284286 in which both <code>name</code> and <code>func</code> are <code>NULL</code>.
42294287
42304288 <p><a name="luaL_register"></a>
4231−<hr /><h3><code>luaL_register</code></h3>
4289+<hr></hr><h3><code>luaL_register</code></h3>
42324290 <pre>
42334291 void luaL_register (lua_State *L, const char *libname,
42344292 const luaL_Reg *l);
@@ -4254,7 +4312,7 @@ reuses that table instead of creating a new one. · 19 unmodified lines
42544312 on the top of the stack.
42554313
42564314 <p><a name="luaL_typename"></a>
4257−<hr /><h3><code>luaL_typename</code></h3>
4315+<hr></hr><h3><code>luaL_typename</code></h3>
42584316 <pre>
42594317 const char *luaL_typename (lua_State *L, int idx);
42604318 </pre>
@@ -4263,7 +4321,7 @@ on the top of the stack. · 2 unmodified lines
42634321 <p>Returns the name of the type of the value at index <code>idx</code>.
42644322
42654323 <p><a name="luaL_typerror"></a>
4266−<hr /><h3><code>luaL_typerror</code></h3>
4324+<hr></hr><h3><code>luaL_typerror</code></h3>
42674325 <pre>
42684326 int luaL_typerror (lua_State *L, int narg, const char *tname);
42694327 </pre>
@@ -4278,7 +4336,7 @@ where <code>&#060;location></code> is produced by <a href="#luaL_where"><code>lu · 8 unmodified lines
42784336 and <code>&#060;realt></code> is the type name of the actual argument.
42794337
42804338 <p><a name="luaL_unref"></a>
4281−<hr /><h3><code>luaL_unref</code></h3>
4339+<hr></hr><h3><code>luaL_unref</code></h3>
42824340 <pre>
42834341 void luaL_unref (lua_State *L, int t, int ref);
42844342 </pre>
@@ -4294,7 +4352,7 @@ The reference <code>ref</code> is also freed to be used again. · 9 unmodified lines
42944352 <a href="#luaL_unref"><code>luaL_unref</code></a> does nothing.
42954353
42964354 <p><a name="luaL_where"></a>
4297−<hr /><h3><code>luaL_where</code></h3>
4355+<hr></hr><h3><code>luaL_where</code></h3>
42984356 <pre>
42994357 void luaL_where (lua_State *L, int lvl);
43004358 </pre>
@@ -4363,14 +4421,14 @@ If you do not include this library in your application, · 62 unmodified lines
43634421 you should check carefully whether you need to provide
43644422 implementations for some of its facilities.
43654423
4366−<p><a name="pdf-assert"></a><hr /><h3><code>assert (v [, message])</code></h3>
4424+<p><a name="pdf-assert"></a><hr></hr><h3><code>assert (v [, message])</code></h3>
43674425 Issues an error when
43684426 the value of its argument <code>v</code> is false (i.e., <b>nil</b> or <b>false</b>);
43694427 otherwise, returns all its arguments.
43704428 <code>message</code> is an error message;
43714429 when absent, it defaults to "assertion failed!"
43724430
4373−<p><a name="pdf-collectgarbage"></a><hr /><h3><code>collectgarbage (opt [, arg])</code></h3>
4431+<p><a name="pdf-collectgarbage"></a><hr></hr><h3><code>collectgarbage (opt [, arg])</code></h3>
43744432
43754433 <p>This function is a generic interface to the garbage collector.
43764434 It performs different functions according to its first argument, <code>opt</code>:
@@ -4393,7 +4451,7 @@ sets <code>arg</code>/100 as the new value for the <em>step multiplier</em> of · 16 unmodified lines
43934451 the collector (see <a href="#GC">2.10</a>).
43944452 </ul>
43954453
4396−<p><a name="pdf-dofile"></a><hr /><h3><code>dofile (filename)</code></h3>
4454+<p><a name="pdf-dofile"></a><hr></hr><h3><code>dofile (filename)</code></h3>
43974455 Opens the named file and executes its contents as a Lua chunk.
43984456 When called without arguments,
43994457 <code>dofile</code> executes the contents of the standard input (<code>stdin</code>).
@@ -4401,7 +4459,7 @@ Returns all values returned by the chunk. · 1 unmodified line
44014459 In case of errors, <code>dofile</code> propagates the error
44024460 to its caller (that is, <code>dofile</code> does not run in protected mode).
44034461
4404−<p><a name="pdf-error"></a><hr /><h3><code>error (message [, level])</code></h3>
4462+<p><a name="pdf-error"></a><hr></hr><h3><code>error (message [, level])</code></h3>
44054463 Terminates the last protected function called
44064464 and returns <code>message</code> as the error message.
44074465 Function <code>error</code> never returns.
@@ -4416,7 +4474,7 @@ that called <code>error</code> was called; and so on. · 8 unmodified lines
44164474 Passing a level 0 avoids the addition of error position information
44174475 to the message.
44184476
4419−<p><a name="pdf-_G"></a><hr /><h3><code>_G</code></h3>
4477+<p><a name="pdf-_G"></a><hr></hr><h3><code>_G</code></h3>
44204478 A global variable (not a function) that
44214479 holds the global environment (that is, <code>_G._G = _G</code>).
44224480 Lua itself does not use this variable;
@@ -4424,7 +4482,7 @@ changing its value does not affect any environment, · 1 unmodified line
44244482 nor vice-versa.
44254483 (Use <a href="#pdf-setfenv"><code>setfenv</code></a> to change environments.)
44264484
4427−<p><a name="pdf-getfenv"></a><hr /><h3><code>getfenv (f)</code></h3>
4485+<p><a name="pdf-getfenv"></a><hr></hr><h3><code>getfenv (f)</code></h3>
44284486 Returns the current environment in use by the function.
44294487 <code>f</code> can be a Lua function or a number
44304488 that specifies the function at that stack level:
@@ -4434,7 +4492,7 @@ or if <code>f</code> is 0, · 3 unmodified lines
44344492 <code>getfenv</code> returns the global environment.
44354493 The default for <code>f</code> is 1.
44364494
4437−<p><a name="pdf-getmetatable"></a><hr /><h3><code>getmetatable (object)</code></h3>
4495+<p><a name="pdf-getmetatable"></a><hr></hr><h3><code>getmetatable (object)</code></h3>
44384496
44394497 <p>If <code>object</code> does not have a metatable, returns <b>nil</b>.
44404498 Otherwise,
@@ -4442,7 +4500,7 @@ if the object's metatable has a <code>"__metatable"</code> field, · 1 unmodified line
44424500 returns the associated value.
44434501 Otherwise, returns the metatable of the given object.
44444502
4445−<p><a name="pdf-ipairs"></a><hr /><h3><code>ipairs (t)</code></h3>
4503+<p><a name="pdf-ipairs"></a><hr></hr><h3><code>ipairs (t)</code></h3>
44464504
44474505 <p>Returns three values: an iterator function, the table <code>t</code>, and 0,
44484506 so that the construction
@@ -4454,7 +4512,7 @@ up to the first integer key with a nil value in the table. · 5 unmodified lines
44544512
44554513 <p>See <a href="#pdf-next"><code>next</code></a> for the caveats of modifying the table during its traversal.
44564514
4457−<p><a name="pdf-load"></a><hr /><h3><code>load (func [, chunkname])</code></h3>
4515+<p><a name="pdf-load"></a><hr></hr><h3><code>load (func [, chunkname])</code></h3>
44584516
44594517 <p>Loads a chunk using function <code>func</code> to get its pieces.
44604518 Each call to <code>func</code> must return a string that concatenates
@@ -4469,14 +4527,14 @@ The environment of the returned function is the global environment. · 8 unmodified lines
44694527 <p><code>chunkname</code> is used as the chunk name for error messages
44704528 and debug information.
44714529
4472−<p><a name="pdf-loadfile"></a><hr /><h3><code>loadfile ([filename])</code></h3>
4530+<p><a name="pdf-loadfile"></a><hr></hr><h3><code>loadfile ([filename])</code></h3>
44734531
44744532 <p>Similar to <a href="#pdf-load"><code>load</code></a>,
44754533 but gets the chunk from file <code>filename</code>
44764534 or from the standard input,
4477−if no file name given.
4535+if no file name is given.
44784536
4479−<p><a name="pdf-loadstring"></a><hr /><h3><code>loadstring (string [, chunkname])</code></h3>
4537+<p><a name="pdf-loadstring"></a><hr></hr><h3><code>loadstring (string [, chunkname])</code></h3>
44804538
44814539 <p>Similar to <a href="#pdf-load"><code>load</code></a>,
44824540 but gets the chunk from the given string.
@@ -4486,7 +4544,7 @@ but gets the chunk from the given string. · 3 unmodified lines
44864544 assert(loadstring(s))()
44874545 </pre>
44884546
4489−<p><a name="pdf-next"></a><hr /><h3><code>next (table [, index])</code></h3>
4547+<p><a name="pdf-next"></a><hr></hr><h3><code>next (table [, index])</code></h3>
44904548
44914549 <p>Allows a program to traverse all fields of a table.
44924550 Its first argument is a table and its second argument
@@ -4518,7 +4576,7 @@ you assign any value to a non-existent field in the table. · 25 unmodified lines
45184576 You may however modify existing fields.
45194577 In particular, you may clear existing fields.
45204578
4521−<p><a name="pdf-pairs"></a><hr /><h3><code>pairs (t)</code></h3>
4579+<p><a name="pdf-pairs"></a><hr></hr><h3><code>pairs (t)</code></h3>
45224580
45234581 <p>Returns three values: the <a href="#pdf-next"><code>next</code></a> function, the table <code>t</code>, and <b>nil</b>,
45244582 so that the construction
@@ -4529,7 +4587,7 @@ will iterate over all key--value pairs of table <code>t</code>. · 4 unmodified lines
45294587
45304588 <p>See <a href="#pdf-next"><code>next</code></a> for the caveats of modifying the table during its traversal.
45314589
4532−<p><a name="pdf-pcall"></a><hr /><h3><code>pcall (f, arg1, arg2, ...)</code></h3>
4590+<p><a name="pdf-pcall"></a><hr></hr><h3><code>pcall (f, arg1, arg2, ...)</code></h3>
45334591
45344592 <p>Calls function <code>f</code> with
45354593 the given arguments in protected mode.
@@ -4542,7 +4600,7 @@ In such case, <code>pcall</code> also returns all results from the call, · 6 unmodified lines
45424600 after this first result.
45434601 In case of any error, <code>pcall</code> returns <b>false</b> plus the error message.
45444602
4545−<p><a name="pdf-print"></a><hr /><h3><code>print (e1, e2, ...)</code></h3>
4603+<p><a name="pdf-print"></a><hr></hr><h3><code>print (e1, e2, ...)</code></h3>
45464604 Receives any number of arguments,
45474605 and prints their values in <code>stdout</code>,
45484606 using the <a href="#pdf-tostring"><code>tostring</code></a> function to convert them to strings.
@@ -4551,32 +4609,32 @@ but only as a quick way to show a value, · 2 unmodified lines
45514609 typically for debugging.
45524610 For formatted output, use <a href="#pdf-string.format"><code>string.format</code></a>.
45534611
4554−<p><a name="pdf-rawequal"></a><hr /><h3><code>rawequal (v1, v2)</code></h3>
4612+<p><a name="pdf-rawequal"></a><hr></hr><h3><code>rawequal (v1, v2)</code></h3>
45554613 Checks whether <code>v1</code> is equal to <code>v2</code>,
45564614 without invoking any metamethod.
45574615 Returns a boolean.
45584616
4559−<p><a name="pdf-rawget"></a><hr /><h3><code>rawget (table, index)</code></h3>
4617+<p><a name="pdf-rawget"></a><hr></hr><h3><code>rawget (table, index)</code></h3>
45604618 Gets the real value of <code>table[index]</code>,
45614619 without invoking any metamethod.
45624620 <code>table</code> must be a table and
45634621 <code>index</code> any value different from <b>nil</b>.
45644622
4565−<p><a name="pdf-rawset"></a><hr /><h3><code>rawset (table, index, value)</code></h3>
4623+<p><a name="pdf-rawset"></a><hr></hr><h3><code>rawset (table, index, value)</code></h3>
45664624 Sets the real value of <code>table[index]</code> to <code>value</code>,
45674625 without invoking any metamethod.
45684626 <code>table</code> must be a table,
45694627 <code>index</code> any value different from <b>nil</b>,
45704628 and <code>value</code> any Lua value.
45714629
4572−<p><a name="pdf-select"></a><hr /><h3><code>select (index, ...)</code></h3>
4630+<p><a name="pdf-select"></a><hr></hr><h3><code>select (index, ...)</code></h3>
45734631
45744632 <p>If <code>index</code> is a number,
45754633 returns all arguments after argument number <code>index</code>.
45764634 Otherwise, <code>index</code> must be the string <code>"#"</code>,
45774635 and <code>select</code> returns the total number of extra arguments it received.
45784636
4579−<p><a name="setfenv"></a><a name="pdf-setfenv"></a><hr /><h3><code>setfenv (f, table)</code></h3>
4637+<p><a name="setfenv"></a><a name="pdf-setfenv"></a><hr></hr><h3><code>setfenv (f, table)</code></h3>
45804638
45814639 <p>Sets the environment to be used by the given function.
45824640 <code>f</code> can be a Lua function or a number
@@ -4588,7 +4646,7 @@ Level 1 is the function calling <code>setfenv</code>. · 5 unmodified lines
45884646 the environment of the running thread.
45894647 In this case, <code>setfenv</code> returns no values.
45904648
4591−<p><a name="pdf-setmetatable"></a><hr /><h3><code>setmetatable (table, metatable)</code></h3>
4649+<p><a name="pdf-setmetatable"></a><hr></hr><h3><code>setmetatable (table, metatable)</code></h3>
45924650
45934651 <p>Sets the metatable for the given table.
45944652 (You cannot change the metatable of other types from Lua, only from C.)
@@ -4599,7 +4657,7 @@ raises an error. · 4 unmodified lines
45994657
46004658 <p>This function returns <code>table</code>.
46014659
4602−<p><a name="pdf-tonumber"></a><hr /><h3><code>tonumber (e [, base])</code></h3>
4660+<p><a name="pdf-tonumber"></a><hr></hr><h3><code>tonumber (e [, base])</code></h3>
46034661 Tries to convert its argument to a number.
46044662 If the argument is already a number or a string convertible
46054663 to a number, then <code>tonumber</code> returns that number;
@@ -4614,7 +4672,7 @@ In base 10 (the default), the number may have a decimal part, · 8 unmodified lines
46144672 as well as an optional exponent part (see <a href="#lexical">2.1</a>).
46154673 In other bases, only unsigned integers are accepted.
46164674
4617−<p><a name="pdf-tostring"></a><hr /><h3><code>tostring (e)</code></h3>
4675+<p><a name="pdf-tostring"></a><hr></hr><h3><code>tostring (e)</code></h3>
46184676 Receives an argument of any type and
46194677 converts it to a string in a reasonable format.
46204678 For complete control of how numbers are converted,
@@ -4625,7 +4683,7 @@ then <code>tostring</code> calls the corresponding value · 4 unmodified lines
46254683 with <code>e</code> as argument,
46264684 and uses the result of the call as its result.
46274685
4628−<p><a name="pdf-type"></a><hr /><h3><code>type (v)</code></h3>
4686+<p><a name="pdf-type"></a><hr></hr><h3><code>type (v)</code></h3>
46294687 Returns the type of its only argument, coded as a string.
46304688 The possible results of this function are
46314689 <code>"nil"</code> (a string, not the value <b>nil</b>),
@@ -4637,7 +4695,7 @@ The possible results of this function are · 5 unmodified lines
46374695 <code>"thread"</code>,
46384696 and <code>"userdata"</code>.
46394697
4640−<p><a name="pdf-unpack"></a><hr /><h3><code>unpack (list [, i [, j]])</code></h3>
4698+<p><a name="pdf-unpack"></a><hr></hr><h3><code>unpack (list [, i [, j]])</code></h3>
46414699 Returns the elements from the given table.
46424700 This function is equivalent to
46434701 <pre>
@@ -4648,12 +4706,12 @@ of elements. · 4 unmodified lines
46484706 By default, <code>i</code> is 1 and <code>j</code> is the length of the list,
46494707 as defined by the length operator (see <a href="#len-op">2.5.5</a>).
46504708
4651−<p><a name="pdf-_VERSION"></a><hr /><h3><code>_VERSION</code></h3>
4709+<p><a name="pdf-_VERSION"></a><hr></hr><h3><code>_VERSION</code></h3>
46524710 A global variable (not a function) that
46534711 holds a string containing the current interpreter version.
46544712 The current contents of this variable is <code>"Lua 5.1"</code>.
46554713
4656−<p><a name="pdf-xpcall"></a><hr /><h3><code>xpcall (f, err)</code></h3>
4714+<p><a name="pdf-xpcall"></a><hr></hr><h3><code>xpcall (f, err)</code></h3>
46574715
46584716 <p>This function is similar to <code>pcall</code>,
46594717 except that you can set a new error handler.
@@ -4677,14 +4735,14 @@ In case of any error, · 17 unmodified lines
46774735 the basic library and come inside the table <code>coroutine</code>.
46784736 See <a href="#coroutine">2.11</a> for a general description of coroutines.
46794737
4680−<p><a name="pdf-coroutine.create"></a><hr /><h3><code>coroutine.create (f)</code></h3>
4738+<p><a name="pdf-coroutine.create"></a><hr></hr><h3><code>coroutine.create (f)</code></h3>
46814739
46824740 <p>Creates a new coroutine, with body <code>f</code>.
46834741 <code>f</code> must be a Lua function.
46844742 Returns this new coroutine,
46854743 an object with type <code>"thread"</code>.
46864744
4687−<p><a name="pdf-coroutine.resume"></a><hr /><h3><code>coroutine.resume (co [, val1, ..., valn])</code></h3>
4745+<p><a name="pdf-coroutine.resume"></a><hr></hr><h3><code>coroutine.resume (co [, val1, ..., valn])</code></h3>
46884746
46894747 <p>Starts or continues the execution of coroutine <code>co</code>.
46904748 The first time you resume a coroutine,
@@ -4703,12 +4761,12 @@ as the results from the yield. · 12 unmodified lines
47034761 If there is any error,
47044762 <code>resume</code> returns <b>false</b> plus the error message.
47054763
4706−<p><a name="pdf-coroutine.running"></a><hr /><h3><code>coroutine.running ()</code></h3>
4764+<p><a name="pdf-coroutine.running"></a><hr></hr><h3><code>coroutine.running ()</code></h3>
47074765
47084766 <p>Returns the running coroutine,
47094767 or <b>nil</b> when called by the main thread.
47104768
4711−<p><a name="pdf-coroutine.status"></a><hr /><h3><code>coroutine.status (co)</code></h3>
4769+<p><a name="pdf-coroutine.status"></a><hr></hr><h3><code>coroutine.status (co)</code></h3>
47124770
47134771 <p>Returns the status of coroutine <code>co</code>, as a string:
47144772 <code>"running"</code>,
@@ -4720,7 +4778,7 @@ or if it has not started running yet; · 5 unmodified lines
47204778 and <code>"dead"</code> if the coroutine has finished its body function,
47214779 or if it has stopped with an error.
47224780
4723−<p><a name="pdf-coroutine.wrap"></a><hr /><h3><code>coroutine.wrap (f)</code></h3>
4781+<p><a name="pdf-coroutine.wrap"></a><hr></hr><h3><code>coroutine.wrap (f)</code></h3>
47244782
47254783 <p>Creates a new coroutine, with body <code>f</code>.
47264784 <code>f</code> must be a Lua function.
@@ -4731,7 +4789,7 @@ Returns the same values returned by <code>resume</code>, · 4 unmodified lines
47314789 except the first boolean.
47324790 In case of error, propagates the error.
47334791
4734−<p><a name="pdf-coroutine.yield"></a><hr /><h3><code>coroutine.yield ([val1, ..., valn])</code></h3>
4792+<p><a name="pdf-coroutine.yield"></a><hr></hr><h3><code>coroutine.yield ([val1, ..., valn])</code></h3>
47354793
47364794 <p>Suspends the execution of the calling coroutine.
47374795 The coroutine can be running neither a C function,
@@ -4746,7 +4804,7 @@ It exports two of its functions directly in the global environment: · 8 unmodified lines
47464804 <a href="#pdf-require"><code>require</code></a> and <a href="#pdf-module"><code>module</code></a>.
47474805 Everything else is exported in a table <code>package</code>.
47484806
4749−<p><a name="pdf-module"></a><hr /><h3><code>module (name [, ...])</code></h3>
4807+<p><a name="pdf-module"></a><hr></hr><h3><code>module (name [, ...])</code></h3>
47504808
47514809 <p>Creates a module.
47524810 If there is a table in <code>package.loaded[name]</code>,
@@ -4776,7 +4834,7 @@ field <code>b</code> of global <code>a</code>. · 23 unmodified lines
47764834 the module name,
47774835 where each option is a function to be applied over the module.
47784836
4779−<p><a name="pdf-require"></a><hr /><h3><code>require (modname)</code></h3>
4837+<p><a name="pdf-require"></a><hr></hr><h3><code>require (modname)</code></h3>
47804838
47814839 <p>Loads the given module.
47824840 The function starts by looking into the table <code>package.loaded</code>
@@ -4830,14 +4888,14 @@ If the loader returns any value, · 47 unmodified lines
48304888 If the loader returns no value and
48314889 has not assigned any value to <code>package.loaded[modname]</code>,
48324890 then <code>require</code> assigns <b>true</b> to that entry.
4833−In any case, require returns the
4891+In any case, <code>require</code> returns the
48344892 final value of <code>package.loaded[modname]</code>.
48354893
48364894 <p>If there is any error loading or running the module,
48374895 or if it cannot find any loader for that module,
48384896 then <code>require</code> signals an error.
48394897
4840−<p><a name="pdf-package.cpath"></a><hr /><h3><code>package.cpath</code></h3>
4898+<p><a name="pdf-package.cpath"></a><hr></hr><h3><code>package.cpath</code></h3>
48414899
48424900 <p>The path used by <a href="#pdf-require"><code>require</code></a> to search for a C loader.
48434901
@@ -4846,7 +4904,7 @@ it initializes the Lua path <a href="#pdf-package.path"><code>package.path</code · 2 unmodified lines
48464904 using the environment variable <code>LUA_CPATH</code>
48474905 (plus another default path defined in <code>luaconf.h</code>).
48484906
4849−<p><a name="pdf-package.loaded"></a><hr /><h3><code>package.loaded</code></h3>
4907+<p><a name="pdf-package.loaded"></a><hr></hr><h3><code>package.loaded</code></h3>
48504908
48514909 <p>A table used by <a href="#pdf-require"><code>require</code></a> to control which
48524910 modules are already loaded.
@@ -4854,7 +4912,7 @@ When you require a module <code>modname</code> and · 1 unmodified line
48544912 <code>package.loaded[modname]</code> is not false,
48554913 <a href="#pdf-require"><code>require</code></a> simply returns the value stored there.
48564914
4857−<p><a name="pdf-package.loadlib"></a><hr /><h3><code>package.loadlib (libname, funcname)</code></h3>
4915+<p><a name="pdf-package.loadlib"></a><hr></hr><h3><code>package.loadlib (libname, funcname)</code></h3>
48584916
48594917 <p>Dynamically links the host program with the C library <code>libname</code>.
48604918 Inside this library, looks for a function <code>funcname</code>
@@ -4864,7 +4922,8 @@ and returns this function as a C function. · 3 unmodified lines
48644922 <p>This is a low-level function.
48654923 It completely bypasses the package and module system.
48664924 Unlike <a href="#pdf-require"><code>require</code></a>,
4867−it does not perform any path searching or automatically adds extensions.
4925+it does not perform any path searching and
4926+does not automatically adds extensions.
48684927 <code>libname</code> must be the complete file name of the C library,
48694928 including if necessary a path and extension.
48704929 <code>funcname</code> must be the exact name exported by the C library
@@ -4875,7 +4934,7 @@ As such, it is only available on some platforms · 4 unmodified lines
48754934 (Windows, Linux, Mac OS X, Solaris, BSD,
48764935 plus other Unix systems that support the <code>dlfcn</code> standard).
48774936
4878−<p><a name="pdf-package.path"></a><hr /><h3><code>package.path</code></h3>
4937+<p><a name="pdf-package.path"></a><hr></hr><h3><code>package.path</code></h3>
48794938
48804939 <p>The path used by <a href="#pdf-require"><code>require</code></a> to search for a Lua loader.
48814940
@@ -4901,12 +4960,12 @@ will try to load the files · 19 unmodified lines
49014960 <code>./foo.lua</code>, <code>./foo.lc</code>, and
49024961 <code>/usr/local/foo/init.lua</code>, in that order.
49034962
4904−<p><a name="pdf-package.preload"></a><hr /><h3><code>package.preload</code></h3>
4963+<p><a name="pdf-package.preload"></a><hr></hr><h3><code>package.preload</code></h3>
49054964
49064965 <p>A table to store loaders for specific modules
49074966 (see <a href="#pdf-require"><code>require</code></a>).
49084967
4909−<p><a name="pdf-package.seeall"></a><hr /><h3><code>package.seeall (module)</code></h3>
4968+<p><a name="pdf-package.seeall"></a><hr></hr><h3><code>package.seeall (module)</code></h3>
49104969
49114970 <p>Sets a metatable for <code>module</code> with
49124971 its <code>__index</code> field referring to the global environment,
@@ -4932,7 +4991,7 @@ Therefore, you can use the string functions in object-oriented style. · 19 unmodified lines
49324991 For instance, <code>string.byte(s, i)</code>
49334992 can be written as <code>s:byte(i)</code>.
49344993
4935−<p><a name="pdf-string.byte"></a><hr /><h3><code>string.byte (s [, i [, j]])</code></h3>
4994+<p><a name="pdf-string.byte"></a><hr></hr><h3><code>string.byte (s [, i [, j]])</code></h3>
49364995 Returns the internal numerical codes of the characters <code>s[i]</code>,
49374996 <code>s[i+1]</code>, ..., <code>s[j]</code>.
49384997 The default value for <code>i</code> is 1;
@@ -4940,7 +4999,7 @@ the default value for <code>j</code> is <code>i</code>. · 1 unmodified line
49404999
49415000 <p>Note that numerical codes are not necessarily portable across platforms.
49425001
4943−<p><a name="pdf-string.char"></a><hr /><h3><code>string.char (i1, i2, ...)</code></h3>
5002+<p><a name="pdf-string.char"></a><hr></hr><h3><code>string.char (i1, i2, ...)</code></h3>
49445003 Receives 0 or more integers.
49455004 Returns a string with length equal to the number of arguments,
49465005 in which each character has the internal numerical code equal
@@ -4948,14 +5007,14 @@ to its corresponding argument. · 1 unmodified line
49485007
49495008 <p>Note that numerical codes are not necessarily portable across platforms.
49505009
4951−<p><a name="pdf-string.dump"></a><hr /><h3><code>string.dump (function)</code></h3>
5010+<p><a name="pdf-string.dump"></a><hr></hr><h3><code>string.dump (function)</code></h3>
49525011
49535012 <p>Returns a string containing a binary representation of the given function,
49545013 so that a later <a href="#pdf-loadstring"><code>loadstring</code></a> on that string returns
49555014 a copy of the function.
49565015 <code>function</code> must be a Lua function without upvalues.
49575016
4958−<p><a name="pdf-string.find"></a><hr /><h3><code>string.find (s, pattern [, init [, plain]])</code></h3>
5017+<p><a name="pdf-string.find"></a><hr></hr><h3><code>string.find (s, pattern [, init [, plain]])</code></h3>
49595018 Looks for the first match of
49605019 <code>pattern</code> in the string <code>s</code>.
49615020 If it finds a match, then <code>find</code> returns the indices of <code>s</code>
@@ -4975,7 +5034,7 @@ then in a successful match · 13 unmodified lines
49755034 the captured values are also returned,
49765035 after the two indices.
49775036
4978−<p><a name="format"></a><a name="pdf-string.format"></a><hr /><h3><code>string.format (formatstring, e1, e2, ...)</code></h3>
5037+<p><a name="format"></a><a name="pdf-string.format"></a><hr></hr><h3><code>string.format (formatstring, e1, e2, ...)</code></h3>
49795038 Returns a formatted version of its variable number of arguments
49805039 following the description given in its first argument (which must be a string).
49815040 The format string follows the same rules as the <code>printf</code> family of
@@ -5008,7 +5067,7 @@ whereas <code>q</code> and <code>s</code> expect a string. · 26 unmodified lines
50085067 <p>This function does not accept string values
50095068 containing embedded zeros.
50105069
5011−<p><a name="pdf-string.gmatch"></a><hr /><h3><code>string.gmatch (s, pattern)</code></h3>
5070+<p><a name="pdf-string.gmatch"></a><hr></hr><h3><code>string.gmatch (s, pattern)</code></h3>
50125071 Returns an iterator function that,
50135072 each time it is called,
50145073 returns the next captures from <code>pattern</code> over string <code>s</code>.
@@ -5035,7 +5094,7 @@ given string into a table: · 20 unmodified lines
50355094 end
50365095 </pre>
50375096
5038−<p><a name="pdf-string.gsub"></a><hr /><h3><code>string.gsub (s, pattern, repl [, n])</code></h3>
5097+<p><a name="pdf-string.gsub"></a><hr></hr><h3><code>string.gsub (s, pattern, repl [, n])</code></h3>
50395098 Returns a copy of <code>s</code>
50405099 in which all occurrences of the <code>pattern</code> have been
50415100 replaced by a replacement string specified by <code>repl</code>,
@@ -5061,12 +5120,8 @@ match occurs, with all captured substrings passed as arguments, · 19 unmodified lines
50615120 in order;
50625121 if the pattern specifies no captures,
50635122 then the whole match is passed as a sole argument.
5064−If <code>repl</code> is a table, then this table is queried with the
5065−value of the first capture or of the whole match,
5066−if the pattern specifies no captures.
50675123
5068−<p>In both cases,
5069−if the value returned by the function or by the table query
5124+<p>If the value returned by the table query or by the function call
50705125 is a string or a number,
50715126 then it is used as the replacement string;
50725127 otherwise, if it is <b>false</b> or <b>nil</b>,
@@ -5102,19 +5157,19 @@ For instance, when <code>n</code> is 1 only the first occurrence of · 29 unmodified lines
51025157 --> x="lua-5.1.tar.gz"
51035158 </pre>
51045159
5105−<p><a name="pdf-string.len"></a><hr /><h3><code>string.len (s)</code></h3>
5160+<p><a name="pdf-string.len"></a><hr></hr><h3><code>string.len (s)</code></h3>
51065161 Receives a string and returns its length.
51075162 The empty string <code>""</code> has length 0.
51085163 Embedded zeros are counted,
51095164 so <code>"a\000bc\000"</code> has length 5.
51105165
5111−<p><a name="pdf-string.lower"></a><hr /><h3><code>string.lower (s)</code></h3>
5166+<p><a name="pdf-string.lower"></a><hr></hr><h3><code>string.lower (s)</code></h3>
51125167 Receives a string and returns a copy of that string with all
51135168 uppercase letters changed to lowercase.
51145169 All other characters are left unchanged.
51155170 The definition of what an uppercase letter is depends on the current locale.
51165171
5117−<p><a name="pdf-string.match"></a><hr /><h3><code>string.match (s, pattern [, init])</code></h3>
5172+<p><a name="pdf-string.match"></a><hr></hr><h3><code>string.match (s, pattern [, init])</code></h3>
51185173 Looks for the first <em>match</em> of
51195174 <code>pattern</code> in the string <code>s</code>.
51205175 If it finds one, then <code>match</code> returns
@@ -5126,14 +5181,14 @@ A third, optional numerical argument <code>init</code> specifies · 5 unmodified lines
51265181 where to start the search;
51275182 its default value is 1 and may be negative.
51285183
5129−<p><a name="pdf-string.rep"></a><hr /><h3><code>string.rep (s, n)</code></h3>
5184+<p><a name="pdf-string.rep"></a><hr></hr><h3><code>string.rep (s, n)</code></h3>
51305185 Returns a string that is the concatenation of <code>n</code> copies of
51315186 the string <code>s</code>.
51325187
5133−<p><a name="pdf-string.reverse"></a><hr /><h3><code>string.reverse (s)</code></h3>
5188+<p><a name="pdf-string.reverse"></a><hr></hr><h3><code>string.reverse (s)</code></h3>
51345189 Returns a string that is the string <code>s</code> reversed.
51355190
5136−<p><a name="pdf-string.sub"></a><hr /><h3><code>string.sub (s, i [, j])</code></h3>
5191+<p><a name="pdf-string.sub"></a><hr></hr><h3><code>string.sub (s, i [, j])</code></h3>
51375192 Returns the substring of <code>s</code> that
51385193 starts at <code>i</code> and continues until <code>j</code>;
51395194 <code>i</code> and <code>j</code> may be negative.
@@ -5145,7 +5200,7 @@ with length <code>j</code>, · 5 unmodified lines
51455200 and <code>string.sub(s, -i)</code> returns a suffix of <code>s</code>
51465201 with length <code>i</code>.
51475202
5148−<p><a name="pdf-string.upper"></a><hr /><h3><code>string.upper (s)</code></h3>
5203+<p><a name="pdf-string.upper"></a><hr></hr><h3><code>string.upper (s)</code></h3>
51495204 Receives a string and returns a copy of that string with all
51505205 lowercase letters changed to uppercase.
51515206 All other characters are left unchanged.
@@ -5279,17 +5334,17 @@ It provides all its functions inside the table <code>table</code>. · 127 unmodified lines
52795334
52805335 <p>Most functions in the table library assume that the table
52815336 represents an array or a list.
5282−For those functions, when we talk about "the length" of a table
5337+For those functions, when we talk about the "length" of a table
52835338 we mean the result of the length operator.
52845339
5285−<p><a name="pdf-table.concat"></a><hr /><h3><code>table.concat (table [, sep [, i [, j]]])</code></h3>
5340+<p><a name="pdf-table.concat"></a><hr></hr><h3><code>table.concat (table [, sep [, i [, j]]])</code></h3>
52865341 Returns <code>table[i]..sep..table[i+1] ... sep..table[j]</code>.
52875342 The default value for <code>sep</code> is the empty string,
52885343 the default for <code>i</code> is 1,
52895344 and the default for <code>j</code> is the length of the table.
52905345 If <code>i</code> is greater than <code>j</code>, returns the empty string.
52915346
5292−<p><a name="pdf-table.insert"></a><hr /><h3><code>table.insert (table, [pos,] value)</code></h3>
5347+<p><a name="pdf-table.insert"></a><hr></hr><h3><code>table.insert (table, [pos,] value)</code></h3>
52935348
52945349 <p>Inserts element <code>value</code> at position <code>pos</code> in <code>table</code>,
52955350 shifting up other elements to open space, if necessary.
@@ -5298,14 +5353,14 @@ where <code>n</code> is the length of the table (see <a href="#len-op">2.5.5</a> · 2 unmodified lines
52985353 so that a call <code>table.insert(t,x)</code> inserts <code>x</code> at the end
52995354 of table <code>t</code>.
53005355
5301−<p><a name="pdf-table.maxn"></a><hr /><h3><code>table.maxn (table)</code></h3>
5356+<p><a name="pdf-table.maxn"></a><hr></hr><h3><code>table.maxn (table)</code></h3>
53025357
53035358 <p>Returns the largest positive numerical index of the given table,
53045359 or zero if the table has no positive numerical indices.
53055360 (To do its job this function does a linear traversal of
53065361 the whole table.)
53075362
5308−<p><a name="pdf-table.remove"></a><hr /><h3><code>table.remove (table [, pos])</code></h3>
5363+<p><a name="pdf-table.remove"></a><hr></hr><h3><code>table.remove (table [, pos])</code></h3>
53095364
53105365 <p>Removes from <code>table</code> the element at position <code>pos</code>,
53115366 shifting down other elements to close the space, if necessary.
@@ -5315,7 +5370,7 @@ where <code>n</code> is the length of the table, · 3 unmodified lines
53155370 so that a call <code>table.remove(t)</code> removes the last element
53165371 of table <code>t</code>.
53175372
5318−<p><a name="pdf-table.sort"></a><hr /><h3><code>table.sort (table [, comp])</code></h3>
5373+<p><a name="pdf-table.sort"></a><hr></hr><h3><code>table.sort (table [, comp])</code></h3>
53195374 Sorts table elements in a given order, <em>in-place</em>,
53205375 from <code>table[1]</code> to <code>table[n]</code>,
53215376 where <code>n</code> is the length of the table.
@@ -5336,16 +5391,17 @@ may have their relative positions changed by the sort. · 14 unmodified lines
53365391 <p>This library is an interface to the standard C math library.
53375392 It provides all its functions inside the table <code>math</code>.
53385393 The library provides the following functions:
5339−<a name="pdf-math.abs"></a><a name="pdf-math.acos"></a><a name="pdf-math.asin"></a><a name="pdf-math.atan"></a>
5340−<a name="pdf-math.atan2"></a><a name="pdf-math.ceil"></a><a name="pdf-math.cos"></a><a name="pdf-math.cosh"></a>
5341−<a name="pdf-math.def"></a><a name="pdf-math.exp"></a>
5342−<a name="pdf-math.floor"></a><a name="pdf-math.log"></a><a name="pdf-math.log10"></a>
5343−<a name="pdf-math.fmod"></a><a name="pdf-math.pow"></a><a name="pdf-math.sin"></a>
5344−<a name="pdf-math.sqrt"></a><a name="pdf-math.tan"></a><a name="pdf-math.ldexp"></a>
5345−<a name="pdf-math.sinh"></a><a name="pdf-math.tanh"></a>
5394+<a name="pdf-math.abs"></a> <a name="pdf-math.acos"></a> <a name="pdf-math.asin"></a> <a name="pdf-math.atan"></a>
5395+<a name="pdf-math.atan2"></a> <a name="pdf-math.ceil"></a> <a name="pdf-math.cos"></a> <a name="pdf-math.cosh"></a>
5396+<a name="pdf-math.deg"></a> <a name="pdf-math.exp"></a> <a name="pdf-math.floor"></a> <a name="pdf-math.fmod"></a>
5397+<a name="pdf-math.frexp"></a> <a name="pdf-math.ldexp"></a> <a name="pdf-math.log"></a> <a name="pdf-math.log10"></a>
5398+<a name="pdf-math.max"></a> <a name="pdf-math.min"></a> <a name="pdf-math.modf"></a> <a name="pdf-math.pow"></a>
5399+<a name="pdf-math.rad"></a> <a name="pdf-math.random"></a> <a name="pdf-math.randomseed"></a>
5400+<a name="pdf-math.sin"></a> <a name="pdf-math.sinh"></a> <a name="pdf-math.sqrt"></a> <a name="pdf-math.tan"></a>
5401+<a name="pdf-math.tanh"></a>
53465402 <pre>
53475403 math.abs math.acos math.asin math.atan math.atan2
5348− math.ceil math.cosh math.cos math.deg math.exp
5404+ math.ceil math.cos math.cosh math.deg math.exp
53495405 math.floor math.fmod math.frexp math.ldexp math.log
53505406 math.log10 math.max math.min math.modf math.pow
53515407 math.rad math.random math.randomseed math.sin
@@ -5413,16 +5469,16 @@ all I/O functions return <b>nil</b> on failure · 61 unmodified lines
54135469 (plus an error message as a second result)
54145470 and some value different from <b>nil</b> on success.
54155471
5416−<p><a name="pdf-io.close"></a><hr /><h3><code>io.close ([file])</code></h3>
5472+<p><a name="pdf-io.close"></a><hr></hr><h3><code>io.close ([file])</code></h3>
54175473
54185474 <p>Equivalent to <code>file:close()</code>.
54195475 Without a <code>file</code>, closes the default output file.
54205476
5421−<p><a name="pdf-io.flush"></a><hr /><h3><code>io.flush ()</code></h3>
5477+<p><a name="pdf-io.flush"></a><hr></hr><h3><code>io.flush ()</code></h3>
54225478
54235479 <p>Equivalent to <code>file:flush</code> over the default output file.
54245480
5425−<p><a name="pdf-io.input"></a><hr /><h3><code>io.input ([file])</code></h3>
5481+<p><a name="pdf-io.input"></a><hr></hr><h3><code>io.input ([file])</code></h3>
54265482
54275483 <p>When called with a file name, it opens the named file (in text mode),
54285484 and sets its handle as the default input file.
@@ -5434,7 +5490,7 @@ it returns the current default input file. · 5 unmodified lines
54345490 <p>In case of errors this function raises the error,
54355491 instead of returning an error code.
54365492
5437−<p><a name="pdf-io.lines"></a><hr /><h3><code>io.lines ([filename])</code></h3>
5493+<p><a name="pdf-io.lines"></a><hr></hr><h3><code>io.lines ([filename])</code></h3>
54385494
54395495 <p>Opens the given file name in read mode
54405496 and returns an iterator function that,
@@ -5453,7 +5509,7 @@ to <code>io.input():lines()</code>; · 12 unmodified lines
54535509 that is, it iterates over the lines of the default input file.
54545510 In that case it does not close the file when the loop ends.
54555511
5456−<p><a name="pdf-io.open"></a><hr /><h3><code>io.open (filename [, mode])</code></h3>
5512+<p><a name="pdf-io.open"></a><hr></hr><h3><code>io.open (filename [, mode])</code></h3>
54575513
54585514 <p>This function opens a file,
54595515 in the mode specified in the string <code>mode</code>.
@@ -5475,11 +5531,11 @@ which is needed in some systems to open the file in binary mode. · 15 unmodified lines
54755531 This string is exactly what is used in the
54765532 standard C function <code>fopen</code>.
54775533
5478−<p><a name="pdf-io.output"></a><hr /><h3><code>io.output ([file])</code></h3>
5534+<p><a name="pdf-io.output"></a><hr></hr><h3><code>io.output ([file])</code></h3>
54795535
54805536 <p>Similar to <a href="#pdf-io.input"><code>io.input</code></a>, but operates over the default output file.
54815537
5482−<p><a name="pdf-io.popen"></a><hr /><h3><code>io.popen ([prog [, mode]])</code></h3>
5538+<p><a name="pdf-io.popen"></a><hr></hr><h3><code>io.popen ([prog [, mode]])</code></h3>
54835539
54845540 <p>Starts program <code>prog</code> in a separated process and returns
54855541 a file handle that you can use to read data from that program
@@ -5490,39 +5546,39 @@ or to write data to that program · 4 unmodified lines
54905546 <p>This function is system dependent and is not available
54915547 on all platforms.
54925548
5493−<p><a name="pdf-io.read"></a><hr /><h3><code>io.read (format1, ...)</code></h3>
5549+<p><a name="pdf-io.read"></a><hr></hr><h3><code>io.read (format1, ...)</code></h3>
54945550
54955551 <p>Equivalent to <code>io.input():read</code>.
54965552
5497−<p><a name="pdf-io.tmpfile"></a><hr /><h3><code>io.tmpfile ()</code></h3>
5553+<p><a name="pdf-io.tmpfile"></a><hr></hr><h3><code>io.tmpfile ()</code></h3>
54985554
54995555 <p>Returns a handle for a temporary file.
55005556 This file is opened in update mode
55015557 and it is automatically removed when the program ends.
55025558
5503−<p><a name="pdf-io.type"></a><hr /><h3><code>io.type (obj)</code></h3>
5559+<p><a name="pdf-io.type"></a><hr></hr><h3><code>io.type (obj)</code></h3>
55045560
55055561 <p>Checks whether <code>obj</code> is a valid file handle.
55065562 Returns the string <code>"file"</code> if <code>obj</code> is an open file handle,
55075563 <code>"closed file"</code> if <code>obj</code> is a closed file handle,
55085564 and <b>nil</b> if <code>obj</code> is not a file handle.
55095565
5510−<p><a name="pdf-io.write"></a><hr /><h3><code>io.write (value1, ...)</code></h3>
5566+<p><a name="pdf-io.write"></a><hr></hr><h3><code>io.write (value1, ...)</code></h3>
55115567
55125568 <p>Equivalent to <code>io.output():write</code>.
55135569
5514−<p><a name="pdf-file:close"></a><hr /><h3><code>file:close ()</code></h3>
5570+<p><a name="pdf-file:close"></a><hr></hr><h3><code>file:close ()</code></h3>
55155571
55165572 <p>Closes <code>file</code>.
55175573 Note that files are automatically closed when
55185574 their handles are garbage collected,
5519−but that takes an unpredictable time to happen.
5575+but that takes an unpredictable amount of time to happen.
55205576
5521−<p><a name="flush"></a><a name="pdf-file:flush"></a><hr /><h3><code>file:flush ()</code></h3>
5577+<p><a name="flush"></a><a name="pdf-file:flush"></a><hr></hr><h3><code>file:flush ()</code></h3>
55225578
55235579 <p>Saves any written data to <code>file</code>.
55245580
5525−<p><a name="pdf-file:lines"></a><hr /><h3><code>file:lines ()</code></h3>
5581+<p><a name="pdf-file:lines"></a><hr></hr><h3><code>file:lines ()</code></h3>
55265582
55275583 <p>Returns an iterator function that,
55285584 each time it is called,
@@ -5535,7 +5591,7 @@ will iterate over all lines of the file. · 6 unmodified lines
55355591 (Unlike <a href="#pdf-io.lines"><code>io.lines</code></a>, this function does not close the file
55365592 when the loop ends.)
55375593
5538−<p><a name="pdf-file:read"></a><hr /><h3><code>file:read (format1, ...)</code></h3>
5594+<p><a name="pdf-file:read"></a><hr></hr><h3><code>file:read (format1, ...)</code></h3>
55395595
55405596 <p>Reads the file <code>file</code>,
55415597 according to the given formats, which specify what to read.
@@ -5562,16 +5618,16 @@ it reads nothing and returns an empty string, · 20 unmodified lines
55625618 or <b>nil</b> on end of file.
55635619 </ul>
55645620
5565−<p><a name="pdf-file:seek"></a><hr /><h3><code>file:seek ([whence] [, offset])</code></h3>
5621+<p><a name="pdf-file:seek"></a><hr></hr><h3><code>file:seek ([whence] [, offset])</code></h3>
55665622
55675623 <p>Sets and gets the file position,
55685624 measured from the beginning of the file,
55695625 to the position given by <code>offset</code> plus a base
55705626 specified by the string <code>whence</code>, as follows:
55715627 <ul>
5572−<li><b>"set"</b> base is position 0 (beginning of the file);
5573−<li><b>"cur"</b> base is current position;
5574−<li><b>"end"</b> base is end of file;
5628+<li><b>"set"</b> --- base is position 0 (beginning of the file);
5629+<li><b>"cur"</b> --- base is current position;
5630+<li><b>"end"</b> --- base is end of file;
55755631 </ul>
55765632 In case of success, function <code>seek</code> returns the final file position,
55775633 measured in bytes from the beginning of the file.
@@ -5587,7 +5643,7 @@ beginning of the file (and returns 0); · 9 unmodified lines
55875643 and the call <code>file:seek("end")</code> sets the position to the
55885644 end of the file, and returns its size.
55895645
5590−<p><a name="pdf-file:setvbuf"></a><hr /><h3><code>file:setvbuf (mode [, size])</code></h3>
5646+<p><a name="pdf-file:setvbuf"></a><hr></hr><h3><code>file:setvbuf (mode [, size])</code></h3>
55915647
55925648 <p>Sets the buffering mode for an output file.
55935649 There are three available modes:
@@ -5606,7 +5662,7 @@ For the last two cases, <code>sizes</code> · 12 unmodified lines
56065662 specifies the size of the buffer, in bytes.
56075663 The default is an appropriate size.
56085664
5609−<p><a name="pdf-file:write"></a><hr /><h3><code>file:write (value1, ...)</code></h3>
5665+<p><a name="pdf-file:write"></a><hr></hr><h3><code>file:write (value1, ...)</code></h3>
56105666
56115667 <p>Writes the value of each of its arguments to
56125668 the <code>file</code>.
@@ -5618,12 +5674,12 @@ use <a href="#pdf-tostring"><code>tostring</code></a> or <a href="#pdf-string.fo · 5 unmodified lines
56185674
56195675 <p>This library is implemented through table <code>os</code>.
56205676
5621−<p><a name="pdf-os.clock"></a><hr /><h3><code>os.clock ()</code></h3>
5677+<p><a name="pdf-os.clock"></a><hr></hr><h3><code>os.clock ()</code></h3>
56225678
56235679 <p>Returns an approximation of the amount in seconds of CPU time
56245680 used by the program.
56255681
5626−<p><a name="pdf-os.date"></a><hr /><h3><code>os.date ([format [, time]])</code></h3>
5682+<p><a name="pdf-os.date"></a><hr></hr><h3><code>os.date ([format [, time]])</code></h3>
56275683
56285684 <p>Returns a string or a table containing date and time,
56295685 formatted according to the given string <code>format</code>.
@@ -5653,13 +5709,13 @@ formatted according to the same rules as the C function <code>strftime</code>. · 23 unmodified lines
56535709 the host system and on the current locale
56545710 (that is, <code>os.date()</code> is equivalent to <code>os.date("%c")</code>).
56555711
5656−<p><a name="pdf-os.difftime"></a><hr /><h3><code>os.difftime (t2, t1)</code></h3>
5712+<p><a name="pdf-os.difftime"></a><hr></hr><h3><code>os.difftime (t2, t1)</code></h3>
56575713
56585714 <p>Returns the number of seconds from time <code>t1</code> to time <code>t2</code>.
5659−In Posix, Windows, and some other systems,
5715+In POSIX, Windows, and some other systems,
56605716 this value is exactly <code>t2</code><em>-</em><code>t1</code>.
56615717
5662−<p><a name="pdf-os.execute"></a><hr /><h3><code>os.execute ([command])</code></h3>
5718+<p><a name="pdf-os.execute"></a><hr></hr><h3><code>os.execute ([command])</code></h3>
56635719
56645720 <p>This function is equivalent to the C function <code>system</code>.
56655721 It passes <code>command</code> to be executed by an operating system shell.
@@ -5667,32 +5723,32 @@ It returns a status code, which is system-dependent. · 1 unmodified line
56675723 If <code>command</code> is absent, then it returns nonzero if a shell is available
56685724 and zero otherwise.
56695725
5670−<p><a name="pdf-os.exit"></a><hr /><h3><code>os.exit ([code])</code></h3>
5726+<p><a name="pdf-os.exit"></a><hr></hr><h3><code>os.exit ([code])</code></h3>
56715727
56725728 <p>Calls the C function <code>exit</code>,
56735729 with an optional <code>code</code>,
56745730 to terminate the host program.
56755731 The default value for <code>code</code> is the success code.
56765732
5677−<p><a name="pdf-os.getenv"></a><hr /><h3><code>os.getenv (varname)</code></h3>
5733+<p><a name="pdf-os.getenv"></a><hr></hr><h3><code>os.getenv (varname)</code></h3>
56785734
56795735 <p>Returns the value of the process environment variable <code>varname</code>,
56805736 or <b>nil</b> if the variable is not defined.
56815737
5682−<p><a name="pdf-os.remove"></a><hr /><h3><code>os.remove (filename)</code></h3>
5738+<p><a name="pdf-os.remove"></a><hr></hr><h3><code>os.remove (filename)</code></h3>
56835739
56845740 <p>Deletes the file or directory with the given name.
56855741 Directories must be empty to be removed.
56865742 If this function fails, it returns <b>nil</b>,
56875743 plus a string describing the error.
56885744
5689−<p><a name="pdf-os.rename"></a><hr /><h3><code>os.rename (oldname, newname)</code></h3>
5745+<p><a name="pdf-os.rename"></a><hr></hr><h3><code>os.rename (oldname, newname)</code></h3>
56905746
56915747 <p>Renames file or directory named <code>oldname</code> to <code>newname</code>.
56925748 If this function fails, it returns <b>nil</b>,
56935749 plus a string describing the error.
56945750
5695−<p><a name="pdf-os.setlocale"></a><hr /><h3><code>os.setlocale (locale [, category])</code></h3>
5751+<p><a name="pdf-os.setlocale"></a><hr></hr><h3><code>os.setlocale (locale [, category])</code></h3>
56965752
56975753 <p>Sets the current locale of the program.
56985754 <code>locale</code> is a string specifying a locale;
@@ -5703,7 +5759,7 @@ the default category is <code>"all"</code>. · 4 unmodified lines
57035759 The function returns the name of the new locale,
57045760 or <b>nil</b> if the request cannot be honored.
57055761
5706−<p><a name="pdf-os.time"></a><hr /><h3><code>os.time ([table])</code></h3>
5762+<p><a name="pdf-os.time"></a><hr></hr><h3><code>os.time ([table])</code></h3>
57075763
57085764 <p>Returns the current time when called without arguments,
57095765 or a time representing the date and time specified by the given table.
@@ -5712,13 +5768,13 @@ and may have fields <code>hour</code>, <code>min</code>, <code>sec</code>, and < · 2 unmodified lines
57125768 (for a description of these fields, see the <a href="#pdf-os.date"><code>os.date</code></a> function).
57135769
57145770 <p>The returned value is a number, whose meaning depends on your system.
5715−In Posix, Windows, and some other systems, this number counts the number
5771+In POSIX, Windows, and some other systems, this number counts the number
57165772 of seconds since some given start time (the "epoch").
57175773 In other systems, the meaning is not specified,
57185774 and the number returned by <code>time</code> can be used only as an argument to
57195775 <code>date</code> and <code>difftime</code>.
57205776
5721−<p><a name="pdf-os.tmpname"></a><hr /><h3><code>os.tmpname ()</code></h3>
5777+<p><a name="pdf-os.tmpname"></a><hr></hr><h3><code>os.tmpname ()</code></h3>
57225778
57235779 <p>Returns a string with a file name that can
57245780 be used for a temporary file.
@@ -5745,7 +5801,7 @@ and therefore can compromise otherwise secure code. · 20 unmodified lines
57455801 <p>All functions in this library are provided
57465802 inside the <code>debug</code> table.
57475803
5748−<p><a name="pdf-debug.debug"></a><hr /><h3><code>debug.debug ()</code></h3>
5804+<p><a name="pdf-debug.debug"></a><hr></hr><h3><code>debug.debug ()</code></h3>
57495805
57505806 <p>Enters an interactive mode with the user,
57515807 running each string that the user enters.
@@ -5758,17 +5814,17 @@ so that the caller continues its execution. · 6 unmodified lines
57585814 <p>Note that commands for <code>debug.debug</code> are not lexically nested
57595815 within any function, and so have no direct access to local variables.
57605816
5761−<p><a name="pdf-debug.getfenv"></a><hr /><h3><code>debug.getfenv (o)</code></h3>
5817+<p><a name="pdf-debug.getfenv"></a><hr></hr><h3><code>debug.getfenv (o)</code></h3>
57625818 Returns the environment of object <code>o</code>.
57635819
5764−<p><a name="pdf-debug.gethook"></a><hr /><h3><code>debug.gethook ()</code></h3>
5820+<p><a name="pdf-debug.gethook"></a><hr></hr><h3><code>debug.gethook ()</code></h3>
57655821
57665822 <p>Returns the current hook settings, as three values:
57675823 the current hook function, the current hook mask,
57685824 and the current hook count
57695825 (as set by the <a href="#pdf-debug.sethook"><code>debug.sethook</code></a> function).
57705826
5771−<p><a name="pdf-debug.getinfo"></a><hr /><h3><code>debug.getinfo (function [, what])</code></h3>
5827+<p><a name="pdf-debug.getinfo"></a><hr></hr><h3><code>debug.getinfo (function [, what])</code></h3>
57725828
57735829 <p>Returns a table with information about a function.
57745830 You can give the function directly,
@@ -5792,7 +5848,7 @@ a name of the current function, if a reasonable name can be found, · 17 unmodified lines
57925848 and <code>debug.getinfo(print)</code> returns a table with all available information
57935849 about the <a href="#pdf-print"><code>print</code></a> function.
57945850
5795−<p><a name="pdf-debug.getlocal"></a><hr /><h3><code>debug.getlocal (level, local)</code></h3>
5851+<p><a name="pdf-debug.getlocal"></a><hr></hr><h3><code>debug.getlocal (level, local)</code></h3>
57965852
57975853 <p>This function returns the name and the value of the local variable
57985854 with index <code>local</code> of the function at level <code>level</code> of the stack.
@@ -5807,26 +5863,26 @@ and raises an error when called with a <code>level</code> out of range. · 8 unmodified lines
58075863 represent internal variables
58085864 (loop control variables, temporaries, and C function locals).
58095865
5810−<p><a name="pdf-debug.getmetatable"></a><hr /><h3><code>debug.getmetatable (object)</code></h3>
5866+<p><a name="pdf-debug.getmetatable"></a><hr></hr><h3><code>debug.getmetatable (object)</code></h3>
58115867
58125868 <p>Returns the metatable of the given <code>object</code>
58135869 or <b>nil</b> if it does not have a metatable.
58145870
5815−<p><a name="pdf-debug.getregistry"></a><hr /><h3><code>debug.getregistry ()</code></h3>
5871+<p><a name="pdf-debug.getregistry"></a><hr></hr><h3><code>debug.getregistry ()</code></h3>
58165872
58175873 <p>Returns the registry table (see <a href="#registry">3.5</a>).
58185874
5819−<p><a name="pdf-debug.getupvalue"></a><hr /><h3><code>debug.getupvalue (func, up)</code></h3>
5875+<p><a name="pdf-debug.getupvalue"></a><hr></hr><h3><code>debug.getupvalue (func, up)</code></h3>
58205876
58215877 <p>This function returns the name and the value of the upvalue
58225878 with index <code>up</code> of the function <code>func</code>.
58235879 The function returns <b>nil</b> if there is no upvalue with the given index.
58245880
5825−<p><a name="pdf-debug.setfenv"></a><hr /><h3><code>debug.setfenv (object, table)</code></h3>
5881+<p><a name="pdf-debug.setfenv"></a><hr></hr><h3><code>debug.setfenv (object, table)</code></h3>
58265882
58275883 <p>Sets the environment of the given <code>object</code> to the given <code>table</code>.
58285884
5829−<p><a name="pdf-debug.sethook"></a><hr /><h3><code>debug.sethook (hook, mask [, count])</code></h3>
5885+<p><a name="pdf-debug.sethook"></a><hr></hr><h3><code>debug.sethook (hook, mask [, count])</code></h3>
58305886
58315887 <p>Sets the given function as a hook.
58325888 The string <code>mask</code> and the number <code>count</code> describe
@@ -5859,7 +5915,7 @@ unless the event is <code>"tail return"</code>. · 26 unmodified lines
58595915 In this case, Lua is only simulating the return,
58605916 and a call to <code>getinfo</code> will return invalid data.
58615917
5862−<p><a name="pdf-debug.setlocal"></a><hr /><h3><code>debug.setlocal (level, local, value)</code></h3>
5918+<p><a name="pdf-debug.setlocal"></a><hr></hr><h3><code>debug.setlocal (level, local, value)</code></h3>
58635919
58645920 <p>This function assigns the value <code>value</code> to the local variable
58655921 with index <code>local</code> of the function at level <code>level</code> of the stack.
@@ -5869,12 +5925,12 @@ and raises an error when called with a <code>level</code> out of range. · 3 unmodified lines
58695925 (You can call <code>getinfo</code> to check whether the level is valid.)
58705926 Otherwise, it returns the name of the local variable.
58715927
5872−<p><a name="pdf-debug.setmetatable"></a><hr /><h3><code>debug.setmetatable (object, table)</code></h3>
5928+<p><a name="pdf-debug.setmetatable"></a><hr></hr><h3><code>debug.setmetatable (object, table)</code></h3>
58735929
5874−<p>Sets the metatable for the given <code>object</code> to the given id@{table}
5930+<p>Sets the metatable for the given <code>object</code> to the given <code>table</code>
58755931 (which can be <b>nil</b>).
58765932
5877−<p><a name="pdf-debug.setupvalue"></a><hr /><h3><code>debug.setupvalue (func, up, value)</code></h3>
5933+<p><a name="pdf-debug.setupvalue"></a><hr></hr><h3><code>debug.setupvalue (func, up, value)</code></h3>
58785934
58795935 <p>This function assigns the value <code>value</code> to the upvalue
58805936 with index <code>up</code> of the function <code>func</code>.
@@ -5882,7 +5938,7 @@ The function returns <b>nil</b> if there is no upvalue · 1 unmodified line
58825938 with the given index.
58835939 Otherwise, it returns the name of the upvalue.
58845940
5885−<p><a name="pdf-debug.traceback"></a><hr /><h3><code>debug.traceback ([message])</code></h3>
5941+<p><a name="pdf-debug.traceback"></a><hr></hr><h3><code>debug.traceback ([message])</code></h3>
58865942
58875943 <p>Returns a string with a traceback of the call stack.
58885944 An optional <code>message</code> string is appended
@@ -5969,7 +6025,7 @@ by issuing a different prompt. · 80 unmodified lines
59696025 <p>If the global variable <code>_PROMPT</code> contains a string,
59706026 then its value is used as the prompt.
59716027 Similarly, if the global variable <code>_PROMPT2</code> contains a string,
5972−it its value is used as the secondary prompt
6028+its value is used as the secondary prompt
59736029 (issued during incomplete statements).
59746030 Therefore, both prompts can be changed directly on the command line.
59756031 For instance,
@@ -6001,7 +6057,7 @@ then · 25 unmodified lines
60016057 </pre>
60026058 is a more portable solution.)
60036059
6004−<p><hr />
6060+<p><hr></hr>
60056061
60066062 <p><h1>Incompatibilities with the Previous Version</h1>
60076063
@@ -6110,7 +6166,7 @@ Function <code>luaL_openlib</code> was replaced by <a href="#luaL_register"><cod · 102 unmodified lines
61106166
61116167
61126168 <p>Here is the complete syntax of Lua in extended BNF.
6113−It does not describe operator priorities nor some syntactical restrictions,
6169+It does not describe operator priorities or some syntactical restrictions,
61146170 such as <b>return</b> and <b>break</b> statements
61156171 can only appear as the <em>last</em> statement of a block.
61166172
etc/Makefile+15−6
@@ -8,14 +8,15 @@ SRC= $(TOP)/src · 7 unmodified lines
88 TST= $(TOP)/test
99
1010 CC= gcc
11−CFLAGS= -O2 -Wall $(MYCFLAGS)
12−MYCFLAGS= -ansi -I$(INC)
11+CFLAGS= -O2 -Wall -I$(INC) $(MYCFLAGS)
12+MYCFLAGS=
1313 MYLDFLAGS= -Wl,-E
14−MYLIBS= -lm -ldl
14+MYLIBS= -lm
15+#MYLIBS= -lm -Wl,-E -ldl -lreadline -lhistory -lncurses
1516 RM= rm -f
1617
17−all:
18− @echo 'choose a target: min noparser one clean'
18+default:
19+ @echo 'Please choose a target: min noparser one clean'
1920
2021 min: min.c
2122 $(CC) $(CFLAGS) $@.c -L$(LIB) -llua $(MYLIBS)
@@ -31,5 +32,13 @@ one: · 9 unmodified lines
3132 $(CC) $(CFLAGS) all.c $(MYLIBS)
3233 ./a.out $(TST)/hello.lua
3334
35+strict:
36+ -$(BIN)/lua -e 'print(a);b=2'
37+ -$(BIN)/lua -lstrict -e 'print(a)'
38+ -$(BIN)/lua -e 'function f() b=2 end f()'
39+ -$(BIN)/lua -lstrict -e 'function f() b=2 end f()'
40+
3441 clean:
35− $(RM) noparser.o a.out core core.* *.o luac.out
42+ $(RM) a.out core core.* *.o luac.out
43+
44+.PHONY: default min noparser one strict clean
etc/README+7−2
@@ -1,9 +1,12 @@
11 This directory contains some useful files and code.
22 Unlike the code in ../src, everything here is in the public domain.
33
4+If any of the makes fail, you're probably not using the same libraries
5+used to build Lua. Set MYLIBS in Makefile accordingly.
6+
47 all.c
58 Full Lua interpreter in a single file.
6− Do "make one".
9+ Do "make one" for a demo.
710
811 lua.hpp
912 Lua header files for C++ using 'extern "C"'.
@@ -21,11 +24,13 @@ luavs.bat · 11 unmodified lines
2124 min.c
2225 A minimal Lua interpreter.
2326 Good for learning and for starting your own.
27+ Do "make min" for a demo.
2428
2529 noparser.c
2630 Linking with noparser.o avoids loading the parsing modules in lualib.a.
27− Do "make noparser" to see a demo.
31+ Do "make noparser" for a demo.
2832
2933 strict.lua
3034 Traps uses of undeclared global variables.
35+ Do "make strict" for a demo.
3136
etc/lua.pc+9−9
@@ -1,19 +1,19 @@
11 # lua.pc -- pkg-config data for Lua
22
33 # vars from install Makefile
4−# grep '^INSTALL_.*=' ../Makefile
5−INSTALL_TOP= /usr/local
6−INSTALL_BIN= $(INSTALL_TOP)/bin
7−INSTALL_INC= $(INSTALL_TOP)/include
8−INSTALL_LIB= $(INSTALL_TOP)/lib
9−INSTALL_MAN= $(INSTALL_TOP)/man/man1
10−INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
11−INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
124
135 # grep '^V=' ../Makefile
146 V= 5.1
157
16−prefix=${INSTALL_TOP}
8+# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
9+prefix= /usr/local
10+INSTALL_BIN= ${prefix}/bin
11+INSTALL_INC= ${prefix}/include
12+INSTALL_LIB= ${prefix}/lib
13+INSTALL_MAN= ${prefix}/man/man1
14+INSTALL_LMOD= ${prefix}/share/lua/${V}
15+INSTALL_CMOD= ${prefix}/lib/lua/${V}
16+
1717 exec_prefix=${prefix}
1818 libdir=${exec_prefix}/lib
1919 includedir=${prefix}/include
src/Makefile+2−0
@@ -107,6 +107,8 @@ posix: · 106 unmodified lines
107107 solaris:
108108 $(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl"
109109
110+# list targets that do not create files (but not all makes understand .PHONY)
111+.PHONY: all $(PLATS) default o a clean depend echo none
110112
111113 # DO NOT DELETE
112114
src/liolib.c+2−2
@@ -1,5 +1,5 @@
11 /*
2−** $Id: liolib.c,v 2.71 2006/01/17 13:54:02 roberto Exp $
2+** $Id: liolib.c,v 2.72 2006/01/28 12:59:13 roberto Exp $
33 ** Standard I/O (and system) library
44 ** See Copyright Notice in lua.h
55 */
@@ -283,7 +283,7 @@ static int read_line (lua_State *L, FILE *f) { · 277 unmodified lines
283283 return (lua_strlen(L, -1) > 0); /* check whether read something */
284284 }
285285 l = strlen(p);
286− if (p[l-1] != '\n')
286+ if (l == 0 || p[l-1] != '\n')
287287 luaL_addsize(&b, l);
288288 else {
289289 luaL_addsize(&b, l - 1); /* do not include `eol' */
src/llex.c+2−2
@@ -1,5 +1,5 @@
11 /*
2−** $Id: llex.c,v 2.18 2006/01/23 20:06:19 roberto Exp $
2+** $Id: llex.c,v 2.19 2006/02/06 18:28:16 roberto Exp $
33 ** Lexical Analyzer
44 ** See Copyright Notice in lua.h
55 */
@@ -166,7 +166,7 @@ static int check_next (LexState *ls, const char *set) { · 160 unmodified lines
166166
167167
168168 static void buffreplace (LexState *ls, char from, char to) {
169− int n = luaZ_bufflen(ls->buff);
169+ size_t n = luaZ_bufflen(ls->buff);
170170 char *p = luaZ_buffer(ls->buff);
171171 while (n--)
172172 if (p[n] == from) p[n] = to;
src/loslib.c+5−4
@@ -1,5 +1,5 @@
11 /*
2−** $Id: loslib.c,v 1.16 2005/12/22 16:19:56 roberto Exp $
2+** $Id: loslib.c,v 1.17 2006/01/27 13:54:31 roberto Exp $
33 ** Standard Operating System library
44 ** See Copyright Notice in lua.h
55 */
@@ -21,6 +21,7 @@ · 15 unmodified lines
2121
2222
2323 static int os_pushresult (lua_State *L, int i, const char *filename) {
24+ int en = errno; /* calls to Lua API may change this value */
2425 if (i) {
2526 lua_pushboolean(L, 1);
2627 return 1;
@@ -28,10 +29,10 @@ static int os_pushresult (lua_State *L, int i, const char *filename) { · 1 unmodified line
2829 else {
2930 lua_pushnil(L);
3031 if (filename)
31− lua_pushfstring(L, "%s: %s", filename, strerror(errno));
32+ lua_pushfstring(L, "%s: %s", filename, strerror(en));
3233 else
33− lua_pushfstring(L, "%s", strerror(errno));
34− lua_pushinteger(L, errno);
34+ lua_pushfstring(L, "%s", strerror(en));
35+ lua_pushinteger(L, en);
3536 return 3;
3637 }
3738 }
src/lstate.h+5−5
@@ -1,5 +1,5 @@
11 /*
2−** $Id: lstate.h,v 2.23 2005/07/09 13:22:34 roberto Exp $
2+** $Id: lstate.h,v 2.24 2006/02/06 18:27:59 roberto Exp $
33 ** Global State
44 ** See Copyright Notice in lua.h
55 */
@@ -49,8 +49,8 @@ typedef struct CallInfo { · 43 unmodified lines
4949 StkId base; /* base for this function */
5050 StkId func; /* function index in the stack */
5151 StkId top; /* top for this function */
52− int nresults; /* expected number of results from this function */
5352 const Instruction *savedpc;
53+ int nresults; /* expected number of results from this function */
5454 int tailcalls; /* number of tail calls lost under this entry */
5555 } CallInfo;
5656
@@ -71,9 +71,9 @@ typedef struct global_State { · 14 unmodified lines
7171 void *ud; /* auxiliary data to `frealloc' */
7272 lu_byte currentwhite;
7373 lu_byte gcstate; /* state of garbage collector */
74+ int sweepstrgc; /* position of sweep in `strt' */
7475 GCObject *rootgc; /* list of all collectable objects */
7576 GCObject **sweepgc; /* position of sweep in `rootgc' */
76− int sweepstrgc; /* position of sweep in `strt' */
7777 GCObject *gray; /* list of gray objects */
7878 GCObject *grayagain; /* list of objects to be traversed atomically */
7979 GCObject *weak; /* list of weak tables (to be cleared) */
@@ -99,6 +99,7 @@ typedef struct global_State { · 19 unmodified lines
9999 */
100100 struct lua_State {
101101 CommonHeader;
102+ lu_byte status;
102103 StkId top; /* first free slot in the stack */
103104 StkId base; /* base of current function */
104105 global_State *l_G;
@@ -106,14 +107,13 @@ struct lua_State { · 1 unmodified line
106107 const Instruction *savedpc; /* `savedpc' of current function */
107108 StkId stack_last; /* last free slot in the stack */
108109 StkId stack; /* stack base */
109− int stacksize;
110110 CallInfo *end_ci; /* points after end of ci array*/
111111 CallInfo *base_ci; /* array of CallInfo's */
112+ int stacksize;
112113 int size_ci; /* size of array `base_ci' */
113114 unsigned short nCcalls; /* number of nested C calls */
114115 lu_byte hookmask;
115116 lu_byte allowhook;
116− lu_byte status;
117117 int basehookcount;
118118 int hookcount;
119119 lua_Hook hook;
src/luaconf.h+2−2
@@ -1,5 +1,5 @@
11 /*
2−** $Id: luaconf.h,v 1.79 2006/01/23 19:51:43 roberto Exp $
2+** $Id: luaconf.h,v 1.80 2006/01/27 13:54:39 roberto Exp $
33 ** Configuration file for Lua
44 ** See Copyright Notice in lua.h
55 */
@@ -541,7 +541,7 @@ · 535 unmodified lines
541541 */
542542
543543 /* On a Pentium, resort to a trick */
544−#if !defined(LUA_ANSI) && !defined(__SSE2__) && \
544+#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \
545545 (defined(__i386) || defined (_M_IX86) || defined(__i386__))
546546 union luai_Cast { double l_d; long l_l; };
547547 #define lua_number2int(i,d) \