Skip to content

Commit

Permalink
details for wchar
Browse files Browse the repository at this point in the history
  • Loading branch information
roberto-ieru committed Feb 23, 2001
1 parent 39b7978 commit 3502335
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 26 deletions.
6 changes: 3 additions & 3 deletions lapi.c
Original file line number Diff line number Diff line change
@@ -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
** See Copyright Notice in lua.h
*/
Expand All @@ -22,8 +22,8 @@
#include "lvm.h"


const l_char lua_ident[] = l_s("$Lua: ") l_s(LUA_VERSION) l_s(" ")
l_s(LUA_COPYRIGHT) l_s(" $\n") l_s("$Authors: ") l_s(LUA_AUTHORS) l_s(" $");
const l_char lua_ident[] = l_s("$Lua: ") LUA_VERSION l_s(" ")
LUA_COPYRIGHT l_s(" $\n") l_s("$Authors: ") LUA_AUTHORS l_s(" $");



Expand Down
16 changes: 8 additions & 8 deletions lbaselib.c
Original file line number Diff line number Diff line change
@@ -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
** See Copyright Notice in lua.h
*/
Expand Down Expand Up @@ -35,7 +35,7 @@ static int luaB__ALERT (lua_State *L) {
*/
static int luaB__ERRORMESSAGE (lua_State *L) {
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 */
lua_Debug ar;
lua_pushliteral(L, l_s("error: "));
Expand Down Expand Up @@ -305,10 +305,10 @@ static int luaB_call (lua_State *L) {
luaL_checktype(L, 2, LUA_TTABLE);
n = lua_getn(L, 2);
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 */
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 */
/* push function */
Expand All @@ -319,7 +319,7 @@ static int luaB_call (lua_State *L) {
status = lua_call(L, n, LUA_MULTRET);
if (err != 0) { /* restore old error method */
lua_pushvalue(L, err);
lua_setglobal(L, l_s(LUA_ERRORMESSAGE));
lua_setglobal(L, LUA_ERRORMESSAGE);
}
if (status != 0) { /* error in call? */
if (strchr(options, l_c('x')))
Expand Down Expand Up @@ -637,8 +637,8 @@ static void deprecated_funcs (lua_State *L) {
/* }====================================================== */

static const luaL_reg base_funcs[] = {
{l_s(LUA_ALERT), luaB__ALERT},
{l_s(LUA_ERRORMESSAGE), luaB__ERRORMESSAGE},
{LUA_ALERT, luaB__ALERT},
{LUA_ERRORMESSAGE, luaB__ERRORMESSAGE},
{l_s("call"), luaB_call},
{l_s("collectgarbage"), luaB_collectgarbage},
{l_s("copytagmethods"), luaB_copytagmethods},
Expand Down Expand Up @@ -678,7 +678,7 @@ static const luaL_reg base_funcs[] = {

LUALIB_API void lua_baselibopen (lua_State *L) {
luaL_openl(L, base_funcs);
lua_pushliteral(L, l_s(LUA_VERSION));
lua_pushliteral(L, LUA_VERSION);
lua_setglobal(L, l_s("_VERSION"));
deprecated_funcs(L);
}
Expand Down
4 changes: 2 additions & 2 deletions ldo.c
Original file line number Diff line number Diff line change
@@ -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
** See Copyright Notice in lua.h
*/
Expand Down Expand Up @@ -335,7 +335,7 @@ struct lua_longjmp {


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) {
incr_top;
setsvalue(L->top, luaS_new(L, s));
Expand Down
6 changes: 3 additions & 3 deletions liolib.c
Original file line number Diff line number Diff line change
@@ -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
** See Copyright Notice in lua.h
*/
Expand Down Expand Up @@ -638,7 +638,7 @@ static int errorfb (lua_State *L) {
luaL_addstring(&b, l_s("\n"));
}
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 */
lua_pushvalue(L, -2); /* error message */
lua_rawcall(L, 1, 0);
Expand Down Expand Up @@ -671,7 +671,7 @@ static const luaL_reg iolib[] = {
{l_s("tmpname"), io_tmpname},
{l_s("write"), io_write},
{l_s("writeto"), io_writeto},
{l_s(LUA_ERRORMESSAGE), errorfb}
{LUA_ERRORMESSAGE, errorfb}
};


Expand Down
6 changes: 4 additions & 2 deletions llimits.h
Original file line number Diff line number Diff line change
@@ -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
** See Copyright Notice in lua.h
*/
Expand Down Expand Up @@ -80,7 +80,9 @@ typedef unsigned char lu_byte;


/* macro to `unsign' a character */
#define uchar(c) ((unsigned char)(c))
#ifndef uchar
#define uchar(c) ((unsigned char)(c))
#endif


#define MAX_SIZET ((size_t)(~(size_t)0)-2)
Expand Down
4 changes: 2 additions & 2 deletions lua.c
Original file line number Diff line number Diff line change
@@ -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
** See Copyright Notice in lua.h
*/
Expand Down Expand Up @@ -118,7 +118,7 @@ static void print_message (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);
}


Expand Down
10 changes: 5 additions & 5 deletions lua.h
Original file line number Diff line number Diff line change
@@ -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
** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
** e-mail: [email protected]
Expand All @@ -17,13 +17,13 @@



#define LUA_VERSION "Lua 4.1 (work)"
#define LUA_COPYRIGHT "Copyright (C) 1994-2000 TeCGraf, PUC-Rio"
#define LUA_AUTHORS "W. Celes, R. Ierusalimschy & L. H. de Figueiredo"
#define LUA_VERSION l_s("Lua 4.1 (work)")
#define LUA_COPYRIGHT l_s("Copyright (C) 1994-2000 TeCGraf, PUC-Rio")
#define LUA_AUTHORS l_s("W. Celes, R. Ierusalimschy & L. H. de Figueiredo")


/* name of global variable with error handler */
#define LUA_ERRORMESSAGE "_ERRORMESSAGE"
#define LUA_ERRORMESSAGE l_s("_ERRORMESSAGE")


/* pre-defined references */
Expand Down
4 changes: 3 additions & 1 deletion lualib.h
Original file line number Diff line number Diff line change
@@ -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
** See Copyright Notice in lua.h
*/
Expand Down Expand Up @@ -31,7 +31,9 @@ LUALIB_API void lua_dblibopen (lua_State *L);
*/

/* macro to `unsign' a character */
#ifndef uchar
#define uchar(c) ((unsigned char)(c))
#endif

/* integer type to hold the result of fgetc */
typedef int l_charint;
Expand Down

0 comments on commit 3502335

Please sign in to comment.