diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-16 15:39:46 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-16 15:39:46 -0300 |
commit | 955def034814e96f5f8e42def2e47ca6817ef103 (patch) | |
tree | d8eea96980860d1d1e5005ee6ecedb47fa64d594 /lbaselib.c | |
parent | 9c3b3f82fe1b0942183ddeef2e16d60bab4f4c06 (diff) | |
download | lua-955def034814e96f5f8e42def2e47ca6817ef103.tar.gz lua-955def034814e96f5f8e42def2e47ca6817ef103.tar.bz2 lua-955def034814e96f5f8e42def2e47ca6817ef103.zip |
new names for string formating functions
Diffstat (limited to 'lbaselib.c')
-rw-r--r-- | lbaselib.c | 25 |
1 files changed, 1 insertions, 24 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbaselib.c,v 1.72 2002/05/06 19:05:10 roberto Exp roberto $ | 2 | ** $Id: lbaselib.c,v 1.73 2002/05/13 13:10:58 roberto Exp roberto $ |
3 | ** Basic library | 3 | ** Basic library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -32,28 +32,6 @@ static int luaB__ALERT (lua_State *L) { | |||
32 | 32 | ||
33 | 33 | ||
34 | /* | 34 | /* |
35 | ** Basic implementation of _ERRORMESSAGE. | ||
36 | ** The library `liolib' redefines _ERRORMESSAGE for better error information. | ||
37 | */ | ||
38 | static int luaB__ERRORMESSAGE (lua_State *L) { | ||
39 | lua_Debug ar; | ||
40 | luaL_check_type(L, 1, LUA_TSTRING); | ||
41 | lua_pushliteral(L, "error: "); | ||
42 | lua_pushvalue(L, 1); | ||
43 | if (lua_getstack(L, 1, &ar)) { | ||
44 | lua_getinfo(L, "Sl", &ar); | ||
45 | if (ar.source && ar.currentline > 0) { | ||
46 | luaL_vstr(L, "\n <%s: line %d>", ar.short_src, ar.currentline); | ||
47 | lua_concat(L, 2); | ||
48 | } | ||
49 | } | ||
50 | lua_pushliteral(L, "\n"); | ||
51 | lua_concat(L, 3); | ||
52 | return 1; | ||
53 | } | ||
54 | |||
55 | |||
56 | /* | ||
57 | ** If your system does not support `stdout', you can just remove this function. | 35 | ** If your system does not support `stdout', you can just remove this function. |
58 | ** If you need, you can define your own `print' function, following this | 36 | ** If you need, you can define your own `print' function, following this |
59 | ** model but changing `fputs' to put the strings at a proper place | 37 | ** model but changing `fputs' to put the strings at a proper place |
@@ -408,7 +386,6 @@ static int luaB_require (lua_State *L) { | |||
408 | 386 | ||
409 | static const luaL_reg base_funcs[] = { | 387 | static const luaL_reg base_funcs[] = { |
410 | {LUA_ALERT, luaB__ALERT}, | 388 | {LUA_ALERT, luaB__ALERT}, |
411 | {"_ERRORMESSAGE", luaB__ERRORMESSAGE}, | ||
412 | {"error", luaB_error}, | 389 | {"error", luaB_error}, |
413 | {"metatable", luaB_metatable}, | 390 | {"metatable", luaB_metatable}, |
414 | {"globals", luaB_globals}, | 391 | {"globals", luaB_globals}, |