summaryrefslogtreecommitdiff
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-github-b56d4e570a60a8e84df8288c3122eb5bb5c20af6.tar.gz
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.
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.
}