mirror of
https://github.com/lua/lua.git
synced 2025-07-04 07:03:24 +00:00
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:
parent
351a446ec5
commit
05afee0f50
5 changed files with 46 additions and 21 deletions
20
lua.c
20
lua.c
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
** $Id: lua.c,v 1.216 2014/10/20 18:19:26 roberto Exp roberto $
|
||||
** $Id: lua.c,v 1.217 2014/10/20 22:21:05 roberto Exp roberto $
|
||||
** Lua stand-alone interpreter
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
@ -126,12 +126,12 @@ static void laction (int i) {
|
|||
|
||||
|
||||
static void print_usage (const char *badoption) {
|
||||
luai_writestringerror("%s: ", progname);
|
||||
lua_writestringerror("%s: ", progname);
|
||||
if (badoption[1] == 'e' || badoption[1] == 'l')
|
||||
luai_writestringerror("'%s' needs argument\n", badoption);
|
||||
lua_writestringerror("'%s' needs argument\n", badoption);
|
||||
else
|
||||
luai_writestringerror("unrecognized option '%s'\n", badoption);
|
||||
luai_writestringerror(
|
||||
lua_writestringerror("unrecognized option '%s'\n", badoption);
|
||||
lua_writestringerror(
|
||||
"usage: %s [options] [script [args]]\n"
|
||||
"Available options are:\n"
|
||||
" -e stat execute string 'stat'\n"
|
||||
|
@ -151,8 +151,8 @@ static void print_usage (const char *badoption) {
|
|||
** (if present)
|
||||
*/
|
||||
static void l_message (const char *pname, const char *msg) {
|
||||
if (pname) luai_writestringerror("%s: ", pname);
|
||||
luai_writestringerror("%s\n", msg);
|
||||
if (pname) lua_writestringerror("%s: ", pname);
|
||||
lua_writestringerror("%s\n", msg);
|
||||
}
|
||||
|
||||
|
||||
|
@ -208,8 +208,8 @@ static int docall (lua_State *L, int narg, int nres) {
|
|||
|
||||
|
||||
static void print_version (void) {
|
||||
luai_writestring(LUA_COPYRIGHT, strlen(LUA_COPYRIGHT));
|
||||
luai_writeline();
|
||||
lua_writestring(LUA_COPYRIGHT, strlen(LUA_COPYRIGHT));
|
||||
lua_writeline();
|
||||
}
|
||||
|
||||
|
||||
|
@ -410,7 +410,7 @@ static void doREPL (lua_State *L) {
|
|||
else report(L, status);
|
||||
}
|
||||
lua_settop(L, 0); /* clear stack */
|
||||
luai_writeline();
|
||||
lua_writeline();
|
||||
progname = oldprogname;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue