From 05afee0f50f64b64dbb4c0614ccf737ffdc06ab6 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 29 Oct 2014 14:12:30 -0200 Subject: 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) --- lauxlib.h | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'lauxlib.h') diff --git a/lauxlib.h b/lauxlib.h index f4b04974..27ef3b9b 100644 --- a/lauxlib.h +++ b/lauxlib.h @@ -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 -- cgit v1.2.3-55-g6feb