diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-29 14:12:30 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-29 14:12:30 -0200 |
| commit | 05afee0f50f64b64dbb4c0614ccf737ffdc06ab6 (patch) | |
| tree | 76ddccce1152f3bb51ef80b801f6df4bf47c1525 /lauxlib.h | |
| parent | 351a446ec55d0e4a7520791cc4b6ff6097739e18 (diff) | |
| download | lua-05afee0f50f64b64dbb4c0614ccf737ffdc06ab6.tar.gz lua-05afee0f50f64b64dbb4c0614ccf737ffdc06ab6.tar.bz2 lua-05afee0f50f64b64dbb4c0614ccf737ffdc06ab6.zip | |
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)
Diffstat (limited to 'lauxlib.h')
| -rw-r--r-- | lauxlib.h | 27 |
1 files changed, 26 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lauxlib.h,v 1.126 2014/10/01 11:54:56 roberto Exp roberto $ | 2 | ** $Id: lauxlib.h,v 1.127 2014/10/25 11:50:46 roberto Exp roberto $ |
| 3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -205,6 +205,31 @@ LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname, | |||
| 205 | 205 | ||
| 206 | 206 | ||
| 207 | /* | 207 | /* |
| 208 | ** {================================================================== | ||
| 209 | ** "Abstraction Layer" for basic report of messages and errors | ||
| 210 | ** =================================================================== | ||
| 211 | */ | ||
| 212 | |||
| 213 | /* print a string */ | ||
| 214 | #if !defined(lua_writestring) | ||
| 215 | #define lua_writestring(s,l) fwrite((s), sizeof(char), (l), stdout) | ||
| 216 | #endif | ||
| 217 | |||
| 218 | /* print a newline and flush the output */ | ||
| 219 | #if !defined(lua_writeline) | ||
| 220 | #define lua_writeline() (lua_writestring("\n", 1), fflush(stdout)) | ||
| 221 | #endif | ||
| 222 | |||
| 223 | /* print an error message */ | ||
| 224 | #if !defined(lua_writestringerror) | ||
| 225 | #define lua_writestringerror(s,p) \ | ||
| 226 | (fprintf(stderr, (s), (p)), fflush(stderr)) | ||
| 227 | #endif | ||
| 228 | |||
| 229 | /* }================================================================== */ | ||
| 230 | |||
| 231 | |||
| 232 | /* | ||
| 208 | ** {============================================================ | 233 | ** {============================================================ |
| 209 | ** Compatibility with deprecated conversions | 234 | ** Compatibility with deprecated conversions |
| 210 | ** ============================================================= | 235 | ** ============================================================= |
