| @@ -8,9 +8,9 @@ · 7 unmodified lines |
| 8 | 8 | |
| 9 | 9 | <body bgcolor="#FFFFFF"> |
| 10 | 10 | |
| 11 | | −<hr /> |
| 11 | +<hr></hr> |
| 12 | 12 | <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> |
| 14 | 14 | Lua 5.1 Reference Manual |
| 15 | 15 | </h1> |
| 16 | 16 | |
| @@ -20,7 +20,7 @@ by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, Waldemar Celes · 3 unmodified lines |
| 20 | 20 | <a href="http://www.lua.org/copyright.html">Copyright</a> |
| 21 | 21 | © 2006 Lua.org, PUC-Rio. All rights reserved. |
| 22 | 22 | </small> |
| 23 | | −<hr /> |
| 23 | +<hr></hr> |
| 24 | 24 | |
| 25 | 25 | <p> |
| 26 | 26 | <p> |
| @@ -302,7 +302,7 @@ Any arithmetic operation applied to a string tries to convert · 275 unmodified lines |
| 302 | 302 | that string to a number, following the usual conversion rules. |
| 303 | 303 | Conversely, whenever a number is used where a string is expected, |
| 304 | 304 | 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, |
| 306 | 306 | use the <code>format</code> function from the string library |
| 307 | 307 | (see <a href="#pdf-string.format"><code>string.format</code></a>). |
| 308 | 308 | |
| @@ -1554,9 +1554,9 @@ They are used as the default environment for other Lua functions · 1245 unmodified lines |
| 1554 | 1554 | created by that function. |
| 1555 | 1555 | |
| 1556 | 1556 | <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>. |
| 1558 | 1558 | 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>. |
| 1560 | 1560 | To manipulate the environment of other objects |
| 1561 | 1561 | (userdata, C functions, other threads) you must |
| 1562 | 1562 | use the C API. |
| @@ -1565,7 +1565,7 @@ use the C API. · 2 unmodified lines |
| 1565 | 1565 | |
| 1566 | 1566 | <p>Lua performs automatic memory management. |
| 1567 | 1567 | 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 |
| 1569 | 1569 | nor about freeing it when the objects are no longer needed. |
| 1570 | 1570 | Lua manages memory automatically by running |
| 1571 | 1571 | a <em>garbage collector</em> from time to time |
| @@ -1577,7 +1577,7 @@ tables, userdata, functions, threads, and strings. · 5 unmodified lines |
| 1577 | 1577 | <p>Lua implements an incremental mark-and-sweep collector. |
| 1578 | 1578 | It uses two numbers to control its garbage-collection cycles: |
| 1579 | 1579 | the <em>garbage-collector pause</em> and |
| 1580 | | −the <em>garbage-collector multiplier</em>. |
| 1580 | +the <em>garbage-collector step multiplier</em>. |
| 1581 | 1581 | |
| 1582 | 1582 | <p>The garbage-collector pause |
| 1583 | 1583 | controls how long the collector waits before starting a new cycle. |
| @@ -1587,7 +1587,7 @@ start a new cycle. · 3 unmodified lines |
| 1587 | 1587 | A value of 2 means that the collector waits more or less to double |
| 1588 | 1588 | the total memory in use before starting a new cycle. |
| 1589 | 1589 | |
| 1590 | | −<p>The garbage-collector multiplier |
| 1590 | +<p>The step multiplier |
| 1591 | 1591 | controls the relative speed of the collector relative to |
| 1592 | 1592 | memory allocation. |
| 1593 | 1593 | 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 |
| 1898 | 1898 | |
| 1899 | 1899 | <p>The integer keys in the registry are used by the reference mechanism, |
| 1900 | 1900 | 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. |
| 1902 | 1902 | |
| 1903 | 1903 | <p><a name="3.6"></a><h2>3.6 - Error Handling in C</h2> |
| 1904 | 1904 | |
| @@ -1930,7 +1930,7 @@ so they never raise an error: · 25 unmodified lines |
| 1930 | 1930 | alphabetical order. |
| 1931 | 1931 | |
| 1932 | 1932 | <p><a name="lua_Alloc"></a> |
| 1933 | | −<hr /><h3><code>lua_Alloc</code></h3> |
| 1933 | +<hr></hr><h3><code>lua_Alloc</code></h3> |
| 1934 | 1934 | <pre> |
| 1935 | 1935 | typedef void * (*lua_Alloc) (void *ud, |
| 1936 | 1936 | void *ptr, |
| @@ -1979,7 +1979,7 @@ static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { · 42 unmodified lines |
| 1979 | 1979 | </pre> |
| 1980 | 1980 | |
| 1981 | 1981 | <p><a name="lua_atpanic"></a> |
| 1982 | | −<hr /><h3><code>lua_atpanic</code></h3> |
| 1982 | +<hr></hr><h3><code>lua_atpanic</code></h3> |
| 1983 | 1983 | <pre> |
| 1984 | 1984 | lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf); |
| 1985 | 1985 | </pre> |
| @@ -1997,7 +1997,7 @@ never returning (e.g., doing a long jump). · 11 unmodified lines |
| 1997 | 1997 | <p>The panic function can access the error message at the top of the stack. |
| 1998 | 1998 | |
| 1999 | 1999 | <p><a name="lua_call"></a> |
| 2000 | | −<hr /><h3><code>lua_call</code></h3> |
| 2000 | +<hr></hr><h3><code>lua_call</code></h3> |
| 2001 | 2001 | <pre> |
| 2002 | 2002 | void lua_call (lua_State *L, int nargs, int nresults); |
| 2003 | 2003 | </pre> |
| @@ -2047,7 +2047,7 @@ at its end, the stack is back to its original configuration. · 43 unmodified lines |
| 2047 | 2047 | This is considered good programming practice. |
| 2048 | 2048 | |
| 2049 | 2049 | <p><a name="lua_CFunction"></a> |
| 2050 | | −<hr /><h3><code>lua_CFunction</code></h3> |
| 2050 | +<hr></hr><h3><code>lua_CFunction</code></h3> |
| 2051 | 2051 | <pre> |
| 2052 | 2052 | typedef int (*lua_CFunction) (lua_State *L); |
| 2053 | 2053 | </pre> |
| @@ -2093,20 +2093,20 @@ of numerical arguments and returns their average and sum: · 39 unmodified lines |
| 2093 | 2093 | </pre> |
| 2094 | 2094 | |
| 2095 | 2095 | <p><a name="lua_checkstack"></a> |
| 2096 | | −<hr /><h3><code>lua_checkstack</code></h3> |
| 2096 | +<hr></hr><h3><code>lua_checkstack</code></h3> |
| 2097 | 2097 | <pre> |
| 2098 | 2098 | int lua_checkstack (lua_State *L, int extra); |
| 2099 | 2099 | </pre> |
| 2100 | 2100 | |
| 2101 | 2101 | |
| 2102 | 2102 | <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. |
| 2104 | 2104 | This function never shrinks the stack; |
| 2105 | 2105 | if the stack is already larger than the new size, |
| 2106 | 2106 | it is left unchanged. |
| 2107 | 2107 | |
| 2108 | 2108 | <p><a name="lua_close"></a> |
| 2109 | | −<hr /><h3><code>lua_close</code></h3> |
| 2109 | +<hr></hr><h3><code>lua_close</code></h3> |
| 2110 | 2110 | <pre> |
| 2111 | 2111 | void lua_close (lua_State *L); |
| 2112 | 2112 | </pre> |
| @@ -2123,7 +2123,7 @@ might need to release states as soon as they are not needed, · 10 unmodified lines |
| 2123 | 2123 | to avoid growing too large. |
| 2124 | 2124 | |
| 2125 | 2125 | <p><a name="lua_concat"></a> |
| 2126 | | −<hr /><h3><code>lua_concat</code></h3> |
| 2126 | +<hr></hr><h3><code>lua_concat</code></h3> |
| 2127 | 2127 | <pre> |
| 2128 | 2128 | void lua_concat (lua_State *L, int n); |
| 2129 | 2129 | </pre> |
| @@ -2138,7 +2138,7 @@ Concatenation is done following the usual semantics of Lua · 8 unmodified lines |
| 2138 | 2138 | (see <a href="#concat">2.5.4</a>). |
| 2139 | 2139 | |
| 2140 | 2140 | <p><a name="lua_cpcall"></a> |
| 2141 | | −<hr /><h3><code>lua_cpcall</code></h3> |
| 2141 | +<hr></hr><h3><code>lua_cpcall</code></h3> |
| 2142 | 2142 | <pre> |
| 2143 | 2143 | int lua_cpcall (lua_State *L, lua_CFunction func, void *ud); |
| 2144 | 2144 | </pre> |
| @@ -2154,7 +2154,7 @@ otherwise, it returns zero, and does not change the stack. · 9 unmodified lines |
| 2154 | 2154 | All values returned by <code>func</code> are discarded. |
| 2155 | 2155 | |
| 2156 | 2156 | <p><a name="lua_createtable"></a> |
| 2157 | | −<hr /><h3><code>lua_createtable</code></h3> |
| 2157 | +<hr></hr><h3><code>lua_createtable</code></h3> |
| 2158 | 2158 | <pre> |
| 2159 | 2159 | void lua_createtable (lua_State *L, int narr, int nrec); |
| 2160 | 2160 | </pre> |
| @@ -2168,7 +2168,7 @@ the table will have. · 7 unmodified lines |
| 2168 | 2168 | Otherwise you can use the function <a href="#lua_newtable"><code>lua_newtable</code></a>. |
| 2169 | 2169 | |
| 2170 | 2170 | <p><a name="lua_dump"></a> |
| 2171 | | −<hr /><h3><code>lua_dump</code></h3> |
| 2171 | +<hr></hr><h3><code>lua_dump</code></h3> |
| 2172 | 2172 | <pre> |
| 2173 | 2173 | int lua_dump (lua_State *L, lua_Writer writer, void *data); |
| 2174 | 2174 | </pre> |
| @@ -2191,7 +2191,7 @@ call to the writer; · 16 unmodified lines |
| 2191 | 2191 | <p>This function does not pop the function from the stack. |
| 2192 | 2192 | |
| 2193 | 2193 | <p><a name="lua_equal"></a> |
| 2194 | | −<hr /><h3><code>lua_equal</code></h3> |
| 2194 | +<hr></hr><h3><code>lua_equal</code></h3> |
| 2195 | 2195 | <pre> |
| 2196 | 2196 | int lua_equal (lua_State *L, int index1, int index2); |
| 2197 | 2197 | </pre> |
| @@ -2205,7 +2205,7 @@ Otherwise returns 0. · 7 unmodified lines |
| 2205 | 2205 | Also returns 0 if any of the indices is non valid. |
| 2206 | 2206 | |
| 2207 | 2207 | <p><a name="lua_error"></a> |
| 2208 | | −<hr /><h3><code>lua_error</code></h3> |
| 2208 | +<hr></hr><h3><code>lua_error</code></h3> |
| 2209 | 2209 | <pre> |
| 2210 | 2210 | int lua_error (lua_State *L); |
| 2211 | 2211 | </pre> |
| @@ -2219,7 +2219,7 @@ and therefore never returns. · 7 unmodified lines |
| 2219 | 2219 | (see <a href="#pdf-luaL_error"><code>luaL_error</code></a>). |
| 2220 | 2220 | |
| 2221 | 2221 | <p><a name="lua_gc"></a> |
| 2222 | | −<hr /><h3><code>lua_gc</code></h3> |
| 2222 | +<hr></hr><h3><code>lua_gc</code></h3> |
| 2223 | 2223 | <pre> |
| 2224 | 2224 | int lua_gc (lua_State *L, int what, int data); |
| 2225 | 2225 | </pre> |
| @@ -2257,7 +2257,7 @@ The function returns the previous value of the step multiplier. · 31 unmodified lines |
| 2257 | 2257 | </ul> |
| 2258 | 2258 | |
| 2259 | 2259 | <p><a name="lua_getallocf"></a> |
| 2260 | | −<hr /><h3><code>lua_getallocf</code></h3> |
| 2260 | +<hr></hr><h3><code>lua_getallocf</code></h3> |
| 2261 | 2261 | <pre> |
| 2262 | 2262 | lua_Alloc lua_getallocf (lua_State *L, void **ud); |
| 2263 | 2263 | </pre> |
| @@ -2268,7 +2268,7 @@ If <code>ud</code> is not <code>NULL</code>, Lua stores in <code>*ud</code> the · 4 unmodified lines |
| 2268 | 2268 | opaque pointer passed to <a href="#lua_newstate"><code>lua_newstate</code></a>. |
| 2269 | 2269 | |
| 2270 | 2270 | <p><a name="lua_getfenv"></a> |
| 2271 | | −<hr /><h3><code>lua_getfenv</code></h3> |
| 2271 | +<hr></hr><h3><code>lua_getfenv</code></h3> |
| 2272 | 2272 | <pre> |
| 2273 | 2273 | void lua_getfenv (lua_State *L, int index); |
| 2274 | 2274 | </pre> |
| @@ -2278,7 +2278,7 @@ opaque pointer passed to <a href="#lua_newstate"><code>lua_newstate</code></a>. · 3 unmodified lines |
| 2278 | 2278 | the value at the given index. |
| 2279 | 2279 | |
| 2280 | 2280 | <p><a name="lua_getfield"></a> |
| 2281 | | −<hr /><h3><code>lua_getfield</code></h3> |
| 2281 | +<hr></hr><h3><code>lua_getfield</code></h3> |
| 2282 | 2282 | <pre> |
| 2283 | 2283 | void lua_getfield (lua_State *L, int index, const char *k); |
| 2284 | 2284 | </pre> |
| @@ -2289,8 +2289,21 @@ where <code>t</code> is the value at the given valid index <code>index</code>. · 4 unmodified lines |
| 2289 | 2289 | As in Lua, this function may trigger a metamethod |
| 2290 | 2290 | for the "index" event (see <a href="#metatable">2.8</a>). |
| 2291 | 2291 | |
| 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 | + |
| 2292 | 2305 | <p><a name="lua_getmetatable"></a> |
| 2293 | | −<hr /><h3><code>lua_getmetatable</code></h3> |
| 2306 | +<hr></hr><h3><code>lua_getmetatable</code></h3> |
| 2294 | 2307 | <pre> |
| 2295 | 2308 | int lua_getmetatable (lua_State *L, int index); |
| 2296 | 2309 | </pre> |
| @@ -2300,10 +2313,10 @@ for the "index" event (see <a href="#metatable">2.8</a>). · 3 unmodified lines |
| 2300 | 2313 | acceptable index. |
| 2301 | 2314 | If the index is not valid, |
| 2302 | 2315 | 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. |
| 2304 | 2317 | |
| 2305 | 2318 | <p><a name="lua_gettable"></a> |
| 2306 | | −<hr /><h3><code>lua_gettable</code></h3> |
| 2319 | +<hr></hr><h3><code>lua_gettable</code></h3> |
| 2307 | 2320 | <pre> |
| 2308 | 2321 | void lua_gettable (lua_State *L, int index); |
| 2309 | 2322 | </pre> |
| @@ -2319,7 +2332,7 @@ As in Lua, this function may trigger a metamethod · 9 unmodified lines |
| 2319 | 2332 | for the "index" event (see <a href="#metatable">2.8</a>). |
| 2320 | 2333 | |
| 2321 | 2334 | <p><a name="lua_gettop"></a> |
| 2322 | | −<hr /><h3><code>lua_gettop</code></h3> |
| 2335 | +<hr></hr><h3><code>lua_gettop</code></h3> |
| 2323 | 2336 | <pre> |
| 2324 | 2337 | int lua_gettop (lua_State *L); |
| 2325 | 2338 | </pre> |
| @@ -2331,7 +2344,7 @@ that result is equal to the number of elements in the stack · 5 unmodified lines |
| 2331 | 2344 | (and so 0 means an empty stack). |
| 2332 | 2345 | |
| 2333 | 2346 | <p><a name="lua_insert"></a> |
| 2334 | | −<hr /><h3><code>lua_insert</code></h3> |
| 2347 | +<hr></hr><h3><code>lua_insert</code></h3> |
| 2335 | 2348 | <pre> |
| 2336 | 2349 | void lua_insert (lua_State *L, int index); |
| 2337 | 2350 | </pre> |
| @@ -2343,7 +2356,7 @@ Cannot be called with a pseudo-index, · 5 unmodified lines |
| 2343 | 2356 | because a pseudo-index is not an actual stack position. |
| 2344 | 2357 | |
| 2345 | 2358 | <p><a name="lua_Integer"></a> |
| 2346 | | −<hr /><h3><code>lua_Integer</code></h3> |
| 2359 | +<hr></hr><h3><code>lua_Integer</code></h3> |
| 2347 | 2360 | <pre> |
| 2348 | 2361 | typedef ptrdiff_t lua_Integer; |
| 2349 | 2362 | </pre> |
| @@ -2356,7 +2369,7 @@ which is usually the largest integral type the machine handles · 6 unmodified lines |
| 2356 | 2369 | "comfortably". |
| 2357 | 2370 | |
| 2358 | 2371 | <p><a name="lua_isboolean"></a> |
| 2359 | | −<hr /><h3><code>lua_isboolean</code></h3> |
| 2372 | +<hr></hr><h3><code>lua_isboolean</code></h3> |
| 2360 | 2373 | <pre> |
| 2361 | 2374 | int lua_isboolean (lua_State *L, int index); |
| 2362 | 2375 | </pre> |
| @@ -2366,7 +2379,7 @@ which is usually the largest integral type the machine handles · 3 unmodified lines |
| 2366 | 2379 | and 0 otherwise. |
| 2367 | 2380 | |
| 2368 | 2381 | <p><a name="lua_iscfunction"></a> |
| 2369 | | −<hr /><h3><code>lua_iscfunction</code></h3> |
| 2382 | +<hr></hr><h3><code>lua_iscfunction</code></h3> |
| 2370 | 2383 | <pre> |
| 2371 | 2384 | int lua_iscfunction (lua_State *L, int index); |
| 2372 | 2385 | </pre> |
| @@ -2376,7 +2389,7 @@ and 0 otherwise. · 3 unmodified lines |
| 2376 | 2389 | and 0 otherwise. |
| 2377 | 2390 | |
| 2378 | 2391 | <p><a name="lua_isfunction"></a> |
| 2379 | | −<hr /><h3><code>lua_isfunction</code></h3> |
| 2392 | +<hr></hr><h3><code>lua_isfunction</code></h3> |
| 2380 | 2393 | <pre> |
| 2381 | 2394 | int lua_isfunction (lua_State *L, int index); |
| 2382 | 2395 | </pre> |
| @@ -2386,7 +2399,7 @@ and 0 otherwise. · 3 unmodified lines |
| 2386 | 2399 | (either C or Lua), and 0 otherwise. |
| 2387 | 2400 | |
| 2388 | 2401 | <p><a name="lua_islightuserdata"></a> |
| 2389 | | −<hr /><h3><code>lua_islightuserdata</code></h3> |
| 2402 | +<hr></hr><h3><code>lua_islightuserdata</code></h3> |
| 2390 | 2403 | <pre> |
| 2391 | 2404 | int lua_islightuserdata (lua_State *L, int index); |
| 2392 | 2405 | </pre> |
| @@ -2396,7 +2409,7 @@ and 0 otherwise. · 3 unmodified lines |
| 2396 | 2409 | and 0 otherwise. |
| 2397 | 2410 | |
| 2398 | 2411 | <p><a name="lua_isnil"></a> |
| 2399 | | −<hr /><h3><code>lua_isnil</code></h3> |
| 2412 | +<hr></hr><h3><code>lua_isnil</code></h3> |
| 2400 | 2413 | <pre> |
| 2401 | 2414 | int lua_isnil (lua_State *L, int index); |
| 2402 | 2415 | </pre> |
| @@ -2406,7 +2419,7 @@ and 0 otherwise. · 3 unmodified lines |
| 2406 | 2419 | and 0 otherwise. |
| 2407 | 2420 | |
| 2408 | 2421 | <p><a name="lua_isnumber"></a> |
| 2409 | | −<hr /><h3><code>lua_isnumber</code></h3> |
| 2422 | +<hr></hr><h3><code>lua_isnumber</code></h3> |
| 2410 | 2423 | <pre> |
| 2411 | 2424 | int lua_isnumber (lua_State *L, int index); |
| 2412 | 2425 | </pre> |
| @@ -2417,7 +2430,7 @@ or a string convertible to a number, · 4 unmodified lines |
| 2417 | 2430 | and 0 otherwise. |
| 2418 | 2431 | |
| 2419 | 2432 | <p><a name="lua_isstring"></a> |
| 2420 | | −<hr /><h3><code>lua_isstring</code></h3> |
| 2433 | +<hr></hr><h3><code>lua_isstring</code></h3> |
| 2421 | 2434 | <pre> |
| 2422 | 2435 | int lua_isstring (lua_State *L, int index); |
| 2423 | 2436 | </pre> |
| @@ -2428,7 +2441,7 @@ or a number (which is always convertible to a string), · 4 unmodified lines |
| 2428 | 2441 | and 0 otherwise. |
| 2429 | 2442 | |
| 2430 | 2443 | <p><a name="lua_istable"></a> |
| 2431 | | −<hr /><h3><code>lua_istable</code></h3> |
| 2444 | +<hr></hr><h3><code>lua_istable</code></h3> |
| 2432 | 2445 | <pre> |
| 2433 | 2446 | int lua_istable (lua_State *L, int index); |
| 2434 | 2447 | </pre> |
| @@ -2438,7 +2451,7 @@ and 0 otherwise. · 3 unmodified lines |
| 2438 | 2451 | and 0 otherwise. |
| 2439 | 2452 | |
| 2440 | 2453 | <p><a name="lua_isthread"></a> |
| 2441 | | −<hr /><h3><code>lua_isthread</code></h3> |
| 2454 | +<hr></hr><h3><code>lua_isthread</code></h3> |
| 2442 | 2455 | <pre> |
| 2443 | 2456 | int lua_isthread (lua_State *L, int index); |
| 2444 | 2457 | </pre> |
| @@ -2448,7 +2461,7 @@ and 0 otherwise. · 3 unmodified lines |
| 2448 | 2461 | and 0 otherwise. |
| 2449 | 2462 | |
| 2450 | 2463 | <p><a name="lua_isuserdata"></a> |
| 2451 | | −<hr /><h3><code>lua_isuserdata</code></h3> |
| 2464 | +<hr></hr><h3><code>lua_isuserdata</code></h3> |
| 2452 | 2465 | <pre> |
| 2453 | 2466 | int lua_isuserdata (lua_State *L, int index); |
| 2454 | 2467 | </pre> |
| @@ -2458,7 +2471,7 @@ and 0 otherwise. · 3 unmodified lines |
| 2458 | 2471 | (either full or light), and 0 otherwise. |
| 2459 | 2472 | |
| 2460 | 2473 | <p><a name="lua_lessthan"></a> |
| 2461 | | −<hr /><h3><code>lua_lessthan</code></h3> |
| 2474 | +<hr></hr><h3><code>lua_lessthan</code></h3> |
| 2462 | 2475 | <pre> |
| 2463 | 2476 | int lua_lessthan (lua_State *L, int index1, int index2); |
| 2464 | 2477 | </pre> |
| @@ -2472,7 +2485,7 @@ Otherwise returns 0. · 7 unmodified lines |
| 2472 | 2485 | Also returns 0 if any of the indices is non valid. |
| 2473 | 2486 | |
| 2474 | 2487 | <p><a name="lua_load"></a> |
| 2475 | | −<hr /><h3><code>lua_load</code></h3> |
| 2488 | +<hr></hr><h3><code>lua_load</code></h3> |
| 2476 | 2489 | <pre> |
| 2477 | 2490 | int lua_load (lua_State *L, lua_Reader reader, void *data, |
| 2478 | 2491 | const char *chunkname); |
| @@ -2505,7 +2518,7 @@ The <code>data</code> argument is an opaque value passed to the reader function. · 26 unmodified lines |
| 2505 | 2518 | which is used for error messages and in debug information (see <a href="#debugI">3.8</a>). |
| 2506 | 2519 | |
| 2507 | 2520 | <p><a name="lua_newstate"></a> |
| 2508 | | −<hr /><h3><code>lua_newstate</code></h3> |
| 2521 | +<hr></hr><h3><code>lua_newstate</code></h3> |
| 2509 | 2522 | <pre> |
| 2510 | 2523 | lua_State *lua_newstate (lua_Alloc f, void *ud); |
| 2511 | 2524 | </pre> |
| @@ -2520,7 +2533,7 @@ The second argument, <code>ud</code>, is an opaque pointer that Lua · 8 unmodified lines |
| 2520 | 2533 | simply passes to the allocator in every call. |
| 2521 | 2534 | |
| 2522 | 2535 | <p><a name="lua_newtable"></a> |
| 2523 | | −<hr /><h3><code>lua_newtable</code></h3> |
| 2536 | +<hr></hr><h3><code>lua_newtable</code></h3> |
| 2524 | 2537 | <pre> |
| 2525 | 2538 | void lua_newtable (lua_State *L); |
| 2526 | 2539 | </pre> |
| @@ -2530,7 +2543,7 @@ simply passes to the allocator in every call. · 3 unmodified lines |
| 2530 | 2543 | Equivalent to <code>lua_createtable(L, 0, 0)</code>. |
| 2531 | 2544 | |
| 2532 | 2545 | <p><a name="lua_newthread"></a> |
| 2533 | | −<hr /><h3><code>lua_newthread</code></h3> |
| 2546 | +<hr></hr><h3><code>lua_newthread</code></h3> |
| 2534 | 2547 | <pre> |
| 2535 | 2548 | lua_State *lua_newthread (lua_State *L); |
| 2536 | 2549 | </pre> |
| @@ -2547,7 +2560,7 @@ Threads are subject to garbage collection, · 10 unmodified lines |
| 2547 | 2560 | like any Lua object. |
| 2548 | 2561 | |
| 2549 | 2562 | <p><a name="lua_newuserdata"></a> |
| 2550 | | −<hr /><h3><code>lua_newuserdata</code></h3> |
| 2563 | +<hr></hr><h3><code>lua_newuserdata</code></h3> |
| 2551 | 2564 | <pre> |
| 2552 | 2565 | void *lua_newuserdata (lua_State *L, size_t size); |
| 2553 | 2566 | </pre> |
| @@ -2570,7 +2583,7 @@ When that userdata is collected again then · 16 unmodified lines |
| 2570 | 2583 | Lua frees its corresponding memory. |
| 2571 | 2584 | |
| 2572 | 2585 | <p><a name="lua_next"></a> |
| 2573 | | −<hr /><h3><code>lua_next</code></h3> |
| 2586 | +<hr></hr><h3><code>lua_next</code></h3> |
| 2574 | 2587 | <pre> |
| 2575 | 2588 | int lua_next (lua_State *L, int index); |
| 2576 | 2589 | </pre> |
| @@ -2602,7 +2615,7 @@ the value at the given index; · 25 unmodified lines |
| 2602 | 2615 | this confuses the next call to <a href="#lua_next"><code>lua_next</code></a>. |
| 2603 | 2616 | |
| 2604 | 2617 | <p><a name="lua_Number"></a> |
| 2605 | | −<hr /><h3><code>lua_Number</code></h3> |
| 2618 | +<hr></hr><h3><code>lua_Number</code></h3> |
| 2606 | 2619 | <pre> |
| 2607 | 2620 | typedef double lua_Number; |
| 2608 | 2621 | </pre> |
| @@ -2612,10 +2625,10 @@ this confuses the next call to <a href="#lua_next"><code>lua_next</code></a>. · 3 unmodified lines |
| 2612 | 2625 | By default, it is double, but that can be changed in <code>luaconf.h</code>. |
| 2613 | 2626 | |
| 2614 | 2627 | <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). |
| 2616 | 2629 | |
| 2617 | 2630 | <p><a name="lua_objlen"></a> |
| 2618 | | −<hr /><h3><code>lua_objlen</code></h3> |
| 2631 | +<hr></hr><h3><code>lua_objlen</code></h3> |
| 2619 | 2632 | <pre> |
| 2620 | 2633 | size_t lua_objlen (lua_State *L, int index); |
| 2621 | 2634 | </pre> |
| @@ -2629,7 +2642,7 @@ for the userdata; · 7 unmodified lines |
| 2629 | 2642 | for other values, it is 0. |
| 2630 | 2643 | |
| 2631 | 2644 | <p><a name="lua_pcall"></a> |
| 2632 | | −<hr /><h3><code>lua_pcall</code></h3> |
| 2645 | +<hr></hr><h3><code>lua_pcall</code></h3> |
| 2633 | 2646 | <pre> |
| 2634 | 2647 | lua_pcall (lua_State *L, int nargs, int nresults, int errfunc); |
| 2635 | 2648 | </pre> |
| @@ -2676,7 +2689,7 @@ error while running the error handler function. · 40 unmodified lines |
| 2676 | 2689 | </ul> |
| 2677 | 2690 | |
| 2678 | 2691 | <p><a name="lua_pop"></a> |
| 2679 | | −<hr /><h3><code>lua_pop</code></h3> |
| 2692 | +<hr></hr><h3><code>lua_pop</code></h3> |
| 2680 | 2693 | <pre> |
| 2681 | 2694 | void lua_pop (lua_State *L, int n); |
| 2682 | 2695 | </pre> |
| @@ -2685,7 +2698,7 @@ error while running the error handler function. · 2 unmodified lines |
| 2685 | 2698 | <p>Pops <code>n</code> elements from the stack. |
| 2686 | 2699 | |
| 2687 | 2700 | <p><a name="lua_pushboolean"></a> |
| 2688 | | −<hr /><h3><code>lua_pushboolean</code></h3> |
| 2701 | +<hr></hr><h3><code>lua_pushboolean</code></h3> |
| 2689 | 2702 | <pre> |
| 2690 | 2703 | void lua_pushboolean (lua_State *L, int b); |
| 2691 | 2704 | </pre> |
| @@ -2694,7 +2707,7 @@ error while running the error handler function. · 2 unmodified lines |
| 2694 | 2707 | <p>Pushes a boolean value with value <code>b</code> onto the stack. |
| 2695 | 2708 | |
| 2696 | 2709 | <p><a name="lua_pushcclosure"></a> |
| 2697 | | −<hr /><h3><code>lua_pushcclosure</code></h3> |
| 2710 | +<hr></hr><h3><code>lua_pushcclosure</code></h3> |
| 2698 | 2711 | <pre> |
| 2699 | 2712 | void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n); |
| 2700 | 2713 | </pre> |
| @@ -2716,17 +2729,26 @@ associated with the function. · 15 unmodified lines |
| 2716 | 2729 | <a href="#lua_pushcclosure"><code>lua_pushcclosure</code></a> also pops these values from the stack. |
| 2717 | 2730 | |
| 2718 | 2731 | <p><a name="lua_pushcfunction"></a> |
| 2719 | | −<hr /><h3><code>lua_pushcfunction</code></h3> |
| 2732 | +<hr></hr><h3><code>lua_pushcfunction</code></h3> |
| 2720 | 2733 | <pre> |
| 2721 | 2734 | void lua_pushcfunction (lua_State *L, lua_CFunction f); |
| 2722 | 2735 | </pre> |
| 2723 | 2736 | |
| 2724 | 2737 | |
| 2725 | 2738 | <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>. |
| 2727 | 2749 | |
| 2728 | 2750 | <p><a name="lua_pushfstring"></a> |
| 2729 | | −<hr /><h3><code>lua_pushfstring</code></h3> |
| 2751 | +<hr></hr><h3><code>lua_pushfstring</code></h3> |
| 2730 | 2752 | <pre> |
| 2731 | 2753 | const char *lua_pushfstring (lua_State *L, const char *fmt, ...); |
| 2732 | 2754 | </pre> |
| @@ -2752,7 +2774,7 @@ The conversion specifiers can only be · 19 unmodified lines |
| 2752 | 2774 | </ul> |
| 2753 | 2775 | |
| 2754 | 2776 | <p><a name="lua_pushinteger"></a> |
| 2755 | | −<hr /><h3><code>lua_pushinteger</code></h3> |
| 2777 | +<hr></hr><h3><code>lua_pushinteger</code></h3> |
| 2756 | 2778 | <pre> |
| 2757 | 2779 | void lua_pushinteger (lua_State *L, lua_Integer n); |
| 2758 | 2780 | </pre> |
| @@ -2761,7 +2783,7 @@ The conversion specifiers can only be · 2 unmodified lines |
| 2761 | 2783 | <p>Pushes a number with value <code>n</code> onto the stack. |
| 2762 | 2784 | |
| 2763 | 2785 | <p><a name="lua_pushlightuserdata"></a> |
| 2764 | | −<hr /><h3><code>lua_pushlightuserdata</code></h3> |
| 2786 | +<hr></hr><h3><code>lua_pushlightuserdata</code></h3> |
| 2765 | 2787 | <pre> |
| 2766 | 2788 | void lua_pushlightuserdata (lua_State *L, void *p); |
| 2767 | 2789 | </pre> |
| @@ -2778,7 +2800,7 @@ A light userdata is equal to "any" · 10 unmodified lines |
| 2778 | 2800 | light userdata with the same C address. |
| 2779 | 2801 | |
| 2780 | 2802 | <p><a name="lua_pushlstring"></a> |
| 2781 | | −<hr /><h3><code>lua_pushlstring</code></h3> |
| 2803 | +<hr></hr><h3><code>lua_pushlstring</code></h3> |
| 2782 | 2804 | <pre> |
| 2783 | 2805 | void lua_pushlstring (lua_State *L, const char *s, size_t len); |
| 2784 | 2806 | </pre> |
| @@ -2792,7 +2814,7 @@ the function returns. · 7 unmodified lines |
| 2792 | 2814 | The string can contain embedded zeros. |
| 2793 | 2815 | |
| 2794 | 2816 | <p><a name="lua_pushnil"></a> |
| 2795 | | −<hr /><h3><code>lua_pushnil</code></h3> |
| 2817 | +<hr></hr><h3><code>lua_pushnil</code></h3> |
| 2796 | 2818 | <pre> |
| 2797 | 2819 | void lua_pushnil (lua_State *L); |
| 2798 | 2820 | </pre> |
| @@ -2801,7 +2823,7 @@ The string can contain embedded zeros. · 2 unmodified lines |
| 2801 | 2823 | <p>Pushes a nil value onto the stack. |
| 2802 | 2824 | |
| 2803 | 2825 | <p><a name="lua_pushnumber"></a> |
| 2804 | | −<hr /><h3><code>lua_pushnumber</code></h3> |
| 2826 | +<hr></hr><h3><code>lua_pushnumber</code></h3> |
| 2805 | 2827 | <pre> |
| 2806 | 2828 | void lua_pushnumber (lua_State *L, lua_Number n); |
| 2807 | 2829 | </pre> |
| @@ -2810,7 +2832,7 @@ The string can contain embedded zeros. · 2 unmodified lines |
| 2810 | 2832 | <p>Pushes a number with value <code>n</code> onto the stack. |
| 2811 | 2833 | |
| 2812 | 2834 | <p><a name="lua_pushstring"></a> |
| 2813 | | −<hr /><h3><code>lua_pushstring</code></h3> |
| 2835 | +<hr></hr><h3><code>lua_pushstring</code></h3> |
| 2814 | 2836 | <pre> |
| 2815 | 2837 | void lua_pushstring (lua_State *L, const char *s); |
| 2816 | 2838 | </pre> |
| @@ -2825,7 +2847,7 @@ The string cannot contain embedded zeros; · 8 unmodified lines |
| 2825 | 2847 | it is assumed to end at the first zero. |
| 2826 | 2848 | |
| 2827 | 2849 | <p><a name="lua_pushthread"></a> |
| 2828 | | −<hr /><h3><code>lua_pushthread</code></h3> |
| 2850 | +<hr></hr><h3><code>lua_pushthread</code></h3> |
| 2829 | 2851 | <pre> |
| 2830 | 2852 | void lua_pushthread (lua_State *L); |
| 2831 | 2853 | </pre> |
| @@ -2834,7 +2856,7 @@ it is assumed to end at the first zero. · 2 unmodified lines |
| 2834 | 2856 | <p>Pushes the thread represented by <code>L</code> onto the stack. |
| 2835 | 2857 | |
| 2836 | 2858 | <p><a name="lua_pushvalue"></a> |
| 2837 | | −<hr /><h3><code>lua_pushvalue</code></h3> |
| 2859 | +<hr></hr><h3><code>lua_pushvalue</code></h3> |
| 2838 | 2860 | <pre> |
| 2839 | 2861 | void lua_pushvalue (lua_State *L, int index); |
| 2840 | 2862 | </pre> |
| @@ -2844,7 +2866,7 @@ it is assumed to end at the first zero. · 3 unmodified lines |
| 2844 | 2866 | onto the stack. |
| 2845 | 2867 | |
| 2846 | 2868 | <p><a name="lua_pushvfstring"></a> |
| 2847 | | −<hr /><h3><code>lua_pushvfstring</code></h3> |
| 2869 | +<hr></hr><h3><code>lua_pushvfstring</code></h3> |
| 2848 | 2870 | <pre> |
| 2849 | 2871 | const char *lua_pushvfstring (lua_State *L, const char *fmt, va_list argp); |
| 2850 | 2872 | </pre> |
| @@ -2854,7 +2876,7 @@ onto the stack. · 3 unmodified lines |
| 2854 | 2876 | instead of a variable number of arguments. |
| 2855 | 2877 | |
| 2856 | 2878 | <p><a name="lua_rawequal"></a> |
| 2857 | | −<hr /><h3><code>lua_rawequal</code></h3> |
| 2879 | +<hr></hr><h3><code>lua_rawequal</code></h3> |
| 2858 | 2880 | <pre> |
| 2859 | 2881 | int lua_rawequal (lua_State *L, int index1, int index2); |
| 2860 | 2882 | </pre> |
| @@ -2867,7 +2889,7 @@ Otherwise returns 0. · 6 unmodified lines |
| 2867 | 2889 | Also returns 0 if any of the indices are non valid. |
| 2868 | 2890 | |
| 2869 | 2891 | <p><a name="lua_rawget"></a> |
| 2870 | | −<hr /><h3><code>lua_rawget</code></h3> |
| 2892 | +<hr></hr><h3><code>lua_rawget</code></h3> |
| 2871 | 2893 | <pre> |
| 2872 | 2894 | void lua_rawget (lua_State *L, int index); |
| 2873 | 2895 | </pre> |
| @@ -2877,7 +2899,7 @@ Also returns 0 if any of the indices are non valid. · 3 unmodified lines |
| 2877 | 2899 | (i.e., without metamethods). |
| 2878 | 2900 | |
| 2879 | 2901 | <p><a name="lua_rawgeti"></a> |
| 2880 | | −<hr /><h3><code>lua_rawgeti</code></h3> |
| 2902 | +<hr></hr><h3><code>lua_rawgeti</code></h3> |
| 2881 | 2903 | <pre> |
| 2882 | 2904 | void lua_rawgeti (lua_State *L, int index, int n); |
| 2883 | 2905 | </pre> |
| @@ -2889,7 +2911,7 @@ The access is raw; · 5 unmodified lines |
| 2889 | 2911 | that is, it does not invoke metamethods. |
| 2890 | 2912 | |
| 2891 | 2913 | <p><a name="lua_rawset"></a> |
| 2892 | | −<hr /><h3><code>lua_rawset</code></h3> |
| 2914 | +<hr></hr><h3><code>lua_rawset</code></h3> |
| 2893 | 2915 | <pre> |
| 2894 | 2916 | void lua_rawset (lua_State *L, int index); |
| 2895 | 2917 | </pre> |
| @@ -2899,7 +2921,7 @@ that is, it does not invoke metamethods. · 3 unmodified lines |
| 2899 | 2921 | (i.e., without metamethods). |
| 2900 | 2922 | |
| 2901 | 2923 | <p><a name="lua_rawseti"></a> |
| 2902 | | −<hr /><h3><code>lua_rawseti</code></h3> |
| 2924 | +<hr></hr><h3><code>lua_rawseti</code></h3> |
| 2903 | 2925 | <pre> |
| 2904 | 2926 | void lua_rawseti (lua_State *L, int index, int n); |
| 2905 | 2927 | </pre> |
| @@ -2914,7 +2936,7 @@ The assignment is raw; · 8 unmodified lines |
| 2914 | 2936 | that is, it does not invoke metamethods. |
| 2915 | 2937 | |
| 2916 | 2938 | <p><a name="lua_Reader"></a> |
| 2917 | | −<hr /><h3><code>lua_Reader</code></h3> |
| 2939 | +<hr></hr><h3><code>lua_Reader</code></h3> |
| 2918 | 2940 | <pre> |
| 2919 | 2941 | typedef const char * (*lua_Reader) |
| 2920 | 2942 | (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 |
| 2933 | 2955 | To signal the end of the chunk, the reader must return <code>NULL</code>. |
| 2934 | 2956 | The reader function may return pieces of any size greater than zero. |
| 2935 | 2957 | |
| 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 | + |
| 2936 | 2971 | <p><a name="lua_remove"></a> |
| 2937 | | −<hr /><h3><code>lua_remove</code></h3> |
| 2972 | +<hr></hr><h3><code>lua_remove</code></h3> |
| 2938 | 2973 | <pre> |
| 2939 | 2974 | void lua_remove (lua_State *L, int index); |
| 2940 | 2975 | </pre> |
| @@ -2946,7 +2981,7 @@ Cannot be called with a pseudo-index, · 5 unmodified lines |
| 2946 | 2981 | because a pseudo-index is not an actual stack position. |
| 2947 | 2982 | |
| 2948 | 2983 | <p><a name="lua_replace"></a> |
| 2949 | | −<hr /><h3><code>lua_replace</code></h3> |
| 2984 | +<hr></hr><h3><code>lua_replace</code></h3> |
| 2950 | 2985 | <pre> |
| 2951 | 2986 | void lua_replace (lua_State *L, int index); |
| 2952 | 2987 | </pre> |
| @@ -2957,7 +2992,7 @@ without shifting any element · 4 unmodified lines |
| 2957 | 2992 | (therefore replacing the value at the given position). |
| 2958 | 2993 | |
| 2959 | 2994 | <p><a name="lua_resume"></a> |
| 2960 | | −<hr /><h3><code>lua_resume</code></h3> |
| 2995 | +<hr></hr><h3><code>lua_resume</code></h3> |
| 2961 | 2996 | <pre> |
| 2962 | 2997 | int lua_resume (lua_State *L, int narg); |
| 2963 | 2998 | </pre> |
| @@ -2987,7 +3022,7 @@ be passed as results from <code>yield</code>, · 23 unmodified lines |
| 2987 | 3022 | and then call <a href="#lua_resume"><code>lua_resume</code></a>. |
| 2988 | 3023 | |
| 2989 | 3024 | <p><a name="lua_setallocf"></a> |
| 2990 | | −<hr /><h3><code>lua_setallocf</code></h3> |
| 3025 | +<hr></hr><h3><code>lua_setallocf</code></h3> |
| 2991 | 3026 | <pre> |
| 2992 | 3027 | void lua_setallocf (lua_State *L, lua_Alloc f, void *ud); |
| 2993 | 3028 | </pre> |
| @@ -2997,7 +3032,7 @@ and then call <a href="#lua_resume"><code>lua_resume</code></a>. · 3 unmodified lines |
| 2997 | 3032 | with user data <code>ud</code>. |
| 2998 | 3033 | |
| 2999 | 3034 | <p><a name="lua_setfenv"></a> |
| 3000 | | −<hr /><h3><code>lua_setfenv</code></h3> |
| 3035 | +<hr></hr><h3><code>lua_setfenv</code></h3> |
| 3001 | 3036 | <pre> |
| 3002 | 3037 | int lua_setfenv (lua_State *L, int index); |
| 3003 | 3038 | </pre> |
| @@ -3011,7 +3046,7 @@ neither a function nor a thread nor a userdata, · 7 unmodified lines |
| 3011 | 3046 | Otherwise it returns 1. |
| 3012 | 3047 | |
| 3013 | 3048 | <p><a name="lua_setfield"></a> |
| 3014 | | −<hr /><h3><code>lua_setfield</code></h3> |
| 3049 | +<hr></hr><h3><code>lua_setfield</code></h3> |
| 3015 | 3050 | <pre> |
| 3016 | 3051 | void lua_setfield (lua_State *L, int index, const char *k); |
| 3017 | 3052 | </pre> |
| @@ -3025,8 +3060,22 @@ and <code>v</code> is the value at the top of the stack, · 7 unmodified lines |
| 3025 | 3060 | As in Lua, this function may trigger a metamethod |
| 3026 | 3061 | for the "newindex" event (see <a href="#metatable">2.8</a>). |
| 3027 | 3062 | |
| 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 | + |
| 3028 | 3077 | <p><a name="lua_setmetatable"></a> |
| 3029 | | −<hr /><h3><code>lua_setmetatable</code></h3> |
| 3078 | +<hr></hr><h3><code>lua_setmetatable</code></h3> |
| 3030 | 3079 | <pre> |
| 3031 | 3080 | int lua_setmetatable (lua_State *L, int index); |
| 3032 | 3081 | </pre> |
| @@ -3037,7 +3086,7 @@ sets it as the new metatable for the value at the given · 4 unmodified lines |
| 3037 | 3086 | acceptable index. |
| 3038 | 3087 | |
| 3039 | 3088 | <p><a name="lua_settable"></a> |
| 3040 | | −<hr /><h3><code>lua_settable</code></h3> |
| 3089 | +<hr></hr><h3><code>lua_settable</code></h3> |
| 3041 | 3090 | <pre> |
| 3042 | 3091 | void lua_settable (lua_State *L, int index); |
| 3043 | 3092 | </pre> |
| @@ -3053,7 +3102,7 @@ As in Lua, this function may trigger a metamethod · 9 unmodified lines |
| 3053 | 3102 | for the "newindex" event (see <a href="#metatable">2.8</a>). |
| 3054 | 3103 | |
| 3055 | 3104 | <p><a name="lua_settop"></a> |
| 3056 | | −<hr /><h3><code>lua_settop</code></h3> |
| 3105 | +<hr></hr><h3><code>lua_settop</code></h3> |
| 3057 | 3106 | <pre> |
| 3058 | 3107 | void lua_settop (lua_State *L, int index); |
| 3059 | 3108 | </pre> |
| @@ -3066,7 +3115,7 @@ then the new elements are filled with <b>nil</b>. · 6 unmodified lines |
| 3066 | 3115 | If <code>index</code> is 0, then all stack elements are removed. |
| 3067 | 3116 | |
| 3068 | 3117 | <p><a name="lua_State"></a> |
| 3069 | | −<hr /><h3><code>lua_State</code></h3> |
| 3118 | +<hr></hr><h3><code>lua_State</code></h3> |
| 3070 | 3119 | <pre> |
| 3071 | 3120 | typedef struct lua_State lua_State; |
| 3072 | 3121 | </pre> |
| @@ -3082,7 +3131,7 @@ every function in the library, except to <a href="#lua_newstate"><code>lua_newst · 9 unmodified lines |
| 3082 | 3131 | which creates a Lua state from scratch. |
| 3083 | 3132 | |
| 3084 | 3133 | <p><a name="lua_status"></a> |
| 3085 | | −<hr /><h3><code>lua_status</code></h3> |
| 3134 | +<hr></hr><h3><code>lua_status</code></h3> |
| 3086 | 3135 | <pre> |
| 3087 | 3136 | int lua_status (lua_State *L); |
| 3088 | 3137 | </pre> |
| @@ -3090,19 +3139,19 @@ which creates a Lua state from scratch. · 1 unmodified line |
| 3090 | 3139 | |
| 3091 | 3140 | <p>Returns the status of the thread <code>L</code>. |
| 3092 | 3141 | |
| 3093 | | −<p>The status can by 0 for a normal thread, |
| 3142 | +<p>The status can be 0 for a normal thread, |
| 3094 | 3143 | an error code if the thread finished its execution with an error, |
| 3095 | 3144 | or <code>LUA_YIELD</code> if the thread is suspended. |
| 3096 | 3145 | |
| 3097 | 3146 | <p><a name="lua_toboolean"></a> |
| 3098 | | −<hr /><h3><code>lua_toboolean</code></h3> |
| 3147 | +<hr></hr><h3><code>lua_toboolean</code></h3> |
| 3099 | 3148 | <pre> |
| 3100 | 3149 | int lua_toboolean (lua_State *L, int index); |
| 3101 | 3150 | </pre> |
| 3102 | 3151 | |
| 3103 | 3152 | |
| 3104 | 3153 | <p>Converts the Lua value at the given acceptable index to a C boolean |
| 3105 | | −value ((0 or 1). |
| 3154 | +value (0 or 1). |
| 3106 | 3155 | Like all tests in Lua, |
| 3107 | 3156 | <a href="#lua_toboolean"><code>lua_toboolean</code></a> returns 1 for any Lua value |
| 3108 | 3157 | 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 |
| 3112 | 3161 | use <a href="#lua_isboolean"><code>lua_isboolean</code></a> to test the value's type.) |
| 3113 | 3162 | |
| 3114 | 3163 | <p><a name="lua_tocfunction"></a> |
| 3115 | | −<hr /><h3><code>lua_tocfunction</code></h3> |
| 3164 | +<hr></hr><h3><code>lua_tocfunction</code></h3> |
| 3116 | 3165 | <pre> |
| 3117 | 3166 | lua_CFunction lua_tocfunction (lua_State *L, int index); |
| 3118 | 3167 | </pre> |
| @@ -3123,7 +3172,7 @@ That value must be a C function; · 4 unmodified lines |
| 3123 | 3172 | otherwise, returns <code>NULL</code>. |
| 3124 | 3173 | |
| 3125 | 3174 | <p><a name="lua_tointeger"></a> |
| 3126 | | −<hr /><h3><code>lua_tointeger</code></h3> |
| 3175 | +<hr></hr><h3><code>lua_tointeger</code></h3> |
| 3127 | 3176 | <pre> |
| 3128 | 3177 | lua_Integer lua_tointeger (lua_State *L, int idx); |
| 3129 | 3178 | </pre> |
| @@ -3131,7 +3180,7 @@ otherwise, returns <code>NULL</code>. · 1 unmodified line |
| 3131 | 3180 | |
| 3132 | 3181 | <p>Converts the Lua value at the given acceptable index |
| 3133 | 3182 | 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 |
| 3135 | 3184 | (see <a href="#coercion">2.2.1</a>); |
| 3136 | 3185 | otherwise, <a href="#lua_tointeger"><code>lua_tointeger</code></a> returns 0. |
| 3137 | 3186 | |
| @@ -3139,7 +3188,7 @@ otherwise, <a href="#lua_tointeger"><code>lua_tointeger</code></a> returns 0. · 1 unmodified line |
| 3139 | 3188 | it is truncated in some non-specified way. |
| 3140 | 3189 | |
| 3141 | 3190 | <p><a name="lua_tolstring"></a> |
| 3142 | | −<hr /><h3><code>lua_tolstring</code></h3> |
| 3191 | +<hr></hr><h3><code>lua_tolstring</code></h3> |
| 3143 | 3192 | <pre> |
| 3144 | 3193 | const char *lua_tolstring (lua_State *L, int index, size_t *len); |
| 3145 | 3194 | </pre> |
| @@ -3167,7 +3216,7 @@ there is no guarantee that the pointer returned by <a href="#lua_tolstring"><cod · 21 unmodified lines |
| 3167 | 3216 | will be valid after the corresponding value is removed from the stack. |
| 3168 | 3217 | |
| 3169 | 3218 | <p><a name="lua_tonumber"></a> |
| 3170 | | −<hr /><h3><code>lua_tonumber</code></h3> |
| 3219 | +<hr></hr><h3><code>lua_tonumber</code></h3> |
| 3171 | 3220 | <pre> |
| 3172 | 3221 | lua_Number lua_tonumber (lua_State *L, int index); |
| 3173 | 3222 | </pre> |
| @@ -3175,12 +3224,12 @@ will be valid after the corresponding value is removed from the stack. · 1 unmodified line |
| 3175 | 3224 | |
| 3176 | 3225 | <p>Converts the Lua value at the given acceptable index |
| 3177 | 3226 | 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 |
| 3179 | 3228 | (see <a href="#coercion">2.2.1</a>); |
| 3180 | 3229 | otherwise, <a href="#lua_tonumber"><code>lua_tonumber</code></a> returns 0. |
| 3181 | 3230 | |
| 3182 | 3231 | <p><a name="lua_topointer"></a> |
| 3183 | | −<hr /><h3><code>lua_topointer</code></h3> |
| 3232 | +<hr></hr><h3><code>lua_topointer</code></h3> |
| 3184 | 3233 | <pre> |
| 3185 | 3234 | const void *lua_topointer (lua_State *L, int index); |
| 3186 | 3235 | </pre> |
| @@ -3196,7 +3245,7 @@ There is no direct way to convert the pointer back to its original value. · 9 unmodified lines |
| 3196 | 3245 | <p>Typically this function is used only for debug information. |
| 3197 | 3246 | |
| 3198 | 3247 | <p><a name="lua_tostring"></a> |
| 3199 | | −<hr /><h3><code>lua_tostring</code></h3> |
| 3248 | +<hr></hr><h3><code>lua_tostring</code></h3> |
| 3200 | 3249 | <pre> |
| 3201 | 3250 | const char *lua_tostring (lua_State *L, int index); |
| 3202 | 3251 | </pre> |
| @@ -3205,7 +3254,7 @@ There is no direct way to convert the pointer back to its original value. · 2 unmodified lines |
| 3205 | 3254 | <p>Equivalent to <a href="#lua_tolstring"><code>lua_tolstring</code></a> with <code>len</code> equal to <code>NULL</code>. |
| 3206 | 3255 | |
| 3207 | 3256 | <p><a name="lua_tothread"></a> |
| 3208 | | −<hr /><h3><code>lua_tothread</code></h3> |
| 3257 | +<hr></hr><h3><code>lua_tothread</code></h3> |
| 3209 | 3258 | <pre> |
| 3210 | 3259 | lua_State *lua_tothread (lua_State *L, int index); |
| 3211 | 3260 | </pre> |
| @@ -3217,7 +3266,7 @@ This value must be a thread; · 5 unmodified lines |
| 3217 | 3266 | otherwise, the function returns <code>NULL</code>. |
| 3218 | 3267 | |
| 3219 | 3268 | <p><a name="lua_touserdata"></a> |
| 3220 | | −<hr /><h3><code>lua_touserdata</code></h3> |
| 3269 | +<hr></hr><h3><code>lua_touserdata</code></h3> |
| 3221 | 3270 | <pre> |
| 3222 | 3271 | void *lua_touserdata (lua_State *L, int index); |
| 3223 | 3272 | </pre> |
| @@ -3230,13 +3279,13 @@ returns its pointer. · 6 unmodified lines |
| 3230 | 3279 | Otherwise, returns <code>NULL</code>. |
| 3231 | 3280 | |
| 3232 | 3281 | <p><a name="lua_type"></a> |
| 3233 | | −<hr /><h3><code>lua_type</code></h3> |
| 3282 | +<hr></hr><h3><code>lua_type</code></h3> |
| 3234 | 3283 | <pre> |
| 3235 | 3284 | int lua_type (lua_State *L, int index); |
| 3236 | 3285 | </pre> |
| 3237 | 3286 | |
| 3238 | 3287 | |
| 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, |
| 3240 | 3289 | or <code>LUA_TNONE</code> for a non-valid index |
| 3241 | 3290 | (that is, an index to an "empty" stack position). |
| 3242 | 3291 | 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 |
| 3253 | 3302 | <code>LUA_TLIGHTUSERDATA</code>. |
| 3254 | 3303 | |
| 3255 | 3304 | <p><a name="lua_typename"></a> |
| 3256 | | −<hr /><h3><code>lua_typename</code></h3> |
| 3305 | +<hr></hr><h3><code>lua_typename</code></h3> |
| 3257 | 3306 | <pre> |
| 3258 | 3307 | const char *lua_typename (lua_State *L, int tp); |
| 3259 | 3308 | </pre> |
| @@ -3263,7 +3312,7 @@ and · 3 unmodified lines |
| 3263 | 3312 | which must be one the values returned by <a href="#lua_type"><code>lua_type</code></a>. |
| 3264 | 3313 | |
| 3265 | 3314 | <p><a name="lua_Writer"></a> |
| 3266 | | −<hr /><h3><code>lua_Writer</code></h3> |
| 3315 | +<hr></hr><h3><code>lua_Writer</code></h3> |
| 3267 | 3316 | <pre> |
| 3268 | 3317 | typedef int (*lua_Writer) |
| 3269 | 3318 | (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 |
| 3284 | 3333 | calling the writer again. |
| 3285 | 3334 | |
| 3286 | 3335 | <p><a name="lua_xmove"></a> |
| 3287 | | −<hr /><h3><code>lua_xmove</code></h3> |
| 3336 | +<hr></hr><h3><code>lua_xmove</code></h3> |
| 3288 | 3337 | <pre> |
| 3289 | 3338 | void lua_xmove (lua_State *from, lua_State *to, int n); |
| 3290 | 3339 | </pre> |
| @@ -3293,10 +3342,10 @@ calling the writer again. · 2 unmodified lines |
| 3293 | 3342 | <p>Exchange values between different threads of the <em>same</em> global state. |
| 3294 | 3343 | |
| 3295 | 3344 | <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>. |
| 3297 | 3346 | |
| 3298 | 3347 | <p><a name="lua_yield"></a> |
| 3299 | | −<hr /><h3><code>lua_yield</code></h3> |
| 3348 | +<hr></hr><h3><code>lua_yield</code></h3> |
| 3300 | 3349 | <pre> |
| 3301 | 3350 | int lua_yield (lua_State *L, int nresults); |
| 3302 | 3351 | </pre> |
| @@ -3326,7 +3375,7 @@ kinds of debuggers, profilers, and other tools · 23 unmodified lines |
| 3326 | 3375 | that need "inside information" from the interpreter. |
| 3327 | 3376 | |
| 3328 | 3377 | <p><a name="lua_Debug"></a> |
| 3329 | | −<hr /><h3><code>lua_Debug</code></h3> |
| 3378 | +<hr></hr><h3><code>lua_Debug</code></h3> |
| 3330 | 3379 | <pre> |
| 3331 | 3380 | typedef struct lua_Debug { |
| 3332 | 3381 | int event; |
| @@ -3408,7 +3457,7 @@ the number of upvalues of the function. · 75 unmodified lines |
| 3408 | 3457 | <p></ul> |
| 3409 | 3458 | |
| 3410 | 3459 | <p><a name="lua_gethook"></a> |
| 3411 | | −<hr /><h3><code>lua_gethook</code></h3> |
| 3460 | +<hr></hr><h3><code>lua_gethook</code></h3> |
| 3412 | 3461 | <pre> |
| 3413 | 3462 | lua_Hook lua_gethook (lua_State *L); |
| 3414 | 3463 | </pre> |
| @@ -3417,7 +3466,7 @@ the number of upvalues of the function. · 2 unmodified lines |
| 3417 | 3466 | <p>Returns the current hook function. |
| 3418 | 3467 | |
| 3419 | 3468 | <p><a name="lua_gethookcount"></a> |
| 3420 | | −<hr /><h3><code>lua_gethookcount</code></h3> |
| 3469 | +<hr></hr><h3><code>lua_gethookcount</code></h3> |
| 3421 | 3470 | <pre> |
| 3422 | 3471 | int lua_gethookcount (lua_State *L); |
| 3423 | 3472 | </pre> |
| @@ -3426,7 +3475,7 @@ the number of upvalues of the function. · 2 unmodified lines |
| 3426 | 3475 | <p>Returns the current hook count. |
| 3427 | 3476 | |
| 3428 | 3477 | <p><a name="lua_gethookmask"></a> |
| 3429 | | −<hr /><h3><code>lua_gethookmask</code></h3> |
| 3478 | +<hr></hr><h3><code>lua_gethookmask</code></h3> |
| 3430 | 3479 | <pre> |
| 3431 | 3480 | int lua_gethookmask (lua_State *L); |
| 3432 | 3481 | </pre> |
| @@ -3435,7 +3484,7 @@ the number of upvalues of the function. · 2 unmodified lines |
| 3435 | 3484 | <p>Returns the current hook mask. |
| 3436 | 3485 | |
| 3437 | 3486 | <p><a name="lua_getinfo"></a> |
| 3438 | | −<hr /><h3><code>lua_getinfo</code></h3> |
| 3487 | +<hr></hr><h3><code>lua_getinfo</code></h3> |
| 3439 | 3488 | <pre> |
| 3440 | 3489 | int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar); |
| 3441 | 3490 | </pre> |
| @@ -3469,7 +3518,7 @@ you can write the following code: · 27 unmodified lines |
| 3469 | 3518 | </pre> |
| 3470 | 3519 | |
| 3471 | 3520 | <p><a name="lua_getlocal"></a> |
| 3472 | | −<hr /><h3><code>lua_getlocal</code></h3> |
| 3521 | +<hr></hr><h3><code>lua_getlocal</code></h3> |
| 3473 | 3522 | <pre> |
| 3474 | 3523 | const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n); |
| 3475 | 3524 | </pre> |
| @@ -3494,7 +3543,7 @@ when the index is greater than · 18 unmodified lines |
| 3494 | 3543 | the number of active local variables. |
| 3495 | 3544 | |
| 3496 | 3545 | <p><a name="lua_getstack"></a> |
| 3497 | | −<hr /><h3><code>lua_getstack</code></h3> |
| 3546 | +<hr></hr><h3><code>lua_getstack</code></h3> |
| 3498 | 3547 | <pre> |
| 3499 | 3548 | int lua_getstack (lua_State *L, int level, lua_Debug *ar); |
| 3500 | 3549 | </pre> |
| @@ -3512,7 +3561,7 @@ when called with a level greater than the stack depth, · 11 unmodified lines |
| 3512 | 3561 | it returns 0. |
| 3513 | 3562 | |
| 3514 | 3563 | <p><a name="lua_getupvalue"></a> |
| 3515 | | −<hr /><h3><code>lua_getupvalue</code></h3> |
| 3564 | +<hr></hr><h3><code>lua_getupvalue</code></h3> |
| 3516 | 3565 | <pre> |
| 3517 | 3566 | const char *lua_getupvalue (lua_State *L, int funcindex, int n); |
| 3518 | 3567 | </pre> |
| @@ -3536,7 +3585,7 @@ For C functions, this function uses the empty string <code>""</code> · 17 unmodified lines |
| 3536 | 3585 | as a name for all upvalues. |
| 3537 | 3586 | |
| 3538 | 3587 | <p><a name="lua_Hook"></a> |
| 3539 | | −<hr /><h3><code>lua_Hook</code></h3> |
| 3588 | +<hr></hr><h3><code>lua_Hook</code></h3> |
| 3540 | 3589 | <pre> |
| 3541 | 3590 | typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); |
| 3542 | 3591 | </pre> |
| @@ -3564,7 +3613,7 @@ Therefore, if a hook calls back Lua to execute a function or a chunk, · 21 unmodified lines |
| 3564 | 3613 | that execution occurs without any calls to hooks. |
| 3565 | 3614 | |
| 3566 | 3615 | <p><a name="lua_sethook"></a> |
| 3567 | | −<hr /><h3><code>lua_sethook</code></h3> |
| 3616 | +<hr></hr><h3><code>lua_sethook</code></h3> |
| 3568 | 3617 | <pre> |
| 3569 | 3618 | int lua_sethook (lua_State *L, lua_Hook func, int mask, int count); |
| 3570 | 3619 | </pre> |
| @@ -3601,7 +3650,7 @@ or when it jumps back in the code (even to the same line). · 30 unmodified lines |
| 3601 | 3650 | <p>A hook is disabled by setting <code>mask</code> to zero. |
| 3602 | 3651 | |
| 3603 | 3652 | <p><a name="lua_setlocal"></a> |
| 3604 | | −<hr /><h3><code>lua_setlocal</code></h3> |
| 3653 | +<hr></hr><h3><code>lua_setlocal</code></h3> |
| 3605 | 3654 | <pre> |
| 3606 | 3655 | const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n); |
| 3607 | 3656 | </pre> |
| @@ -3619,7 +3668,7 @@ when the index is greater than · 11 unmodified lines |
| 3619 | 3668 | the number of active local variables. |
| 3620 | 3669 | |
| 3621 | 3670 | <p><a name="lua_setupvalue"></a> |
| 3622 | | −<hr /><h3><code>lua_setupvalue</code></h3> |
| 3671 | +<hr></hr><h3><code>lua_setupvalue</code></h3> |
| 3623 | 3672 | <pre> |
| 3624 | 3673 | const char *lua_setupvalue (lua_State *L, int funcindex, int n); |
| 3625 | 3674 | </pre> |
| @@ -3668,7 +3717,7 @@ you should not use these functions for other stack values. · 42 unmodified lines |
| 3668 | 3717 | in alphabetical order. |
| 3669 | 3718 | |
| 3670 | 3719 | <p><a name="luaL_addchar"></a> |
| 3671 | | −<hr /><h3><code>luaL_addchar</code></h3> |
| 3720 | +<hr></hr><h3><code>luaL_addchar</code></h3> |
| 3672 | 3721 | <pre> |
| 3673 | 3722 | void luaL_addchar (luaL_Buffer B, char c); |
| 3674 | 3723 | </pre> |
| @@ -3678,7 +3727,7 @@ in alphabetical order. · 3 unmodified lines |
| 3678 | 3727 | (see <a href="#luaL_Buffer"><code>luaL_Buffer</code></a>). |
| 3679 | 3728 | |
| 3680 | 3729 | <p><a name="luaL_addlstring"></a> |
| 3681 | | −<hr /><h3><code>luaL_addlstring</code></h3> |
| 3730 | +<hr></hr><h3><code>luaL_addlstring</code></h3> |
| 3682 | 3731 | <pre> |
| 3683 | 3732 | void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l); |
| 3684 | 3733 | </pre> |
| @@ -3690,7 +3739,7 @@ the buffer <code>B</code> · 5 unmodified lines |
| 3690 | 3739 | The string may contain embedded zeros. |
| 3691 | 3740 | |
| 3692 | 3741 | <p><a name="luaL_addsize"></a> |
| 3693 | | −<hr /><h3><code>luaL_addsize</code></h3> |
| 3742 | +<hr></hr><h3><code>luaL_addsize</code></h3> |
| 3694 | 3743 | <pre> |
| 3695 | 3744 | void luaL_addsize (luaL_Buffer B, size_t n); |
| 3696 | 3745 | </pre> |
| @@ -3701,7 +3750,7 @@ buffer area (see <a href="#luaL_prepbuffer"><code>luaL_prepbuffer</code></a>) to · 4 unmodified lines |
| 3701 | 3750 | (see <a href="#luaL_Buffer"><code>luaL_Buffer</code></a>). |
| 3702 | 3751 | |
| 3703 | 3752 | <p><a name="luaL_addstring"></a> |
| 3704 | | −<hr /><h3><code>luaL_addstring</code></h3> |
| 3753 | +<hr></hr><h3><code>luaL_addstring</code></h3> |
| 3705 | 3754 | <pre> |
| 3706 | 3755 | void luaL_addstring (luaL_Buffer *B, const char *s); |
| 3707 | 3756 | </pre> |
| @@ -3713,7 +3762,7 @@ to the buffer <code>B</code> · 5 unmodified lines |
| 3713 | 3762 | The string may not contain embedded zeros. |
| 3714 | 3763 | |
| 3715 | 3764 | <p><a name="luaL_addvalue"></a> |
| 3716 | | −<hr /><h3><code>luaL_addvalue</code></h3> |
| 3765 | +<hr></hr><h3><code>luaL_addvalue</code></h3> |
| 3717 | 3766 | <pre> |
| 3718 | 3767 | void luaL_addvalue (luaL_Buffer *B); |
| 3719 | 3768 | </pre> |
| @@ -3729,7 +3778,7 @@ be called with an extra element on the stack, · 9 unmodified lines |
| 3729 | 3778 | which is the value to be added to the buffer. |
| 3730 | 3779 | |
| 3731 | 3780 | <p><a name="luaL_argcheck"></a> |
| 3732 | | −<hr /><h3><code>luaL_argcheck</code></h3> |
| 3781 | +<hr></hr><h3><code>luaL_argcheck</code></h3> |
| 3733 | 3782 | <pre> |
| 3734 | 3783 | void luaL_argcheck (lua_State *L, int cond, int numarg, |
| 3735 | 3784 | const char *extramsg); |
| @@ -3742,7 +3791,7 @@ If not, raises an error with message · 6 unmodified lines |
| 3742 | 3791 | where <code>func</code> is retrieved from the call stack. |
| 3743 | 3792 | |
| 3744 | 3793 | <p><a name="luaL_argerror"></a> |
| 3745 | | −<hr /><h3><code>luaL_argerror</code></h3> |
| 3794 | +<hr></hr><h3><code>luaL_argerror</code></h3> |
| 3746 | 3795 | <pre> |
| 3747 | 3796 | int luaL_argerror (lua_State *L, int numarg, const char *extramsg); |
| 3748 | 3797 | </pre> |
| @@ -3757,7 +3806,7 @@ but it is an idiom to use it as <code>return luaL_argerror ...</code> · 8 unmodified lines |
| 3757 | 3806 | in C functions. |
| 3758 | 3807 | |
| 3759 | 3808 | <p><a name="luaL_Buffer"></a> |
| 3760 | | −<hr /><h3><code>luaL_Buffer</code></h3> |
| 3809 | +<hr></hr><h3><code>luaL_Buffer</code></h3> |
| 3761 | 3810 | <pre> |
| 3762 | 3811 | typedef struct luaL_Buffer luaL_Buffer; |
| 3763 | 3812 | </pre> |
| @@ -3772,7 +3821,7 @@ Its pattern of use is as follows: · 8 unmodified lines |
| 3772 | 3821 | <li> Then you initialize it with a call <code>luaL_buffinit(L, &b)</code>. |
| 3773 | 3822 | <li> Then you add string pieces to the buffer calling any of |
| 3774 | 3823 | the <code>luaL_add*</code> functions. |
| 3775 | | −<li> You finish calling <code>luaL_pushresult(&b)</code>. |
| 3824 | +<li> You finish by calling <code>luaL_pushresult(&b)</code>. |
| 3776 | 3825 | That call leaves the final string on the top of the stack. |
| 3777 | 3826 | </ul> |
| 3778 | 3827 | |
| @@ -3792,7 +3841,7 @@ level when the buffer was initialized, · 13 unmodified lines |
| 3792 | 3841 | plus the final string on its top. |
| 3793 | 3842 | |
| 3794 | 3843 | <p><a name="luaL_buffinit"></a> |
| 3795 | | −<hr /><h3><code>luaL_buffinit</code></h3> |
| 3844 | +<hr></hr><h3><code>luaL_buffinit</code></h3> |
| 3796 | 3845 | <pre> |
| 3797 | 3846 | void luaL_buffinit (lua_State *L, luaL_Buffer *B); |
| 3798 | 3847 | </pre> |
| @@ -3804,7 +3853,7 @@ the buffer must be declared as a variable · 5 unmodified lines |
| 3804 | 3853 | (see <a href="#luaL_Buffer"><code>luaL_Buffer</code></a>). |
| 3805 | 3854 | |
| 3806 | 3855 | <p><a name="luaL_callmeta"></a> |
| 3807 | | −<hr /><h3><code>luaL_callmeta</code></h3> |
| 3856 | +<hr></hr><h3><code>luaL_callmeta</code></h3> |
| 3808 | 3857 | <pre> |
| 3809 | 3858 | int luaL_callmeta (lua_State *L, int obj, const char *e); |
| 3810 | 3859 | </pre> |
| @@ -3821,7 +3870,7 @@ If there is no metatable or no metamethod, · 10 unmodified lines |
| 3821 | 3870 | this function returns 0 (without pushing any value on the stack). |
| 3822 | 3871 | |
| 3823 | 3872 | <p><a name="luaL_checkany"></a> |
| 3824 | | −<hr /><h3><code>luaL_checkany</code></h3> |
| 3873 | +<hr></hr><h3><code>luaL_checkany</code></h3> |
| 3825 | 3874 | <pre> |
| 3826 | 3875 | void luaL_checkany (lua_State *L, int narg); |
| 3827 | 3876 | </pre> |
| @@ -3831,7 +3880,7 @@ this function returns 0 (without pushing any value on the stack). · 3 unmodified lines |
| 3831 | 3880 | of any type (including <b>nil</b>) at position <code>narg</code>. |
| 3832 | 3881 | |
| 3833 | 3882 | <p><a name="luaL_checkint"></a> |
| 3834 | | −<hr /><h3><code>luaL_checkint</code></h3> |
| 3883 | +<hr></hr><h3><code>luaL_checkint</code></h3> |
| 3835 | 3884 | <pre> |
| 3836 | 3885 | int luaL_checkint (lua_State *L, int narg); |
| 3837 | 3886 | </pre> |
| @@ -3841,7 +3890,7 @@ of any type (including <b>nil</b>) at position <code>narg</code>. · 3 unmodified lines |
| 3841 | 3890 | and returns that number cast to an <code>int</code>. |
| 3842 | 3891 | |
| 3843 | 3892 | <p><a name="luaL_checkinteger"></a> |
| 3844 | | −<hr /><h3><code>luaL_checkinteger</code></h3> |
| 3893 | +<hr></hr><h3><code>luaL_checkinteger</code></h3> |
| 3845 | 3894 | <pre> |
| 3846 | 3895 | lua_Integer luaL_checkinteger (lua_State *L, int narg); |
| 3847 | 3896 | </pre> |
| @@ -3851,7 +3900,7 @@ and returns that number cast to an <code>int</code>. · 3 unmodified lines |
| 3851 | 3900 | and returns that number cast to a <a href="#lua_Integer"><code>lua_Integer</code></a>. |
| 3852 | 3901 | |
| 3853 | 3902 | <p><a name="luaL_checklong"></a> |
| 3854 | | −<hr /><h3><code>luaL_checklong</code></h3> |
| 3903 | +<hr></hr><h3><code>luaL_checklong</code></h3> |
| 3855 | 3904 | <pre> |
| 3856 | 3905 | long luaL_checklong (lua_State *L, int narg); |
| 3857 | 3906 | </pre> |
| @@ -3861,9 +3910,9 @@ and returns that number cast to a <a href="#lua_Integer"><code>lua_Integer</code · 3 unmodified lines |
| 3861 | 3910 | and returns that number cast to a <code>long</code>. |
| 3862 | 3911 | |
| 3863 | 3912 | <p><a name="luaL_checklstring"></a> |
| 3864 | | −<hr /><h3><code>luaL_checklstring</code></h3> |
| 3913 | +<hr></hr><h3><code>luaL_checklstring</code></h3> |
| 3865 | 3914 | <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); |
| 3867 | 3916 | </pre> |
| 3868 | 3917 | |
| 3869 | 3918 | |
| @@ -3873,9 +3922,9 @@ if <code>l</code> is not <code>NULL</code> fills <code>*l</code> · 3 unmodified lines |
| 3873 | 3922 | with the string's length. |
| 3874 | 3923 | |
| 3875 | 3924 | <p><a name="luaL_checknumber"></a> |
| 3876 | | −<hr /><h3><code>luaL_checknumber</code></h3> |
| 3925 | +<hr></hr><h3><code>luaL_checknumber</code></h3> |
| 3877 | 3926 | <pre> |
| 3878 | | − lua_Number luaL_checknumber (lua_State *L, int numArg); |
| 3927 | + lua_Number luaL_checknumber (lua_State *L, int narg); |
| 3879 | 3928 | </pre> |
| 3880 | 3929 | |
| 3881 | 3930 | |
| @@ -3883,7 +3932,7 @@ with the string's length. · 1 unmodified line |
| 3883 | 3932 | and returns that number. |
| 3884 | 3933 | |
| 3885 | 3934 | <p><a name="luaL_checkoption"></a> |
| 3886 | | −<hr /><h3><code>luaL_checkoption</code></h3> |
| 3935 | +<hr></hr><h3><code>luaL_checkoption</code></h3> |
| 3887 | 3936 | <pre> |
| 3888 | 3937 | int luaL_checkoption (lua_State *L, int narg, const char *def, |
| 3889 | 3938 | const char *const lst[]); |
| @@ -3902,11 +3951,11 @@ Raises an error if the argument is not a string or · 12 unmodified lines |
| 3902 | 3951 | if the string cannot be found. |
| 3903 | 3952 | |
| 3904 | 3953 | <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 |
| 3906 | 3955 | to select options. |
| 3907 | 3956 | |
| 3908 | 3957 | <p><a name="luaL_checkstack"></a> |
| 3909 | | −<hr /><h3><code>luaL_checkstack</code></h3> |
| 3958 | +<hr></hr><h3><code>luaL_checkstack</code></h3> |
| 3910 | 3959 | <pre> |
| 3911 | 3960 | void luaL_checkstack (lua_State *L, int sz, const char *msg); |
| 3912 | 3961 | </pre> |
| @@ -3917,7 +3966,7 @@ raising an error if the stack cannot grow to that size. · 4 unmodified lines |
| 3917 | 3966 | <code>msg</code> is an additional text to go into the error message. |
| 3918 | 3967 | |
| 3919 | 3968 | <p><a name="luaL_checkstring"></a> |
| 3920 | | −<hr /><h3><code>luaL_checkstring</code></h3> |
| 3969 | +<hr></hr><h3><code>luaL_checkstring</code></h3> |
| 3921 | 3970 | <pre> |
| 3922 | 3971 | const char *luaL_checkstring (lua_State *L, int narg); |
| 3923 | 3972 | </pre> |
| @@ -3927,7 +3976,7 @@ raising an error if the stack cannot grow to that size. · 3 unmodified lines |
| 3927 | 3976 | and returns that string. |
| 3928 | 3977 | |
| 3929 | 3978 | <p><a name="luaL_checktype"></a> |
| 3930 | | −<hr /><h3><code>luaL_checktype</code></h3> |
| 3979 | +<hr></hr><h3><code>luaL_checktype</code></h3> |
| 3931 | 3980 | <pre> |
| 3932 | 3981 | void luaL_checktype (lua_State *L, int narg, int t); |
| 3933 | 3982 | </pre> |
| @@ -3936,9 +3985,9 @@ and returns that string. · 2 unmodified lines |
| 3936 | 3985 | <p>Checks whether the function argument <code>narg</code> has type <code>t</code>. |
| 3937 | 3986 | |
| 3938 | 3987 | <p><a name="luaL_checkudata"></a> |
| 3939 | | −<hr /><h3><code>luaL_checkudata</code></h3> |
| 3988 | +<hr></hr><h3><code>luaL_checkudata</code></h3> |
| 3940 | 3989 | <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); |
| 3942 | 3991 | </pre> |
| 3943 | 3992 | |
| 3944 | 3993 | |
| @@ -3946,7 +3995,7 @@ and returns that string. · 1 unmodified line |
| 3946 | 3995 | of the type <code>tname</code> (see <a href="#luaL_newmetatable"><code>luaL_newmetatable</code></a>). |
| 3947 | 3996 | |
| 3948 | 3997 | <p><a name="luaL_error"></a> |
| 3949 | | −<hr /><h3><code>luaL_error</code></h3> |
| 3998 | +<hr></hr><h3><code>luaL_error</code></h3> |
| 3950 | 3999 | <pre> |
| 3951 | 4000 | int luaL_error (lua_State *L, const char *fmt, ...); |
| 3952 | 4001 | </pre> |
| @@ -3954,7 +4003,7 @@ of the type <code>tname</code> (see <a href="#luaL_newmetatable"><code>luaL_newm · 1 unmodified line |
| 3954 | 4003 | |
| 3955 | 4004 | <p>Raises an error. |
| 3956 | 4005 | The error message format is given by <code>fmt</code> |
| 3957 | | −plus any extra argument, |
| 4006 | +plus any extra arguments, |
| 3958 | 4007 | following the same rules of <a href="#lua_pushfstring"><code>lua_pushfstring</code></a>. |
| 3959 | 4008 | It also adds at the beginning of the message the file name and |
| 3960 | 4009 | 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 |
| 3965 | 4014 | in C functions. |
| 3966 | 4015 | |
| 3967 | 4016 | <p><a name="luaL_getmetafield"></a> |
| 3968 | | −<hr /><h3><code>luaL_getmetafield</code></h3> |
| 4017 | +<hr></hr><h3><code>luaL_getmetafield</code></h3> |
| 3969 | 4018 | <pre> |
| 3970 | 4019 | int luaL_getmetafield (lua_State *L, int obj, const char *e); |
| 3971 | 4020 | </pre> |
| @@ -3978,7 +4027,7 @@ or if the metatable does not have that field, · 6 unmodified lines |
| 3978 | 4027 | returns 0 and pushes nothing. |
| 3979 | 4028 | |
| 3980 | 4029 | <p><a name="luaL_getmetatable"></a> |
| 3981 | | −<hr /><h3><code>luaL_getmetatable</code></h3> |
| 4030 | +<hr></hr><h3><code>luaL_getmetatable</code></h3> |
| 3982 | 4031 | <pre> |
| 3983 | 4032 | void luaL_getmetatable (lua_State *L, const char *tname); |
| 3984 | 4033 | </pre> |
| @@ -3988,7 +4037,7 @@ returns 0 and pushes nothing. · 3 unmodified lines |
| 3988 | 4037 | in the registry (see <a href="#luaL_newmetatable"><code>luaL_newmetatable</code></a>). |
| 3989 | 4038 | |
| 3990 | 4039 | <p><a name="luaL_gsub"></a> |
| 3991 | | −<hr /><h3><code>luaL_gsub</code></h3> |
| 4040 | +<hr></hr><h3><code>luaL_gsub</code></h3> |
| 3992 | 4041 | <pre> |
| 3993 | 4042 | const char *luaL_gsub (lua_State *L, const char *s, |
| 3994 | 4043 | const char *p, const char *r); |
| @@ -4001,7 +4050,7 @@ with the string <code>r</code>. · 6 unmodified lines |
| 4001 | 4050 | Pushes the resulting string on the stack and returns it. |
| 4002 | 4051 | |
| 4003 | 4052 | <p><a name="luaL_loadbuffer"></a> |
| 4004 | | −<hr /><h3><code>luaL_loadbuffer</code></h3> |
| 4053 | +<hr></hr><h3><code>luaL_loadbuffer</code></h3> |
| 4005 | 4054 | <pre> |
| 4006 | 4055 | int luaL_loadbuffer (lua_State *L, const char *buff, |
| 4007 | 4056 | size_t sz, const char *name); |
| @@ -4017,7 +4066,7 @@ buffer pointed by <code>buff</code> with size <code>sz</code>. · 9 unmodified lines |
| 4017 | 4066 | used for debug information and error messages. |
| 4018 | 4067 | |
| 4019 | 4068 | <p><a name="luaL_loadfile"></a> |
| 4020 | | −<hr /><h3><code>luaL_loadfile</code></h3> |
| 4069 | +<hr></hr><h3><code>luaL_loadfile</code></h3> |
| 4021 | 4070 | <pre> |
| 4022 | 4071 | int luaL_loadfile (lua_State *L, const char *filename); |
| 4023 | 4072 | </pre> |
| @@ -4035,7 +4084,7 @@ but it has an extra error code <code>LUA_ERRFILE</code> · 11 unmodified lines |
| 4035 | 4084 | if it cannot open/read the file. |
| 4036 | 4085 | |
| 4037 | 4086 | <p><a name="luaL_loadstring"></a> |
| 4038 | | −<hr /><h3><code>luaL_loadstring</code></h3> |
| 4087 | +<hr></hr><h3><code>luaL_loadstring</code></h3> |
| 4039 | 4088 | <pre> |
| 4040 | 4089 | int luaL_loadstring (lua_State *L, const char *s); |
| 4041 | 4090 | </pre> |
| @@ -4048,24 +4097,24 @@ the zero-terminated string <code>s</code>. · 6 unmodified lines |
| 4048 | 4097 | <p>This function returns the same results as <a href="#lua_load"><code>lua_load</code></a>. |
| 4049 | 4098 | |
| 4050 | 4099 | <p><a name="luaL_newmetatable"></a> |
| 4051 | | −<hr /><h3><code>luaL_newmetatable</code></h3> |
| 4100 | +<hr></hr><h3><code>luaL_newmetatable</code></h3> |
| 4052 | 4101 | <pre> |
| 4053 | 4102 | int luaL_newmetatable (lua_State *L, const char *tname); |
| 4054 | 4103 | </pre> |
| 4055 | 4104 | |
| 4056 | 4105 | |
| 4057 | | −<p>If the registry already has the key <code>"tname"</code>, |
| 4106 | +<p>If the registry already has the key <code>tname</code>, |
| 4058 | 4107 | returns 0. |
| 4059 | 4108 | Otherwise, |
| 4060 | 4109 | 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>, |
| 4062 | 4111 | and returns 1. |
| 4063 | 4112 | |
| 4064 | 4113 | <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. |
| 4066 | 4115 | |
| 4067 | 4116 | <p><a name="luaL_newstate"></a> |
| 4068 | | −<hr /><h3><code>luaL_newstate</code></h3> |
| 4117 | +<hr></hr><h3><code>luaL_newstate</code></h3> |
| 4069 | 4118 | <pre> |
| 4070 | 4119 | lua_State *luaL_newstate (void); |
| 4071 | 4120 | </pre> |
| @@ -4080,8 +4129,17 @@ errors. · 8 unmodified lines |
| 4080 | 4129 | <p>Returns the new state, |
| 4081 | 4130 | or <code>NULL</code> if there is a memory allocation error. |
| 4082 | 4131 | |
| 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 | + |
| 4083 | 4141 | <p><a name="luaL_optint"></a> |
| 4084 | | −<hr /><h3><code>luaL_optint</code></h3> |
| 4142 | +<hr></hr><h3><code>luaL_optint</code></h3> |
| 4085 | 4143 | <pre> |
| 4086 | 4144 | int luaL_optint (lua_State *L, int narg, int d); |
| 4087 | 4145 | </pre> |
| @@ -4094,9 +4152,9 @@ returns <code>d</code>. · 6 unmodified lines |
| 4094 | 4152 | Otherwise, raises an error. |
| 4095 | 4153 | |
| 4096 | 4154 | <p><a name="luaL_optinteger"></a> |
| 4097 | | −<hr /><h3><code>luaL_optinteger</code></h3> |
| 4155 | +<hr></hr><h3><code>luaL_optinteger</code></h3> |
| 4098 | 4156 | <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); |
| 4100 | 4158 | </pre> |
| 4101 | 4159 | |
| 4102 | 4160 | |
| @@ -4107,7 +4165,7 @@ returns <code>d</code>. · 4 unmodified lines |
| 4107 | 4165 | Otherwise, raises an error. |
| 4108 | 4166 | |
| 4109 | 4167 | <p><a name="luaL_optlong"></a> |
| 4110 | | −<hr /><h3><code>luaL_optlong</code></h3> |
| 4168 | +<hr></hr><h3><code>luaL_optlong</code></h3> |
| 4111 | 4169 | <pre> |
| 4112 | 4170 | long luaL_optlong (lua_State *L, int narg, long d); |
| 4113 | 4171 | </pre> |
| @@ -4120,9 +4178,9 @@ returns <code>d</code>. · 6 unmodified lines |
| 4120 | 4178 | Otherwise, raises an error. |
| 4121 | 4179 | |
| 4122 | 4180 | <p><a name="luaL_optlstring"></a> |
| 4123 | | −<hr /><h3><code>luaL_optlstring</code></h3> |
| 4181 | +<hr></hr><h3><code>luaL_optlstring</code></h3> |
| 4124 | 4182 | <pre> |
| 4125 | | − const char *luaL_optlstring (lua_State *L, int numArg, |
| 4183 | + const char *luaL_optlstring (lua_State *L, int narg, |
| 4126 | 4184 | const char *d, size_t *l); |
| 4127 | 4185 | </pre> |
| 4128 | 4186 | |
| @@ -4137,9 +4195,9 @@ Otherwise, raises an error. · 8 unmodified lines |
| 4137 | 4195 | fills the position <code>*l</code> with the results's length. |
| 4138 | 4196 | |
| 4139 | 4197 | <p><a name="luaL_optnumber"></a> |
| 4140 | | −<hr /><h3><code>luaL_optnumber</code></h3> |
| 4198 | +<hr></hr><h3><code>luaL_optnumber</code></h3> |
| 4141 | 4199 | <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); |
| 4143 | 4201 | </pre> |
| 4144 | 4202 | |
| 4145 | 4203 | |
| @@ -4150,7 +4208,7 @@ returns <code>d</code>. · 4 unmodified lines |
| 4150 | 4208 | Otherwise, raises an error. |
| 4151 | 4209 | |
| 4152 | 4210 | <p><a name="luaL_optstring"></a> |
| 4153 | | −<hr /><h3><code>luaL_optstring</code></h3> |
| 4211 | +<hr></hr><h3><code>luaL_optstring</code></h3> |
| 4154 | 4212 | <pre> |
| 4155 | 4213 | const char *luaL_optstring (lua_State *L, int narg, const char *d); |
| 4156 | 4214 | </pre> |
| @@ -4163,7 +4221,7 @@ returns <code>d</code>. · 6 unmodified lines |
| 4163 | 4221 | Otherwise, raises an error. |
| 4164 | 4222 | |
| 4165 | 4223 | <p><a name="luaL_prepbuffer"></a> |
| 4166 | | −<hr /><h3><code>luaL_prepbuffer</code></h3> |
| 4224 | +<hr></hr><h3><code>luaL_prepbuffer</code></h3> |
| 4167 | 4225 | <pre> |
| 4168 | 4226 | char *luaL_prepbuffer (luaL_Buffer *B); |
| 4169 | 4227 | </pre> |
| @@ -4177,7 +4235,7 @@ After copying the string into that space you must call · 7 unmodified lines |
| 4177 | 4235 | it to the buffer. |
| 4178 | 4236 | |
| 4179 | 4237 | <p><a name="luaL_pushresult"></a> |
| 4180 | | −<hr /><h3><code>luaL_pushresult</code></h3> |
| 4238 | +<hr></hr><h3><code>luaL_pushresult</code></h3> |
| 4181 | 4239 | <pre> |
| 4182 | 4240 | void luaL_pushresult (luaL_Buffer *B); |
| 4183 | 4241 | </pre> |
| @@ -4187,7 +4245,7 @@ it to the buffer. · 3 unmodified lines |
| 4187 | 4245 | the top of the stack. |
| 4188 | 4246 | |
| 4189 | 4247 | <p><a name="luaL_ref"></a> |
| 4190 | | −<hr /><h3><code>luaL_ref</code></h3> |
| 4248 | +<hr></hr><h3><code>luaL_ref</code></h3> |
| 4191 | 4249 | <pre> |
| 4192 | 4250 | int luaL_ref (lua_State *L, int t); |
| 4193 | 4251 | </pre> |
| @@ -4205,12 +4263,12 @@ by calling <code>lua_rawgeti(L, t, r)</code>. · 11 unmodified lines |
| 4205 | 4263 | Function <a href="#luaL_unref"><code>luaL_unref</code></a> frees a reference and its associated object. |
| 4206 | 4264 | |
| 4207 | 4265 | <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>. |
| 4209 | 4267 | The constant <code>LUA_NOREF</code> is guaranteed to be different |
| 4210 | 4268 | from any reference returned by <a href="#luaL_ref"><code>luaL_ref</code></a>. |
| 4211 | 4269 | |
| 4212 | 4270 | <p><a name="luaL_Reg"></a> |
| 4213 | | −<hr /><h3><code>luaL_Reg</code></h3> |
| 4271 | +<hr></hr><h3><code>luaL_Reg</code></h3> |
| 4214 | 4272 | <pre> |
| 4215 | 4273 | typedef struct luaL_Reg { |
| 4216 | 4274 | 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 |
| 4228 | 4286 | in which both <code>name</code> and <code>func</code> are <code>NULL</code>. |
| 4229 | 4287 | |
| 4230 | 4288 | <p><a name="luaL_register"></a> |
| 4231 | | −<hr /><h3><code>luaL_register</code></h3> |
| 4289 | +<hr></hr><h3><code>luaL_register</code></h3> |
| 4232 | 4290 | <pre> |
| 4233 | 4291 | void luaL_register (lua_State *L, const char *libname, |
| 4234 | 4292 | const luaL_Reg *l); |
| @@ -4254,7 +4312,7 @@ reuses that table instead of creating a new one. · 19 unmodified lines |
| 4254 | 4312 | on the top of the stack. |
| 4255 | 4313 | |
| 4256 | 4314 | <p><a name="luaL_typename"></a> |
| 4257 | | −<hr /><h3><code>luaL_typename</code></h3> |
| 4315 | +<hr></hr><h3><code>luaL_typename</code></h3> |
| 4258 | 4316 | <pre> |
| 4259 | 4317 | const char *luaL_typename (lua_State *L, int idx); |
| 4260 | 4318 | </pre> |
| @@ -4263,7 +4321,7 @@ on the top of the stack. · 2 unmodified lines |
| 4263 | 4321 | <p>Returns the name of the type of the value at index <code>idx</code>. |
| 4264 | 4322 | |
| 4265 | 4323 | <p><a name="luaL_typerror"></a> |
| 4266 | | −<hr /><h3><code>luaL_typerror</code></h3> |
| 4324 | +<hr></hr><h3><code>luaL_typerror</code></h3> |
| 4267 | 4325 | <pre> |
| 4268 | 4326 | int luaL_typerror (lua_State *L, int narg, const char *tname); |
| 4269 | 4327 | </pre> |
| @@ -4278,7 +4336,7 @@ where <code><location></code> is produced by <a href="#luaL_where"><code>lu · 8 unmodified lines |
| 4278 | 4336 | and <code><realt></code> is the type name of the actual argument. |
| 4279 | 4337 | |
| 4280 | 4338 | <p><a name="luaL_unref"></a> |
| 4281 | | −<hr /><h3><code>luaL_unref</code></h3> |
| 4339 | +<hr></hr><h3><code>luaL_unref</code></h3> |
| 4282 | 4340 | <pre> |
| 4283 | 4341 | void luaL_unref (lua_State *L, int t, int ref); |
| 4284 | 4342 | </pre> |
| @@ -4294,7 +4352,7 @@ The reference <code>ref</code> is also freed to be used again. · 9 unmodified lines |
| 4294 | 4352 | <a href="#luaL_unref"><code>luaL_unref</code></a> does nothing. |
| 4295 | 4353 | |
| 4296 | 4354 | <p><a name="luaL_where"></a> |
| 4297 | | −<hr /><h3><code>luaL_where</code></h3> |
| 4355 | +<hr></hr><h3><code>luaL_where</code></h3> |
| 4298 | 4356 | <pre> |
| 4299 | 4357 | void luaL_where (lua_State *L, int lvl); |
| 4300 | 4358 | </pre> |
| @@ -4363,14 +4421,14 @@ If you do not include this library in your application, · 62 unmodified lines |
| 4363 | 4421 | you should check carefully whether you need to provide |
| 4364 | 4422 | implementations for some of its facilities. |
| 4365 | 4423 | |
| 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> |
| 4367 | 4425 | Issues an error when |
| 4368 | 4426 | the value of its argument <code>v</code> is false (i.e., <b>nil</b> or <b>false</b>); |
| 4369 | 4427 | otherwise, returns all its arguments. |
| 4370 | 4428 | <code>message</code> is an error message; |
| 4371 | 4429 | when absent, it defaults to "assertion failed!" |
| 4372 | 4430 | |
| 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> |
| 4374 | 4432 | |
| 4375 | 4433 | <p>This function is a generic interface to the garbage collector. |
| 4376 | 4434 | 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 |
| 4393 | 4451 | the collector (see <a href="#GC">2.10</a>). |
| 4394 | 4452 | </ul> |
| 4395 | 4453 | |
| 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> |
| 4397 | 4455 | Opens the named file and executes its contents as a Lua chunk. |
| 4398 | 4456 | When called without arguments, |
| 4399 | 4457 | <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 |
| 4401 | 4459 | In case of errors, <code>dofile</code> propagates the error |
| 4402 | 4460 | to its caller (that is, <code>dofile</code> does not run in protected mode). |
| 4403 | 4461 | |
| 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> |
| 4405 | 4463 | Terminates the last protected function called |
| 4406 | 4464 | and returns <code>message</code> as the error message. |
| 4407 | 4465 | Function <code>error</code> never returns. |
| @@ -4416,7 +4474,7 @@ that called <code>error</code> was called; and so on. · 8 unmodified lines |
| 4416 | 4474 | Passing a level 0 avoids the addition of error position information |
| 4417 | 4475 | to the message. |
| 4418 | 4476 | |
| 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> |
| 4420 | 4478 | A global variable (not a function) that |
| 4421 | 4479 | holds the global environment (that is, <code>_G._G = _G</code>). |
| 4422 | 4480 | Lua itself does not use this variable; |
| @@ -4424,7 +4482,7 @@ changing its value does not affect any environment, · 1 unmodified line |
| 4424 | 4482 | nor vice-versa. |
| 4425 | 4483 | (Use <a href="#pdf-setfenv"><code>setfenv</code></a> to change environments.) |
| 4426 | 4484 | |
| 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> |
| 4428 | 4486 | Returns the current environment in use by the function. |
| 4429 | 4487 | <code>f</code> can be a Lua function or a number |
| 4430 | 4488 | that specifies the function at that stack level: |
| @@ -4434,7 +4492,7 @@ or if <code>f</code> is 0, · 3 unmodified lines |
| 4434 | 4492 | <code>getfenv</code> returns the global environment. |
| 4435 | 4493 | The default for <code>f</code> is 1. |
| 4436 | 4494 | |
| 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> |
| 4438 | 4496 | |
| 4439 | 4497 | <p>If <code>object</code> does not have a metatable, returns <b>nil</b>. |
| 4440 | 4498 | Otherwise, |
| @@ -4442,7 +4500,7 @@ if the object's metatable has a <code>"__metatable"</code> field, · 1 unmodified line |
| 4442 | 4500 | returns the associated value. |
| 4443 | 4501 | Otherwise, returns the metatable of the given object. |
| 4444 | 4502 | |
| 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> |
| 4446 | 4504 | |
| 4447 | 4505 | <p>Returns three values: an iterator function, the table <code>t</code>, and 0, |
| 4448 | 4506 | so that the construction |
| @@ -4454,7 +4512,7 @@ up to the first integer key with a nil value in the table. · 5 unmodified lines |
| 4454 | 4512 | |
| 4455 | 4513 | <p>See <a href="#pdf-next"><code>next</code></a> for the caveats of modifying the table during its traversal. |
| 4456 | 4514 | |
| 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> |
| 4458 | 4516 | |
| 4459 | 4517 | <p>Loads a chunk using function <code>func</code> to get its pieces. |
| 4460 | 4518 | 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 |
| 4469 | 4527 | <p><code>chunkname</code> is used as the chunk name for error messages |
| 4470 | 4528 | and debug information. |
| 4471 | 4529 | |
| 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> |
| 4473 | 4531 | |
| 4474 | 4532 | <p>Similar to <a href="#pdf-load"><code>load</code></a>, |
| 4475 | 4533 | but gets the chunk from file <code>filename</code> |
| 4476 | 4534 | or from the standard input, |
| 4477 | | −if no file name given. |
| 4535 | +if no file name is given. |
| 4478 | 4536 | |
| 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> |
| 4480 | 4538 | |
| 4481 | 4539 | <p>Similar to <a href="#pdf-load"><code>load</code></a>, |
| 4482 | 4540 | but gets the chunk from the given string. |
| @@ -4486,7 +4544,7 @@ but gets the chunk from the given string. · 3 unmodified lines |
| 4486 | 4544 | assert(loadstring(s))() |
| 4487 | 4545 | </pre> |
| 4488 | 4546 | |
| 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> |
| 4490 | 4548 | |
| 4491 | 4549 | <p>Allows a program to traverse all fields of a table. |
| 4492 | 4550 | 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 |
| 4518 | 4576 | You may however modify existing fields. |
| 4519 | 4577 | In particular, you may clear existing fields. |
| 4520 | 4578 | |
| 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> |
| 4522 | 4580 | |
| 4523 | 4581 | <p>Returns three values: the <a href="#pdf-next"><code>next</code></a> function, the table <code>t</code>, and <b>nil</b>, |
| 4524 | 4582 | so that the construction |
| @@ -4529,7 +4587,7 @@ will iterate over all key--value pairs of table <code>t</code>. · 4 unmodified lines |
| 4529 | 4587 | |
| 4530 | 4588 | <p>See <a href="#pdf-next"><code>next</code></a> for the caveats of modifying the table during its traversal. |
| 4531 | 4589 | |
| 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> |
| 4533 | 4591 | |
| 4534 | 4592 | <p>Calls function <code>f</code> with |
| 4535 | 4593 | 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 |
| 4542 | 4600 | after this first result. |
| 4543 | 4601 | In case of any error, <code>pcall</code> returns <b>false</b> plus the error message. |
| 4544 | 4602 | |
| 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> |
| 4546 | 4604 | Receives any number of arguments, |
| 4547 | 4605 | and prints their values in <code>stdout</code>, |
| 4548 | 4606 | 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 |
| 4551 | 4609 | typically for debugging. |
| 4552 | 4610 | For formatted output, use <a href="#pdf-string.format"><code>string.format</code></a>. |
| 4553 | 4611 | |
| 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> |
| 4555 | 4613 | Checks whether <code>v1</code> is equal to <code>v2</code>, |
| 4556 | 4614 | without invoking any metamethod. |
| 4557 | 4615 | Returns a boolean. |
| 4558 | 4616 | |
| 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> |
| 4560 | 4618 | Gets the real value of <code>table[index]</code>, |
| 4561 | 4619 | without invoking any metamethod. |
| 4562 | 4620 | <code>table</code> must be a table and |
| 4563 | 4621 | <code>index</code> any value different from <b>nil</b>. |
| 4564 | 4622 | |
| 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> |
| 4566 | 4624 | Sets the real value of <code>table[index]</code> to <code>value</code>, |
| 4567 | 4625 | without invoking any metamethod. |
| 4568 | 4626 | <code>table</code> must be a table, |
| 4569 | 4627 | <code>index</code> any value different from <b>nil</b>, |
| 4570 | 4628 | and <code>value</code> any Lua value. |
| 4571 | 4629 | |
| 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> |
| 4573 | 4631 | |
| 4574 | 4632 | <p>If <code>index</code> is a number, |
| 4575 | 4633 | returns all arguments after argument number <code>index</code>. |
| 4576 | 4634 | Otherwise, <code>index</code> must be the string <code>"#"</code>, |
| 4577 | 4635 | and <code>select</code> returns the total number of extra arguments it received. |
| 4578 | 4636 | |
| 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> |
| 4580 | 4638 | |
| 4581 | 4639 | <p>Sets the environment to be used by the given function. |
| 4582 | 4640 | <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 |
| 4588 | 4646 | the environment of the running thread. |
| 4589 | 4647 | In this case, <code>setfenv</code> returns no values. |
| 4590 | 4648 | |
| 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> |
| 4592 | 4650 | |
| 4593 | 4651 | <p>Sets the metatable for the given table. |
| 4594 | 4652 | (You cannot change the metatable of other types from Lua, only from C.) |
| @@ -4599,7 +4657,7 @@ raises an error. · 4 unmodified lines |
| 4599 | 4657 | |
| 4600 | 4658 | <p>This function returns <code>table</code>. |
| 4601 | 4659 | |
| 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> |
| 4603 | 4661 | Tries to convert its argument to a number. |
| 4604 | 4662 | If the argument is already a number or a string convertible |
| 4605 | 4663 | 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 |
| 4614 | 4672 | as well as an optional exponent part (see <a href="#lexical">2.1</a>). |
| 4615 | 4673 | In other bases, only unsigned integers are accepted. |
| 4616 | 4674 | |
| 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> |
| 4618 | 4676 | Receives an argument of any type and |
| 4619 | 4677 | converts it to a string in a reasonable format. |
| 4620 | 4678 | For complete control of how numbers are converted, |
| @@ -4625,7 +4683,7 @@ then <code>tostring</code> calls the corresponding value · 4 unmodified lines |
| 4625 | 4683 | with <code>e</code> as argument, |
| 4626 | 4684 | and uses the result of the call as its result. |
| 4627 | 4685 | |
| 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> |
| 4629 | 4687 | Returns the type of its only argument, coded as a string. |
| 4630 | 4688 | The possible results of this function are |
| 4631 | 4689 | <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 |
| 4637 | 4695 | <code>"thread"</code>, |
| 4638 | 4696 | and <code>"userdata"</code>. |
| 4639 | 4697 | |
| 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> |
| 4641 | 4699 | Returns the elements from the given table. |
| 4642 | 4700 | This function is equivalent to |
| 4643 | 4701 | <pre> |
| @@ -4648,12 +4706,12 @@ of elements. · 4 unmodified lines |
| 4648 | 4706 | By default, <code>i</code> is 1 and <code>j</code> is the length of the list, |
| 4649 | 4707 | as defined by the length operator (see <a href="#len-op">2.5.5</a>). |
| 4650 | 4708 | |
| 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> |
| 4652 | 4710 | A global variable (not a function) that |
| 4653 | 4711 | holds a string containing the current interpreter version. |
| 4654 | 4712 | The current contents of this variable is <code>"Lua 5.1"</code>. |
| 4655 | 4713 | |
| 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> |
| 4657 | 4715 | |
| 4658 | 4716 | <p>This function is similar to <code>pcall</code>, |
| 4659 | 4717 | except that you can set a new error handler. |
| @@ -4677,14 +4735,14 @@ In case of any error, · 17 unmodified lines |
| 4677 | 4735 | the basic library and come inside the table <code>coroutine</code>. |
| 4678 | 4736 | See <a href="#coroutine">2.11</a> for a general description of coroutines. |
| 4679 | 4737 | |
| 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> |
| 4681 | 4739 | |
| 4682 | 4740 | <p>Creates a new coroutine, with body <code>f</code>. |
| 4683 | 4741 | <code>f</code> must be a Lua function. |
| 4684 | 4742 | Returns this new coroutine, |
| 4685 | 4743 | an object with type <code>"thread"</code>. |
| 4686 | 4744 | |
| 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> |
| 4688 | 4746 | |
| 4689 | 4747 | <p>Starts or continues the execution of coroutine <code>co</code>. |
| 4690 | 4748 | The first time you resume a coroutine, |
| @@ -4703,12 +4761,12 @@ as the results from the yield. · 12 unmodified lines |
| 4703 | 4761 | If there is any error, |
| 4704 | 4762 | <code>resume</code> returns <b>false</b> plus the error message. |
| 4705 | 4763 | |
| 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> |
| 4707 | 4765 | |
| 4708 | 4766 | <p>Returns the running coroutine, |
| 4709 | 4767 | or <b>nil</b> when called by the main thread. |
| 4710 | 4768 | |
| 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> |
| 4712 | 4770 | |
| 4713 | 4771 | <p>Returns the status of coroutine <code>co</code>, as a string: |
| 4714 | 4772 | <code>"running"</code>, |
| @@ -4720,7 +4778,7 @@ or if it has not started running yet; · 5 unmodified lines |
| 4720 | 4778 | and <code>"dead"</code> if the coroutine has finished its body function, |
| 4721 | 4779 | or if it has stopped with an error. |
| 4722 | 4780 | |
| 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> |
| 4724 | 4782 | |
| 4725 | 4783 | <p>Creates a new coroutine, with body <code>f</code>. |
| 4726 | 4784 | <code>f</code> must be a Lua function. |
| @@ -4731,7 +4789,7 @@ Returns the same values returned by <code>resume</code>, · 4 unmodified lines |
| 4731 | 4789 | except the first boolean. |
| 4732 | 4790 | In case of error, propagates the error. |
| 4733 | 4791 | |
| 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> |
| 4735 | 4793 | |
| 4736 | 4794 | <p>Suspends the execution of the calling coroutine. |
| 4737 | 4795 | 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 |
| 4746 | 4804 | <a href="#pdf-require"><code>require</code></a> and <a href="#pdf-module"><code>module</code></a>. |
| 4747 | 4805 | Everything else is exported in a table <code>package</code>. |
| 4748 | 4806 | |
| 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> |
| 4750 | 4808 | |
| 4751 | 4809 | <p>Creates a module. |
| 4752 | 4810 | 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 |
| 4776 | 4834 | the module name, |
| 4777 | 4835 | where each option is a function to be applied over the module. |
| 4778 | 4836 | |
| 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> |
| 4780 | 4838 | |
| 4781 | 4839 | <p>Loads the given module. |
| 4782 | 4840 | 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 |
| 4830 | 4888 | If the loader returns no value and |
| 4831 | 4889 | has not assigned any value to <code>package.loaded[modname]</code>, |
| 4832 | 4890 | 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 |
| 4834 | 4892 | final value of <code>package.loaded[modname]</code>. |
| 4835 | 4893 | |
| 4836 | 4894 | <p>If there is any error loading or running the module, |
| 4837 | 4895 | or if it cannot find any loader for that module, |
| 4838 | 4896 | then <code>require</code> signals an error. |
| 4839 | 4897 | |
| 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> |
| 4841 | 4899 | |
| 4842 | 4900 | <p>The path used by <a href="#pdf-require"><code>require</code></a> to search for a C loader. |
| 4843 | 4901 | |
| @@ -4846,7 +4904,7 @@ it initializes the Lua path <a href="#pdf-package.path"><code>package.path</code · 2 unmodified lines |
| 4846 | 4904 | using the environment variable <code>LUA_CPATH</code> |
| 4847 | 4905 | (plus another default path defined in <code>luaconf.h</code>). |
| 4848 | 4906 | |
| 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> |
| 4850 | 4908 | |
| 4851 | 4909 | <p>A table used by <a href="#pdf-require"><code>require</code></a> to control which |
| 4852 | 4910 | modules are already loaded. |
| @@ -4854,7 +4912,7 @@ When you require a module <code>modname</code> and · 1 unmodified line |
| 4854 | 4912 | <code>package.loaded[modname]</code> is not false, |
| 4855 | 4913 | <a href="#pdf-require"><code>require</code></a> simply returns the value stored there. |
| 4856 | 4914 | |
| 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> |
| 4858 | 4916 | |
| 4859 | 4917 | <p>Dynamically links the host program with the C library <code>libname</code>. |
| 4860 | 4918 | 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 |
| 4864 | 4922 | <p>This is a low-level function. |
| 4865 | 4923 | It completely bypasses the package and module system. |
| 4866 | 4924 | 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. |
| 4868 | 4927 | <code>libname</code> must be the complete file name of the C library, |
| 4869 | 4928 | including if necessary a path and extension. |
| 4870 | 4929 | <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 |
| 4875 | 4934 | (Windows, Linux, Mac OS X, Solaris, BSD, |
| 4876 | 4935 | plus other Unix systems that support the <code>dlfcn</code> standard). |
| 4877 | 4936 | |
| 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> |
| 4879 | 4938 | |
| 4880 | 4939 | <p>The path used by <a href="#pdf-require"><code>require</code></a> to search for a Lua loader. |
| 4881 | 4940 | |
| @@ -4901,12 +4960,12 @@ will try to load the files · 19 unmodified lines |
| 4901 | 4960 | <code>./foo.lua</code>, <code>./foo.lc</code>, and |
| 4902 | 4961 | <code>/usr/local/foo/init.lua</code>, in that order. |
| 4903 | 4962 | |
| 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> |
| 4905 | 4964 | |
| 4906 | 4965 | <p>A table to store loaders for specific modules |
| 4907 | 4966 | (see <a href="#pdf-require"><code>require</code></a>). |
| 4908 | 4967 | |
| 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> |
| 4910 | 4969 | |
| 4911 | 4970 | <p>Sets a metatable for <code>module</code> with |
| 4912 | 4971 | 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 |
| 4932 | 4991 | For instance, <code>string.byte(s, i)</code> |
| 4933 | 4992 | can be written as <code>s:byte(i)</code>. |
| 4934 | 4993 | |
| 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> |
| 4936 | 4995 | Returns the internal numerical codes of the characters <code>s[i]</code>, |
| 4937 | 4996 | <code>s[i+1]</code>, ..., <code>s[j]</code>. |
| 4938 | 4997 | 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 |
| 4940 | 4999 | |
| 4941 | 5000 | <p>Note that numerical codes are not necessarily portable across platforms. |
| 4942 | 5001 | |
| 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> |
| 4944 | 5003 | Receives 0 or more integers. |
| 4945 | 5004 | Returns a string with length equal to the number of arguments, |
| 4946 | 5005 | in which each character has the internal numerical code equal |
| @@ -4948,14 +5007,14 @@ to its corresponding argument. · 1 unmodified line |
| 4948 | 5007 | |
| 4949 | 5008 | <p>Note that numerical codes are not necessarily portable across platforms. |
| 4950 | 5009 | |
| 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> |
| 4952 | 5011 | |
| 4953 | 5012 | <p>Returns a string containing a binary representation of the given function, |
| 4954 | 5013 | so that a later <a href="#pdf-loadstring"><code>loadstring</code></a> on that string returns |
| 4955 | 5014 | a copy of the function. |
| 4956 | 5015 | <code>function</code> must be a Lua function without upvalues. |
| 4957 | 5016 | |
| 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> |
| 4959 | 5018 | Looks for the first match of |
| 4960 | 5019 | <code>pattern</code> in the string <code>s</code>. |
| 4961 | 5020 | 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 |
| 4975 | 5034 | the captured values are also returned, |
| 4976 | 5035 | after the two indices. |
| 4977 | 5036 | |
| 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> |
| 4979 | 5038 | Returns a formatted version of its variable number of arguments |
| 4980 | 5039 | following the description given in its first argument (which must be a string). |
| 4981 | 5040 | 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 |
| 5008 | 5067 | <p>This function does not accept string values |
| 5009 | 5068 | containing embedded zeros. |
| 5010 | 5069 | |
| 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> |
| 5012 | 5071 | Returns an iterator function that, |
| 5013 | 5072 | each time it is called, |
| 5014 | 5073 | 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 |
| 5035 | 5094 | end |
| 5036 | 5095 | </pre> |
| 5037 | 5096 | |
| 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> |
| 5039 | 5098 | Returns a copy of <code>s</code> |
| 5040 | 5099 | in which all occurrences of the <code>pattern</code> have been |
| 5041 | 5100 | 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 |
| 5061 | 5120 | in order; |
| 5062 | 5121 | if the pattern specifies no captures, |
| 5063 | 5122 | 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. |
| 5067 | 5123 | |
| 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 |
| 5070 | 5125 | is a string or a number, |
| 5071 | 5126 | then it is used as the replacement string; |
| 5072 | 5127 | 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 |
| 5102 | 5157 | --> x="lua-5.1.tar.gz" |
| 5103 | 5158 | </pre> |
| 5104 | 5159 | |
| 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> |
| 5106 | 5161 | Receives a string and returns its length. |
| 5107 | 5162 | The empty string <code>""</code> has length 0. |
| 5108 | 5163 | Embedded zeros are counted, |
| 5109 | 5164 | so <code>"a\000bc\000"</code> has length 5. |
| 5110 | 5165 | |
| 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> |
| 5112 | 5167 | Receives a string and returns a copy of that string with all |
| 5113 | 5168 | uppercase letters changed to lowercase. |
| 5114 | 5169 | All other characters are left unchanged. |
| 5115 | 5170 | The definition of what an uppercase letter is depends on the current locale. |
| 5116 | 5171 | |
| 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> |
| 5118 | 5173 | Looks for the first <em>match</em> of |
| 5119 | 5174 | <code>pattern</code> in the string <code>s</code>. |
| 5120 | 5175 | 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 |
| 5126 | 5181 | where to start the search; |
| 5127 | 5182 | its default value is 1 and may be negative. |
| 5128 | 5183 | |
| 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> |
| 5130 | 5185 | Returns a string that is the concatenation of <code>n</code> copies of |
| 5131 | 5186 | the string <code>s</code>. |
| 5132 | 5187 | |
| 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> |
| 5134 | 5189 | Returns a string that is the string <code>s</code> reversed. |
| 5135 | 5190 | |
| 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> |
| 5137 | 5192 | Returns the substring of <code>s</code> that |
| 5138 | 5193 | starts at <code>i</code> and continues until <code>j</code>; |
| 5139 | 5194 | <code>i</code> and <code>j</code> may be negative. |
| @@ -5145,7 +5200,7 @@ with length <code>j</code>, · 5 unmodified lines |
| 5145 | 5200 | and <code>string.sub(s, -i)</code> returns a suffix of <code>s</code> |
| 5146 | 5201 | with length <code>i</code>. |
| 5147 | 5202 | |
| 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> |
| 5149 | 5204 | Receives a string and returns a copy of that string with all |
| 5150 | 5205 | lowercase letters changed to uppercase. |
| 5151 | 5206 | All other characters are left unchanged. |
| @@ -5279,17 +5334,17 @@ It provides all its functions inside the table <code>table</code>. · 127 unmodified lines |
| 5279 | 5334 | |
| 5280 | 5335 | <p>Most functions in the table library assume that the table |
| 5281 | 5336 | 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 |
| 5283 | 5338 | we mean the result of the length operator. |
| 5284 | 5339 | |
| 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> |
| 5286 | 5341 | Returns <code>table[i]..sep..table[i+1] ... sep..table[j]</code>. |
| 5287 | 5342 | The default value for <code>sep</code> is the empty string, |
| 5288 | 5343 | the default for <code>i</code> is 1, |
| 5289 | 5344 | and the default for <code>j</code> is the length of the table. |
| 5290 | 5345 | If <code>i</code> is greater than <code>j</code>, returns the empty string. |
| 5291 | 5346 | |
| 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> |
| 5293 | 5348 | |
| 5294 | 5349 | <p>Inserts element <code>value</code> at position <code>pos</code> in <code>table</code>, |
| 5295 | 5350 | 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 |
| 5298 | 5353 | so that a call <code>table.insert(t,x)</code> inserts <code>x</code> at the end |
| 5299 | 5354 | of table <code>t</code>. |
| 5300 | 5355 | |
| 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> |
| 5302 | 5357 | |
| 5303 | 5358 | <p>Returns the largest positive numerical index of the given table, |
| 5304 | 5359 | or zero if the table has no positive numerical indices. |
| 5305 | 5360 | (To do its job this function does a linear traversal of |
| 5306 | 5361 | the whole table.) |
| 5307 | 5362 | |
| 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> |
| 5309 | 5364 | |
| 5310 | 5365 | <p>Removes from <code>table</code> the element at position <code>pos</code>, |
| 5311 | 5366 | 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 |
| 5315 | 5370 | so that a call <code>table.remove(t)</code> removes the last element |
| 5316 | 5371 | of table <code>t</code>. |
| 5317 | 5372 | |
| 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> |
| 5319 | 5374 | Sorts table elements in a given order, <em>in-place</em>, |
| 5320 | 5375 | from <code>table[1]</code> to <code>table[n]</code>, |
| 5321 | 5376 | 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 |
| 5336 | 5391 | <p>This library is an interface to the standard C math library. |
| 5337 | 5392 | It provides all its functions inside the table <code>math</code>. |
| 5338 | 5393 | 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> |
| 5346 | 5402 | <pre> |
| 5347 | 5403 | 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 |
| 5349 | 5405 | math.floor math.fmod math.frexp math.ldexp math.log |
| 5350 | 5406 | math.log10 math.max math.min math.modf math.pow |
| 5351 | 5407 | 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 |
| 5413 | 5469 | (plus an error message as a second result) |
| 5414 | 5470 | and some value different from <b>nil</b> on success. |
| 5415 | 5471 | |
| 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> |
| 5417 | 5473 | |
| 5418 | 5474 | <p>Equivalent to <code>file:close()</code>. |
| 5419 | 5475 | Without a <code>file</code>, closes the default output file. |
| 5420 | 5476 | |
| 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> |
| 5422 | 5478 | |
| 5423 | 5479 | <p>Equivalent to <code>file:flush</code> over the default output file. |
| 5424 | 5480 | |
| 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> |
| 5426 | 5482 | |
| 5427 | 5483 | <p>When called with a file name, it opens the named file (in text mode), |
| 5428 | 5484 | and sets its handle as the default input file. |
| @@ -5434,7 +5490,7 @@ it returns the current default input file. · 5 unmodified lines |
| 5434 | 5490 | <p>In case of errors this function raises the error, |
| 5435 | 5491 | instead of returning an error code. |
| 5436 | 5492 | |
| 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> |
| 5438 | 5494 | |
| 5439 | 5495 | <p>Opens the given file name in read mode |
| 5440 | 5496 | and returns an iterator function that, |
| @@ -5453,7 +5509,7 @@ to <code>io.input():lines()</code>; · 12 unmodified lines |
| 5453 | 5509 | that is, it iterates over the lines of the default input file. |
| 5454 | 5510 | In that case it does not close the file when the loop ends. |
| 5455 | 5511 | |
| 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> |
| 5457 | 5513 | |
| 5458 | 5514 | <p>This function opens a file, |
| 5459 | 5515 | 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 |
| 5475 | 5531 | This string is exactly what is used in the |
| 5476 | 5532 | standard C function <code>fopen</code>. |
| 5477 | 5533 | |
| 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> |
| 5479 | 5535 | |
| 5480 | 5536 | <p>Similar to <a href="#pdf-io.input"><code>io.input</code></a>, but operates over the default output file. |
| 5481 | 5537 | |
| 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> |
| 5483 | 5539 | |
| 5484 | 5540 | <p>Starts program <code>prog</code> in a separated process and returns |
| 5485 | 5541 | 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 |
| 5490 | 5546 | <p>This function is system dependent and is not available |
| 5491 | 5547 | on all platforms. |
| 5492 | 5548 | |
| 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> |
| 5494 | 5550 | |
| 5495 | 5551 | <p>Equivalent to <code>io.input():read</code>. |
| 5496 | 5552 | |
| 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> |
| 5498 | 5554 | |
| 5499 | 5555 | <p>Returns a handle for a temporary file. |
| 5500 | 5556 | This file is opened in update mode |
| 5501 | 5557 | and it is automatically removed when the program ends. |
| 5502 | 5558 | |
| 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> |
| 5504 | 5560 | |
| 5505 | 5561 | <p>Checks whether <code>obj</code> is a valid file handle. |
| 5506 | 5562 | Returns the string <code>"file"</code> if <code>obj</code> is an open file handle, |
| 5507 | 5563 | <code>"closed file"</code> if <code>obj</code> is a closed file handle, |
| 5508 | 5564 | and <b>nil</b> if <code>obj</code> is not a file handle. |
| 5509 | 5565 | |
| 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> |
| 5511 | 5567 | |
| 5512 | 5568 | <p>Equivalent to <code>io.output():write</code>. |
| 5513 | 5569 | |
| 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> |
| 5515 | 5571 | |
| 5516 | 5572 | <p>Closes <code>file</code>. |
| 5517 | 5573 | Note that files are automatically closed when |
| 5518 | 5574 | 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. |
| 5520 | 5576 | |
| 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> |
| 5522 | 5578 | |
| 5523 | 5579 | <p>Saves any written data to <code>file</code>. |
| 5524 | 5580 | |
| 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> |
| 5526 | 5582 | |
| 5527 | 5583 | <p>Returns an iterator function that, |
| 5528 | 5584 | each time it is called, |
| @@ -5535,7 +5591,7 @@ will iterate over all lines of the file. · 6 unmodified lines |
| 5535 | 5591 | (Unlike <a href="#pdf-io.lines"><code>io.lines</code></a>, this function does not close the file |
| 5536 | 5592 | when the loop ends.) |
| 5537 | 5593 | |
| 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> |
| 5539 | 5595 | |
| 5540 | 5596 | <p>Reads the file <code>file</code>, |
| 5541 | 5597 | 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 |
| 5562 | 5618 | or <b>nil</b> on end of file. |
| 5563 | 5619 | </ul> |
| 5564 | 5620 | |
| 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> |
| 5566 | 5622 | |
| 5567 | 5623 | <p>Sets and gets the file position, |
| 5568 | 5624 | measured from the beginning of the file, |
| 5569 | 5625 | to the position given by <code>offset</code> plus a base |
| 5570 | 5626 | specified by the string <code>whence</code>, as follows: |
| 5571 | 5627 | <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; |
| 5575 | 5631 | </ul> |
| 5576 | 5632 | In case of success, function <code>seek</code> returns the final file position, |
| 5577 | 5633 | measured in bytes from the beginning of the file. |
| @@ -5587,7 +5643,7 @@ beginning of the file (and returns 0); · 9 unmodified lines |
| 5587 | 5643 | and the call <code>file:seek("end")</code> sets the position to the |
| 5588 | 5644 | end of the file, and returns its size. |
| 5589 | 5645 | |
| 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> |
| 5591 | 5647 | |
| 5592 | 5648 | <p>Sets the buffering mode for an output file. |
| 5593 | 5649 | There are three available modes: |
| @@ -5606,7 +5662,7 @@ For the last two cases, <code>sizes</code> · 12 unmodified lines |
| 5606 | 5662 | specifies the size of the buffer, in bytes. |
| 5607 | 5663 | The default is an appropriate size. |
| 5608 | 5664 | |
| 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> |
| 5610 | 5666 | |
| 5611 | 5667 | <p>Writes the value of each of its arguments to |
| 5612 | 5668 | 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 |
| 5618 | 5674 | |
| 5619 | 5675 | <p>This library is implemented through table <code>os</code>. |
| 5620 | 5676 | |
| 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> |
| 5622 | 5678 | |
| 5623 | 5679 | <p>Returns an approximation of the amount in seconds of CPU time |
| 5624 | 5680 | used by the program. |
| 5625 | 5681 | |
| 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> |
| 5627 | 5683 | |
| 5628 | 5684 | <p>Returns a string or a table containing date and time, |
| 5629 | 5685 | 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 |
| 5653 | 5709 | the host system and on the current locale |
| 5654 | 5710 | (that is, <code>os.date()</code> is equivalent to <code>os.date("%c")</code>). |
| 5655 | 5711 | |
| 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> |
| 5657 | 5713 | |
| 5658 | 5714 | <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, |
| 5660 | 5716 | this value is exactly <code>t2</code><em>-</em><code>t1</code>. |
| 5661 | 5717 | |
| 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> |
| 5663 | 5719 | |
| 5664 | 5720 | <p>This function is equivalent to the C function <code>system</code>. |
| 5665 | 5721 | 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 |
| 5667 | 5723 | If <code>command</code> is absent, then it returns nonzero if a shell is available |
| 5668 | 5724 | and zero otherwise. |
| 5669 | 5725 | |
| 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> |
| 5671 | 5727 | |
| 5672 | 5728 | <p>Calls the C function <code>exit</code>, |
| 5673 | 5729 | with an optional <code>code</code>, |
| 5674 | 5730 | to terminate the host program. |
| 5675 | 5731 | The default value for <code>code</code> is the success code. |
| 5676 | 5732 | |
| 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> |
| 5678 | 5734 | |
| 5679 | 5735 | <p>Returns the value of the process environment variable <code>varname</code>, |
| 5680 | 5736 | or <b>nil</b> if the variable is not defined. |
| 5681 | 5737 | |
| 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> |
| 5683 | 5739 | |
| 5684 | 5740 | <p>Deletes the file or directory with the given name. |
| 5685 | 5741 | Directories must be empty to be removed. |
| 5686 | 5742 | If this function fails, it returns <b>nil</b>, |
| 5687 | 5743 | plus a string describing the error. |
| 5688 | 5744 | |
| 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> |
| 5690 | 5746 | |
| 5691 | 5747 | <p>Renames file or directory named <code>oldname</code> to <code>newname</code>. |
| 5692 | 5748 | If this function fails, it returns <b>nil</b>, |
| 5693 | 5749 | plus a string describing the error. |
| 5694 | 5750 | |
| 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> |
| 5696 | 5752 | |
| 5697 | 5753 | <p>Sets the current locale of the program. |
| 5698 | 5754 | <code>locale</code> is a string specifying a locale; |
| @@ -5703,7 +5759,7 @@ the default category is <code>"all"</code>. · 4 unmodified lines |
| 5703 | 5759 | The function returns the name of the new locale, |
| 5704 | 5760 | or <b>nil</b> if the request cannot be honored. |
| 5705 | 5761 | |
| 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> |
| 5707 | 5763 | |
| 5708 | 5764 | <p>Returns the current time when called without arguments, |
| 5709 | 5765 | 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 |
| 5712 | 5768 | (for a description of these fields, see the <a href="#pdf-os.date"><code>os.date</code></a> function). |
| 5713 | 5769 | |
| 5714 | 5770 | <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 |
| 5716 | 5772 | of seconds since some given start time (the "epoch"). |
| 5717 | 5773 | In other systems, the meaning is not specified, |
| 5718 | 5774 | and the number returned by <code>time</code> can be used only as an argument to |
| 5719 | 5775 | <code>date</code> and <code>difftime</code>. |
| 5720 | 5776 | |
| 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> |
| 5722 | 5778 | |
| 5723 | 5779 | <p>Returns a string with a file name that can |
| 5724 | 5780 | be used for a temporary file. |
| @@ -5745,7 +5801,7 @@ and therefore can compromise otherwise secure code. · 20 unmodified lines |
| 5745 | 5801 | <p>All functions in this library are provided |
| 5746 | 5802 | inside the <code>debug</code> table. |
| 5747 | 5803 | |
| 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> |
| 5749 | 5805 | |
| 5750 | 5806 | <p>Enters an interactive mode with the user, |
| 5751 | 5807 | running each string that the user enters. |
| @@ -5758,17 +5814,17 @@ so that the caller continues its execution. · 6 unmodified lines |
| 5758 | 5814 | <p>Note that commands for <code>debug.debug</code> are not lexically nested |
| 5759 | 5815 | within any function, and so have no direct access to local variables. |
| 5760 | 5816 | |
| 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> |
| 5762 | 5818 | Returns the environment of object <code>o</code>. |
| 5763 | 5819 | |
| 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> |
| 5765 | 5821 | |
| 5766 | 5822 | <p>Returns the current hook settings, as three values: |
| 5767 | 5823 | the current hook function, the current hook mask, |
| 5768 | 5824 | and the current hook count |
| 5769 | 5825 | (as set by the <a href="#pdf-debug.sethook"><code>debug.sethook</code></a> function). |
| 5770 | 5826 | |
| 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> |
| 5772 | 5828 | |
| 5773 | 5829 | <p>Returns a table with information about a function. |
| 5774 | 5830 | 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 |
| 5792 | 5848 | and <code>debug.getinfo(print)</code> returns a table with all available information |
| 5793 | 5849 | about the <a href="#pdf-print"><code>print</code></a> function. |
| 5794 | 5850 | |
| 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> |
| 5796 | 5852 | |
| 5797 | 5853 | <p>This function returns the name and the value of the local variable |
| 5798 | 5854 | 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 |
| 5807 | 5863 | represent internal variables |
| 5808 | 5864 | (loop control variables, temporaries, and C function locals). |
| 5809 | 5865 | |
| 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> |
| 5811 | 5867 | |
| 5812 | 5868 | <p>Returns the metatable of the given <code>object</code> |
| 5813 | 5869 | or <b>nil</b> if it does not have a metatable. |
| 5814 | 5870 | |
| 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> |
| 5816 | 5872 | |
| 5817 | 5873 | <p>Returns the registry table (see <a href="#registry">3.5</a>). |
| 5818 | 5874 | |
| 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> |
| 5820 | 5876 | |
| 5821 | 5877 | <p>This function returns the name and the value of the upvalue |
| 5822 | 5878 | with index <code>up</code> of the function <code>func</code>. |
| 5823 | 5879 | The function returns <b>nil</b> if there is no upvalue with the given index. |
| 5824 | 5880 | |
| 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> |
| 5826 | 5882 | |
| 5827 | 5883 | <p>Sets the environment of the given <code>object</code> to the given <code>table</code>. |
| 5828 | 5884 | |
| 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> |
| 5830 | 5886 | |
| 5831 | 5887 | <p>Sets the given function as a hook. |
| 5832 | 5888 | 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 |
| 5859 | 5915 | In this case, Lua is only simulating the return, |
| 5860 | 5916 | and a call to <code>getinfo</code> will return invalid data. |
| 5861 | 5917 | |
| 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> |
| 5863 | 5919 | |
| 5864 | 5920 | <p>This function assigns the value <code>value</code> to the local variable |
| 5865 | 5921 | 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 |
| 5869 | 5925 | (You can call <code>getinfo</code> to check whether the level is valid.) |
| 5870 | 5926 | Otherwise, it returns the name of the local variable. |
| 5871 | 5927 | |
| 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> |
| 5873 | 5929 | |
| 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> |
| 5875 | 5931 | (which can be <b>nil</b>). |
| 5876 | 5932 | |
| 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> |
| 5878 | 5934 | |
| 5879 | 5935 | <p>This function assigns the value <code>value</code> to the upvalue |
| 5880 | 5936 | 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 |
| 5882 | 5938 | with the given index. |
| 5883 | 5939 | Otherwise, it returns the name of the upvalue. |
| 5884 | 5940 | |
| 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> |
| 5886 | 5942 | |
| 5887 | 5943 | <p>Returns a string with a traceback of the call stack. |
| 5888 | 5944 | An optional <code>message</code> string is appended |
| @@ -5969,7 +6025,7 @@ by issuing a different prompt. · 80 unmodified lines |
| 5969 | 6025 | <p>If the global variable <code>_PROMPT</code> contains a string, |
| 5970 | 6026 | then its value is used as the prompt. |
| 5971 | 6027 | 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 |
| 5973 | 6029 | (issued during incomplete statements). |
| 5974 | 6030 | Therefore, both prompts can be changed directly on the command line. |
| 5975 | 6031 | For instance, |
| @@ -6001,7 +6057,7 @@ then · 25 unmodified lines |
| 6001 | 6057 | </pre> |
| 6002 | 6058 | is a more portable solution.) |
| 6003 | 6059 | |
| 6004 | | −<p><hr /> |
| 6060 | +<p><hr></hr> |
| 6005 | 6061 | |
| 6006 | 6062 | <p><h1>Incompatibilities with the Previous Version</h1> |
| 6007 | 6063 | |
| @@ -6110,7 +6166,7 @@ Function <code>luaL_openlib</code> was replaced by <a href="#luaL_register"><cod · 102 unmodified lines |
| 6110 | 6166 | |
| 6111 | 6167 | |
| 6112 | 6168 | <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, |
| 6114 | 6170 | such as <b>return</b> and <b>break</b> statements |
| 6115 | 6171 | can only appear as the <em>last</em> statement of a block. |
| 6116 | 6172 | |