aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-03-14 15:30:54 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-03-14 15:30:54 -0300
commitb56d4e570a60a8e84df8288c3122eb5bb5c20af6 (patch)
treed5597a7865712fc407adbb41fe0749e728617ca7 /manual
parent9eca305e75010e30342486a4139846faf1b3eccb (diff)
downloadlua-b56d4e570a60a8e84df8288c3122eb5bb5c20af6.tar.gz
lua-b56d4e570a60a8e84df8288c3122eb5bb5c20af6.tar.bz2
lua-b56d4e570a60a8e84df8288c3122eb5bb5c20af6.zip
Changes in the warning system
- The warning functions get an extra parameter that tells whether message is to be continued (instead of using end-of-lines as a signal). - The user data for the warning function is a regular value, instead of a writable slot inside the Lua state.
Diffstat (limited to 'manual')
-rw-r--r--manual/manual.of26
1 files changed, 13 insertions, 13 deletions
diff --git a/manual/manual.of b/manual/manual.of
index b47fd865..63e78f95 100644
--- a/manual/manual.of
+++ b/manual/manual.of
@@ -4061,7 +4061,7 @@ If @id{index} @N{is 0}, then all stack elements are removed.
4061 4061
4062Sets the @x{warning function} to be used by Lua to emit warnings 4062Sets the @x{warning function} to be used by Lua to emit warnings
4063@see{lua_WarnFunction}. 4063@see{lua_WarnFunction}.
4064The @id{ud} parameter initializes the slot @id{pud} passed to 4064The @id{ud} parameter sets the value @id{ud} passed to
4065the warning function. 4065the warning function.
4066 4066
4067} 4067}
@@ -4325,25 +4325,24 @@ Returns the version number of this core.
4325} 4325}
4326 4326
4327@APIEntry{ 4327@APIEntry{
4328typedef void (*lua_WarnFunction) (void **pud, const char *msg);| 4328typedef void (*lua_WarnFunction) (void *ud, const char *msg, int tocont);|
4329 4329
4330The type of @x{warning function}s, called by Lua to emit warnings. 4330The type of @x{warning function}s, called by Lua to emit warnings.
4331The first parameter is the address of a writable slot, 4331The first parameter is an opaque pointer
4332constant for a given Lua state and 4332set by @Lid{lua_setwarnf}.
4333initialized by @Lid{lua_setwarnf}.
4334The second parameter is the warning message. 4333The second parameter is the warning message.
4335This function should assume that 4334The third parameter is a boolean that
4336a message not ending with an end-of-line will be 4335indicates whether the message is
4337continued by the message in the next call. 4336to be continued by the message in the next call.
4338 4337
4339} 4338}
4340 4339
4341@APIEntry{ 4340@APIEntry{
4342void lua_warning (lua_State *L, const char *msg);| 4341void lua_warning (lua_State *L, const char *msg, int tocont);|
4343@apii{0,0,-} 4342@apii{0,0,-}
4344 4343
4345Emits a warning with the given message. 4344Emits a warning with the given message.
4346A message not ending with an end-of-line should be 4345A message in a call with @id{tocont} true should be
4347continued in another call to this function. 4346continued in another call to this function.
4348 4347
4349} 4348}
@@ -6275,11 +6274,12 @@ The current value of this variable is @St{Lua 5.4}.
6275 6274
6276} 6275}
6277 6276
6278@LibEntry{warn (message)| 6277@LibEntry{warn (message [, tocont])|
6279 6278
6280Emits a warning with the given message. 6279Emits a warning with the given message.
6281Note that messages not ending with an end-of-line 6280A message in a call with @id{tocont} true should be
6282are assumed to be continued by the message in the next call. 6281continued in another call to this function.
6282The default for @id{tocont} is false.
6283 6283
6284} 6284}
6285 6285