diff options
Diffstat (limited to 'manual')
-rw-r--r-- | manual/manual.of | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/manual/manual.of b/manual/manual.of index a441cea1..bb95148a 100644 --- a/manual/manual.of +++ b/manual/manual.of | |||
@@ -1428,7 +1428,7 @@ except inside nested functions. | |||
1428 | A goto can jump to any visible label as long as it does not | 1428 | A goto can jump to any visible label as long as it does not |
1429 | enter into the scope of a local variable. | 1429 | enter into the scope of a local variable. |
1430 | A label should not be declared | 1430 | A label should not be declared |
1431 | where a label with the same name is visible, | 1431 | where a previous label with the same name is visible, |
1432 | even if this other label has been declared in an enclosing block. | 1432 | even if this other label has been declared in an enclosing block. |
1433 | 1433 | ||
1434 | The @Rw{break} statement terminates the execution of a | 1434 | The @Rw{break} statement terminates the execution of a |
@@ -3835,7 +3835,7 @@ This macro may evaluate its arguments more than once. | |||
3835 | 3835 | ||
3836 | Converts the number at acceptable index @id{idx} to a string | 3836 | Converts the number at acceptable index @id{idx} to a string |
3837 | and puts the result in @id{buff}. | 3837 | and puts the result in @id{buff}. |
3838 | The buffer must have a size of at least @Lid{LUA_N2SBUFFSZ} bytes. | 3838 | The buffer must have a size of at least @defid{LUA_N2SBUFFSZ} bytes. |
3839 | The conversion follows a non-specified format @see{coercion}. | 3839 | The conversion follows a non-specified format @see{coercion}. |
3840 | The function returns the number of bytes written to the buffer | 3840 | The function returns the number of bytes written to the buffer |
3841 | (including the final zero), | 3841 | (including the final zero), |
@@ -3997,25 +3997,22 @@ Lua will call @id{falloc} before raising the error. | |||
3997 | 3997 | ||
3998 | Pushes onto the stack a formatted string | 3998 | Pushes onto the stack a formatted string |
3999 | and returns a pointer to this string @see{constchar}. | 3999 | and returns a pointer to this string @see{constchar}. |
4000 | It is similar to the @ANSI{sprintf}, | 4000 | The result is a copy of @id{fmt} with |
4001 | but has two important differences. | 4001 | each @emph{conversion specifier} replaced by its respective |
4002 | First, | 4002 | extra argument. |
4003 | you do not have to allocate space for the result; | 4003 | A conversion specifier can be |
4004 | the result is a Lua string and Lua takes care of memory allocation | ||
4005 | (and deallocation, through garbage collection). | ||
4006 | Second, | ||
4007 | the conversion specifiers are quite restricted. | ||
4008 | There are no flags, widths, or precisions. | ||
4009 | The conversion specifiers can only be | ||
4010 | @Char{%%} (inserts the character @Char{%}), | 4004 | @Char{%%} (inserts the character @Char{%}), |
4011 | @Char{%s} (inserts a zero-terminated string, with no size restrictions), | 4005 | @Char{%s} (inserts a zero-terminated string, with no size restrictions), |
4012 | @Char{%f} (inserts a @Lid{lua_Number}), | 4006 | @Char{%f} (inserts a @Lid{lua_Number}), |
4013 | @Char{%I} (inserts a @Lid{lua_Integer}), | 4007 | @Char{%I} (inserts a @Lid{lua_Integer}), |
4014 | @Char{%p} (inserts a pointer), | 4008 | @Char{%p} (inserts a void pointer), |
4015 | @Char{%d} (inserts an @T{int}), | 4009 | @Char{%d} (inserts an @T{int}), |
4016 | @Char{%c} (inserts an @T{int} as a one-byte character), and | 4010 | @Char{%c} (inserts an @T{int} as a one-byte character), and |
4017 | @Char{%U} (inserts an @T{unsigned long} as a @x{UTF-8} byte sequence). | 4011 | @Char{%U} (inserts an @T{unsigned long} as a @x{UTF-8} byte sequence). |
4018 | 4012 | ||
4013 | Every occurrence of @Char{%} in the string @id{fmt} | ||
4014 | must form a valid conversion specifier. | ||
4015 | |||
4019 | } | 4016 | } |
4020 | 4017 | ||
4021 | @APIEntry{void lua_pushglobaltable (lua_State *L);| | 4018 | @APIEntry{void lua_pushglobaltable (lua_State *L);| |
@@ -4413,7 +4410,7 @@ for the @Q{newindex} event @see{metatable}. | |||
4413 | @APIEntry{void lua_settop (lua_State *L, int index);| | 4410 | @APIEntry{void lua_settop (lua_State *L, int index);| |
4414 | @apii{?,?,e} | 4411 | @apii{?,?,e} |
4415 | 4412 | ||
4416 | Accepts any index, @N{or 0}, | 4413 | Receives any acceptable stack index, @N{or 0}, |
4417 | and sets the stack top to this index. | 4414 | and sets the stack top to this index. |
4418 | If the new top is greater than the old one, | 4415 | If the new top is greater than the old one, |
4419 | then the new elements are filled with @nil. | 4416 | then the new elements are filled with @nil. |
@@ -9428,6 +9425,15 @@ Moreover, there were some changes in the parameters themselves. | |||
9428 | @itemize{ | 9425 | @itemize{ |
9429 | 9426 | ||
9430 | @item{ | 9427 | @item{ |
9428 | In @Lid{lua_call} and related functions, | ||
9429 | the maximum value for the number of required results | ||
9430 | (@id{nresults}) is 250. | ||
9431 | If you really need a larger value, | ||
9432 | use @Lid{LUA_MULTRET} and then adjust the stack size. | ||
9433 | Previously, this limit was unspecified. | ||
9434 | } | ||
9435 | |||
9436 | @item{ | ||
9431 | @Lid{lua_newstate} has a third parameter, | 9437 | @Lid{lua_newstate} has a third parameter, |
9432 | a seed for the hashing of strings. | 9438 | a seed for the hashing of strings. |
9433 | } | 9439 | } |