From b56d4e570a60a8e84df8288c3122eb5bb5c20af6 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy <roberto@inf.puc-rio.br> Date: Thu, 14 Mar 2019 15:30:54 -0300 Subject: 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. --- manual/manual.of | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'manual') 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. Sets the @x{warning function} to be used by Lua to emit warnings @see{lua_WarnFunction}. -The @id{ud} parameter initializes the slot @id{pud} passed to +The @id{ud} parameter sets the value @id{ud} passed to the warning function. } @@ -4325,25 +4325,24 @@ Returns the version number of this core. } @APIEntry{ -typedef void (*lua_WarnFunction) (void **pud, const char *msg);| +typedef void (*lua_WarnFunction) (void *ud, const char *msg, int tocont);| The type of @x{warning function}s, called by Lua to emit warnings. -The first parameter is the address of a writable slot, -constant for a given Lua state and -initialized by @Lid{lua_setwarnf}. +The first parameter is an opaque pointer +set by @Lid{lua_setwarnf}. The second parameter is the warning message. -This function should assume that -a message not ending with an end-of-line will be -continued by the message in the next call. +The third parameter is a boolean that +indicates whether the message is +to be continued by the message in the next call. } @APIEntry{ -void lua_warning (lua_State *L, const char *msg);| +void lua_warning (lua_State *L, const char *msg, int tocont);| @apii{0,0,-} Emits a warning with the given message. -A message not ending with an end-of-line should be +A message in a call with @id{tocont} true should be continued in another call to this function. } @@ -6275,11 +6274,12 @@ The current value of this variable is @St{Lua 5.4}. } -@LibEntry{warn (message)| +@LibEntry{warn (message [, tocont])| Emits a warning with the given message. -Note that messages not ending with an end-of-line -are assumed to be continued by the message in the next call. +A message in a call with @id{tocont} true should be +continued in another call to this function. +The default for @id{tocont} is false. } -- cgit v1.2.3-55-g6feb