definitions for 'luai_writestring'/'luai_writeline'/'luai_writestringerror'

moved to 'lauxlib.h' (they do not need to be stable or configurable) +
prefixes changed from 'luai_' to 'lua_' (they are not part of the core)
This commit is contained in:
Roberto Ierusalimschy
2014-10-29 14:12:30 -02:00
parent 351a446ec5
commit 05afee0f50
5 changed files with 46 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lauxlib.h,v 1.126 2014/10/01 11:54:56 roberto Exp roberto $
** $Id: lauxlib.h,v 1.127 2014/10/25 11:50:46 roberto Exp roberto $
** Auxiliary functions for building Lua libraries
** See Copyright Notice in lua.h
*/
@@ -204,6 +204,31 @@ LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname,
#endif
/*
** {==================================================================
** "Abstraction Layer" for basic report of messages and errors
** ===================================================================
*/
/* print a string */
#if !defined(lua_writestring)
#define lua_writestring(s,l) fwrite((s), sizeof(char), (l), stdout)
#endif
/* print a newline and flush the output */
#if !defined(lua_writeline)
#define lua_writeline() (lua_writestring("\n", 1), fflush(stdout))
#endif
/* print an error message */
#if !defined(lua_writestringerror)
#define lua_writestringerror(s,p) \
(fprintf(stderr, (s), (p)), fflush(stderr))
#endif
/* }================================================================== */
/*
** {============================================================
** Compatibility with deprecated conversions