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.
This commit is contained in:
14
lua.h
14
lua.h
@@ -126,6 +126,13 @@ typedef int (*lua_Writer) (lua_State *L, const void *p, size_t sz, void *ud);
|
||||
typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize);
|
||||
|
||||
|
||||
/*
|
||||
** Type for warning functions
|
||||
*/
|
||||
typedef void (*lua_WarnFunction) (void **pud, const char *msg);
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** generic extra include file
|
||||
@@ -299,6 +306,13 @@ LUA_API int (lua_isyieldable) (lua_State *L);
|
||||
#define lua_yield(L,n) lua_yieldk(L, (n), 0, NULL)
|
||||
|
||||
|
||||
/*
|
||||
** Warning-related functions
|
||||
*/
|
||||
LUA_API void (lua_setwarnf) (lua_State *L, lua_WarnFunction f, void *ud);
|
||||
LUA_API void (lua_warning) (lua_State *L, const char *msg);
|
||||
|
||||
|
||||
/*
|
||||
** garbage-collection function and options
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user