diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-10-23 17:16:17 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-10-23 17:16:17 -0300 |
| commit | e3ce88c9e850b7e79751083014699c5eae1bff31 (patch) | |
| tree | e73392a16c560ed532ef2238132f0e58d2eb23b3 /manual | |
| parent | 5ffcd458f001fce02e5f20a6130e145c6a3caf53 (diff) | |
| download | lua-e3ce88c9e850b7e79751083014699c5eae1bff31.tar.gz lua-e3ce88c9e850b7e79751083014699c5eae1bff31.tar.bz2 lua-e3ce88c9e850b7e79751083014699c5eae1bff31.zip | |
New function 'lua_numbertostrbuff'
It converts a Lua number to a string in a buffer, without creating
a new Lua string.
Diffstat (limited to 'manual')
| -rw-r--r-- | manual/manual.of | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/manual/manual.of b/manual/manual.of index 6947b2a0..f0b17b4c 100644 --- a/manual/manual.of +++ b/manual/manual.of | |||
| @@ -675,7 +675,7 @@ approximately @M{n} bytes between steps. | |||
| 675 | The garbage-collector step multiplier | 675 | The garbage-collector step multiplier |
| 676 | controls how much work each incremental step does. | 676 | controls how much work each incremental step does. |
| 677 | A value of @M{n} means the interpreter will execute | 677 | A value of @M{n} means the interpreter will execute |
| 678 | @M{n%} @emphx{units of work} for each byte allocated. | 678 | @M{n%} @emphx{units of work} for each word allocated. |
| 679 | A unit of work corresponds roughly to traversing one slot | 679 | A unit of work corresponds roughly to traversing one slot |
| 680 | or sweeping one object. | 680 | or sweeping one object. |
| 681 | Larger values make the collector more aggressive. | 681 | Larger values make the collector more aggressive. |
| @@ -3829,11 +3829,26 @@ This macro may evaluate its arguments more than once. | |||
| 3829 | 3829 | ||
| 3830 | } | 3830 | } |
| 3831 | 3831 | ||
| 3832 | @APIEntry{unsigned (lua_numbertostrbuff) (lua_State *L, int idx, | ||
| 3833 | char *buff);| | ||
| 3834 | @apii{0,0,-} | ||
| 3835 | |||
| 3836 | Converts the number at acceptable index @id{idx} to a string | ||
| 3837 | and puts the result in @id{buff}. | ||
| 3838 | The buffer must have a size of at least @Lid{LUA_N2SBUFFSZ} bytes. | ||
| 3839 | The conversion follows a non-specified format @see{coercion}. | ||
| 3840 | The function returns the number of bytes written to the buffer | ||
| 3841 | (including the final zero), | ||
| 3842 | or zero if the value at @id{idx} is not a number. | ||
| 3843 | |||
| 3844 | } | ||
| 3845 | |||
| 3832 | @APIEntry{int lua_pcall (lua_State *L, int nargs, int nresults, int msgh);| | 3846 | @APIEntry{int lua_pcall (lua_State *L, int nargs, int nresults, int msgh);| |
| 3833 | @apii{nargs + 1,nresults|1,-} | 3847 | @apii{nargs + 1,nresults|1,-} |
| 3834 | 3848 | ||
| 3835 | Calls a function (or a callable object) in protected mode. | 3849 | Calls a function (or a callable object) in protected mode. |
| 3836 | 3850 | ||
| 3851 | |||
| 3837 | Both @id{nargs} and @id{nresults} have the same meaning as | 3852 | Both @id{nargs} and @id{nresults} have the same meaning as |
| 3838 | in @Lid{lua_call}. | 3853 | in @Lid{lua_call}. |
| 3839 | If there are no errors during the call, | 3854 | If there are no errors during the call, |
