details for wchar

This commit is contained in:
Roberto Ierusalimschy 2001-02-23 14:28:12 -03:00
parent 39b7978329
commit 35023355f2
8 changed files with 30 additions and 26 deletions

6
lapi.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lapi.c,v 1.132 2001/02/22 18:59:59 roberto Exp roberto $ ** $Id: lapi.c,v 1.133 2001/02/23 17:17:25 roberto Exp roberto $
** Lua API ** Lua API
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -22,8 +22,8 @@
#include "lvm.h" #include "lvm.h"
const l_char lua_ident[] = l_s("$Lua: ") l_s(LUA_VERSION) l_s(" ") const l_char lua_ident[] = l_s("$Lua: ") LUA_VERSION l_s(" ")
l_s(LUA_COPYRIGHT) l_s(" $\n") l_s("$Authors: ") l_s(LUA_AUTHORS) l_s(" $"); LUA_COPYRIGHT l_s(" $\n") l_s("$Authors: ") LUA_AUTHORS l_s(" $");

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lbaselib.c,v 1.26 2001/02/22 18:59:59 roberto Exp roberto $ ** $Id: lbaselib.c,v 1.27 2001/02/23 17:17:25 roberto Exp roberto $
** Basic library ** Basic library
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -35,7 +35,7 @@ static int luaB__ALERT (lua_State *L) {
*/ */
static int luaB__ERRORMESSAGE (lua_State *L) { static int luaB__ERRORMESSAGE (lua_State *L) {
luaL_checktype(L, 1, LUA_TSTRING); luaL_checktype(L, 1, LUA_TSTRING);
lua_getglobal(L, l_s(LUA_ALERT)); lua_getglobal(L, LUA_ALERT);
if (lua_isfunction(L, -1)) { /* avoid error loop if _ALERT is not defined */ if (lua_isfunction(L, -1)) { /* avoid error loop if _ALERT is not defined */
lua_Debug ar; lua_Debug ar;
lua_pushliteral(L, l_s("error: ")); lua_pushliteral(L, l_s("error: "));
@ -305,10 +305,10 @@ static int luaB_call (lua_State *L) {
luaL_checktype(L, 2, LUA_TTABLE); luaL_checktype(L, 2, LUA_TTABLE);
n = lua_getn(L, 2); n = lua_getn(L, 2);
if (!lua_isnull(L, 4)) { /* set new error method */ if (!lua_isnull(L, 4)) { /* set new error method */
lua_getglobal(L, l_s(LUA_ERRORMESSAGE)); lua_getglobal(L, LUA_ERRORMESSAGE);
err = lua_gettop(L); /* get index */ err = lua_gettop(L); /* get index */
lua_pushvalue(L, 4); lua_pushvalue(L, 4);
lua_setglobal(L, l_s(LUA_ERRORMESSAGE)); lua_setglobal(L, LUA_ERRORMESSAGE);
} }
oldtop = lua_gettop(L); /* top before function-call preparation */ oldtop = lua_gettop(L); /* top before function-call preparation */
/* push function */ /* push function */
@ -319,7 +319,7 @@ static int luaB_call (lua_State *L) {
status = lua_call(L, n, LUA_MULTRET); status = lua_call(L, n, LUA_MULTRET);
if (err != 0) { /* restore old error method */ if (err != 0) { /* restore old error method */
lua_pushvalue(L, err); lua_pushvalue(L, err);
lua_setglobal(L, l_s(LUA_ERRORMESSAGE)); lua_setglobal(L, LUA_ERRORMESSAGE);
} }
if (status != 0) { /* error in call? */ if (status != 0) { /* error in call? */
if (strchr(options, l_c('x'))) if (strchr(options, l_c('x')))
@ -637,8 +637,8 @@ static void deprecated_funcs (lua_State *L) {
/* }====================================================== */ /* }====================================================== */
static const luaL_reg base_funcs[] = { static const luaL_reg base_funcs[] = {
{l_s(LUA_ALERT), luaB__ALERT}, {LUA_ALERT, luaB__ALERT},
{l_s(LUA_ERRORMESSAGE), luaB__ERRORMESSAGE}, {LUA_ERRORMESSAGE, luaB__ERRORMESSAGE},
{l_s("call"), luaB_call}, {l_s("call"), luaB_call},
{l_s("collectgarbage"), luaB_collectgarbage}, {l_s("collectgarbage"), luaB_collectgarbage},
{l_s("copytagmethods"), luaB_copytagmethods}, {l_s("copytagmethods"), luaB_copytagmethods},
@ -678,7 +678,7 @@ static const luaL_reg base_funcs[] = {
LUALIB_API void lua_baselibopen (lua_State *L) { LUALIB_API void lua_baselibopen (lua_State *L) {
luaL_openl(L, base_funcs); luaL_openl(L, base_funcs);
lua_pushliteral(L, l_s(LUA_VERSION)); lua_pushliteral(L, LUA_VERSION);
lua_setglobal(L, l_s("_VERSION")); lua_setglobal(L, l_s("_VERSION"));
deprecated_funcs(L); deprecated_funcs(L);
} }

4
ldo.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: ldo.c,v 1.127 2001/02/23 13:38:56 roberto Exp roberto $ ** $Id: ldo.c,v 1.128 2001/02/23 17:17:25 roberto Exp roberto $
** Stack and Call structure of Lua ** Stack and Call structure of Lua
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -335,7 +335,7 @@ struct lua_longjmp {
static void message (lua_State *L, const l_char *s) { static void message (lua_State *L, const l_char *s) {
luaV_getglobal(L, luaS_newliteral(L, l_s(LUA_ERRORMESSAGE)), L->top); luaV_getglobal(L, luaS_newliteral(L, LUA_ERRORMESSAGE), L->top);
if (ttype(L->top) == LUA_TFUNCTION) { if (ttype(L->top) == LUA_TFUNCTION) {
incr_top; incr_top;
setsvalue(L->top, luaS_new(L, s)); setsvalue(L->top, luaS_new(L, s));

View File

@ -1,5 +1,5 @@
/* /*
** $Id: liolib.c,v 1.107 2001/02/22 17:15:18 roberto Exp roberto $ ** $Id: liolib.c,v 1.108 2001/02/23 17:17:25 roberto Exp roberto $
** Standard I/O (and system) library ** Standard I/O (and system) library
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -638,7 +638,7 @@ static int errorfb (lua_State *L) {
luaL_addstring(&b, l_s("\n")); luaL_addstring(&b, l_s("\n"));
} }
luaL_pushresult(&b); luaL_pushresult(&b);
lua_getglobal(L, l_s(LUA_ALERT)); lua_getglobal(L, LUA_ALERT);
if (lua_isfunction(L, -1)) { /* avoid loop if _ALERT is not defined */ if (lua_isfunction(L, -1)) { /* avoid loop if _ALERT is not defined */
lua_pushvalue(L, -2); /* error message */ lua_pushvalue(L, -2); /* error message */
lua_rawcall(L, 1, 0); lua_rawcall(L, 1, 0);
@ -671,7 +671,7 @@ static const luaL_reg iolib[] = {
{l_s("tmpname"), io_tmpname}, {l_s("tmpname"), io_tmpname},
{l_s("write"), io_write}, {l_s("write"), io_write},
{l_s("writeto"), io_writeto}, {l_s("writeto"), io_writeto},
{l_s(LUA_ERRORMESSAGE), errorfb} {LUA_ERRORMESSAGE, errorfb}
}; };

View File

@ -1,5 +1,5 @@
/* /*
** $Id: llimits.h,v 1.24 2001/02/22 17:15:18 roberto Exp roberto $ ** $Id: llimits.h,v 1.25 2001/02/23 17:17:25 roberto Exp roberto $
** Limits, basic types, and some other `installation-dependent' definitions ** Limits, basic types, and some other `installation-dependent' definitions
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -80,7 +80,9 @@ typedef unsigned char lu_byte;
/* macro to `unsign' a character */ /* macro to `unsign' a character */
#ifndef uchar
#define uchar(c) ((unsigned char)(c)) #define uchar(c) ((unsigned char)(c))
#endif
#define MAX_SIZET ((size_t)(~(size_t)0)-2) #define MAX_SIZET ((size_t)(~(size_t)0)-2)

4
lua.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lua.c,v 1.61 2001/02/20 18:15:33 roberto Exp roberto $ ** $Id: lua.c,v 1.62 2001/02/23 17:17:25 roberto Exp roberto $
** Lua stand-alone interpreter ** Lua stand-alone interpreter
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -118,7 +118,7 @@ static void print_message (void) {
static void print_version (void) { static void print_version (void) {
printf(l_s("%.80s %.80s\n"), l_s(LUA_VERSION), l_s(LUA_COPYRIGHT)); printf(l_s("%.80s %.80s\n"), LUA_VERSION, LUA_COPYRIGHT);
} }

10
lua.h
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lua.h,v 1.88 2001/02/22 17:15:18 roberto Exp roberto $ ** $Id: lua.h,v 1.89 2001/02/23 17:17:25 roberto Exp roberto $
** Lua - An Extensible Extension Language ** Lua - An Extensible Extension Language
** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
** e-mail: lua@tecgraf.puc-rio.br ** e-mail: lua@tecgraf.puc-rio.br
@ -17,13 +17,13 @@
#define LUA_VERSION "Lua 4.1 (work)" #define LUA_VERSION l_s("Lua 4.1 (work)")
#define LUA_COPYRIGHT "Copyright (C) 1994-2000 TeCGraf, PUC-Rio" #define LUA_COPYRIGHT l_s("Copyright (C) 1994-2000 TeCGraf, PUC-Rio")
#define LUA_AUTHORS "W. Celes, R. Ierusalimschy & L. H. de Figueiredo" #define LUA_AUTHORS l_s("W. Celes, R. Ierusalimschy & L. H. de Figueiredo")
/* name of global variable with error handler */ /* name of global variable with error handler */
#define LUA_ERRORMESSAGE "_ERRORMESSAGE" #define LUA_ERRORMESSAGE l_s("_ERRORMESSAGE")
/* pre-defined references */ /* pre-defined references */

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lualib.h,v 1.16 2001/02/22 17:15:18 roberto Exp roberto $ ** $Id: lualib.h,v 1.17 2001/02/23 17:17:25 roberto Exp roberto $
** Lua standard libraries ** Lua standard libraries
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -31,7 +31,9 @@ LUALIB_API void lua_dblibopen (lua_State *L);
*/ */
/* macro to `unsign' a character */ /* macro to `unsign' a character */
#ifndef uchar
#define uchar(c) ((unsigned char)(c)) #define uchar(c) ((unsigned char)(c))
#endif
/* integer type to hold the result of fgetc */ /* integer type to hold the result of fgetc */
typedef int l_charint; typedef int l_charint;