diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-12-28 15:42:34 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-12-28 15:42:34 -0200 |
| commit | 437a5b07d415e1a74160ddfd804017171d6cc5cb (patch) | |
| tree | 861f9a56ae175eaed91c163409c33ab85bee7ff9 /lua.h | |
| parent | ba7da13ec5938f978c37d63aa40a3e340b301f79 (diff) | |
| download | lua-437a5b07d415e1a74160ddfd804017171d6cc5cb.tar.gz lua-437a5b07d415e1a74160ddfd804017171d6cc5cb.tar.bz2 lua-437a5b07d415e1a74160ddfd804017171d6cc5cb.zip | |
Added a warning system to Lua
The warning system is just a way for Lua to emit warnings, messages
to the programmer that do not interfere with the running program.
Diffstat (limited to 'lua.h')
| -rw-r--r-- | lua.h | 14 |
1 files changed, 14 insertions, 0 deletions
| @@ -126,6 +126,13 @@ typedef int (*lua_Writer) (lua_State *L, const void *p, size_t sz, void *ud); | |||
| 126 | typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); | 126 | typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); |
| 127 | 127 | ||
| 128 | 128 | ||
| 129 | /* | ||
| 130 | ** Type for warning functions | ||
| 131 | */ | ||
| 132 | typedef void (*lua_WarnFunction) (void **pud, const char *msg); | ||
| 133 | |||
| 134 | |||
| 135 | |||
| 129 | 136 | ||
| 130 | /* | 137 | /* |
| 131 | ** generic extra include file | 138 | ** generic extra include file |
| @@ -300,6 +307,13 @@ LUA_API int (lua_isyieldable) (lua_State *L); | |||
| 300 | 307 | ||
| 301 | 308 | ||
| 302 | /* | 309 | /* |
| 310 | ** Warning-related functions | ||
| 311 | */ | ||
| 312 | LUA_API void (lua_setwarnf) (lua_State *L, lua_WarnFunction f, void *ud); | ||
| 313 | LUA_API void (lua_warning) (lua_State *L, const char *msg); | ||
| 314 | |||
| 315 | |||
| 316 | /* | ||
| 303 | ** garbage-collection function and options | 317 | ** garbage-collection function and options |
| 304 | */ | 318 | */ |
| 305 | 319 | ||
