aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-04-06 18:17:37 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-04-06 18:17:37 -0300
commit2a501882692afaa08ecc38af3052e9b4f60f6e85 (patch)
tree6a7b1fcba9e355a3aa7bab442931afd9ae2fdb87
parent9aedea6ec8feaa163fe0503005dee30d4ed0ba55 (diff)
downloadlua-2a501882692afaa08ecc38af3052e9b4f60f6e85.tar.gz
lua-2a501882692afaa08ecc38af3052e9b4f60f6e85.tar.bz2
lua-2a501882692afaa08ecc38af3052e9b4f60f6e85.zip
avoid use of l_char outside INTERNALs (use lua_char instead)
-rw-r--r--lauxlib.h35
-rw-r--r--lua.h60
-rw-r--r--luadebug.h20
3 files changed, 61 insertions, 54 deletions
diff --git a/lauxlib.h b/lauxlib.h
index ffaca461..9f75f741 100644
--- a/lauxlib.h
+++ b/lauxlib.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.h,v 1.33 2001/02/02 19:02:40 roberto Exp roberto $ 2** $Id: lauxlib.h,v 1.34 2001/02/23 17:17:25 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*/
@@ -21,25 +21,30 @@
21 21
22 22
23typedef struct luaL_reg { 23typedef struct luaL_reg {
24 const l_char *name; 24 const lua_char *name;
25 lua_CFunction func; 25 lua_CFunction func;
26} luaL_reg; 26} luaL_reg;
27 27
28 28
29LUALIB_API void luaL_openlib (lua_State *L, const luaL_reg *l, int n); 29LUALIB_API void luaL_openlib (lua_State *L, const luaL_reg *l, int n);
30LUALIB_API void luaL_argerror (lua_State *L, int numarg, const l_char *extramsg); 30LUALIB_API void luaL_argerror (lua_State *L, int numarg,
31LUALIB_API const l_char *luaL_check_lstr (lua_State *L, int numArg, size_t *len); 31 const lua_char *extramsg);
32LUALIB_API const l_char *luaL_opt_lstr (lua_State *L, int numArg, const l_char *def, size_t *len); 32LUALIB_API const lua_char *luaL_check_lstr (lua_State *L, int numArg,
33 size_t *len);
34LUALIB_API const lua_char *luaL_opt_lstr (lua_State *L, int numArg,
35 const lua_char *def, size_t *len);
33LUALIB_API lua_Number luaL_check_number (lua_State *L, int numArg); 36LUALIB_API lua_Number luaL_check_number (lua_State *L, int numArg);
34LUALIB_API lua_Number luaL_opt_number (lua_State *L, int nArg, lua_Number def); 37LUALIB_API lua_Number luaL_opt_number (lua_State *L, int nArg, lua_Number def);
35 38
36LUALIB_API void luaL_checkstack (lua_State *L, int space, const l_char *msg); 39LUALIB_API void luaL_checkstack (lua_State *L, int space, const lua_char *msg);
37LUALIB_API void luaL_checktype (lua_State *L, int narg, int t); 40LUALIB_API void luaL_checktype (lua_State *L, int narg, int t);
38LUALIB_API void luaL_checkany (lua_State *L, int narg); 41LUALIB_API void luaL_checkany (lua_State *L, int narg);
39LUALIB_API void *luaL_check_userdata (lua_State *L, int narg, const l_char *name); 42LUALIB_API void *luaL_check_userdata (lua_State *L, int narg,
43 const lua_char *name);
40 44
41LUALIB_API void luaL_verror (lua_State *L, const l_char *fmt, ...); 45LUALIB_API void luaL_verror (lua_State *L, const lua_char *fmt, ...);
42LUALIB_API int luaL_findstring (const l_char *name, const l_char *const list[]); 46LUALIB_API int luaL_findstring (const lua_char *name,
47 const lua_char *const list[]);
43 48
44 49
45 50
@@ -73,22 +78,22 @@ LUALIB_API int luaL_findstring (const l_char *name, const l_char *const list[]);
73 78
74 79
75typedef struct luaL_Buffer { 80typedef struct luaL_Buffer {
76 l_char *p; /* current position in buffer */ 81 lua_char *p; /* current position in buffer */
77 int level; 82 int level;
78 lua_State *L; 83 lua_State *L;
79 l_char buffer[LUAL_BUFFERSIZE]; 84 lua_char buffer[LUAL_BUFFERSIZE];
80} luaL_Buffer; 85} luaL_Buffer;
81 86
82#define luaL_putchar(B,c) \ 87#define luaL_putchar(B,c) \
83 ((void)((B)->p < &(B)->buffer[LUAL_BUFFERSIZE] || luaL_prepbuffer(B)), \ 88 ((void)((B)->p < &(B)->buffer[LUAL_BUFFERSIZE] || luaL_prepbuffer(B)), \
84 (*(B)->p++ = (l_char)(c))) 89 (*(B)->p++ = (lua_char)(c)))
85 90
86#define luaL_addsize(B,n) ((B)->p += (n)) 91#define luaL_addsize(B,n) ((B)->p += (n))
87 92
88LUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B); 93LUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B);
89LUALIB_API l_char *luaL_prepbuffer (luaL_Buffer *B); 94LUALIB_API lua_char *luaL_prepbuffer (luaL_Buffer *B);
90LUALIB_API void luaL_addlstring (luaL_Buffer *B, const l_char *s, size_t l); 95LUALIB_API void luaL_addlstring (luaL_Buffer *B, const lua_char *s, size_t l);
91LUALIB_API void luaL_addstring (luaL_Buffer *B, const l_char *s); 96LUALIB_API void luaL_addstring (luaL_Buffer *B, const lua_char *s);
92LUALIB_API void luaL_addvalue (luaL_Buffer *B); 97LUALIB_API void luaL_addvalue (luaL_Buffer *B);
93LUALIB_API void luaL_pushresult (luaL_Buffer *B); 98LUALIB_API void luaL_pushresult (luaL_Buffer *B);
94 99
diff --git a/lua.h b/lua.h
index 95b86cdf..a6f32e98 100644
--- a/lua.h
+++ b/lua.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.h,v 1.91 2001/03/09 18:05:05 roberto Exp roberto $ 2** $Id: lua.h,v 1.92 2001/03/26 14:31:49 roberto Exp roberto $
3** Lua - An Extensible Extension Language 3** Lua - An Extensible Extension Language
4** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil 4** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
5** e-mail: lua@tecgraf.puc-rio.br 5** e-mail: lua@tecgraf.puc-rio.br
@@ -86,7 +86,7 @@ typedef LUA_NUMBER lua_Number;
86#ifndef L_CHAR 86#ifndef L_CHAR
87#define L_CHAR char 87#define L_CHAR char
88#endif 88#endif
89typedef L_CHAR l_char; 89typedef L_CHAR lua_char;
90 90
91 91
92/* mark for all API functions */ 92/* mark for all API functions */
@@ -117,23 +117,23 @@ LUA_API int lua_stackspace (lua_State *L);
117** access functions (stack -> C) 117** access functions (stack -> C)
118*/ 118*/
119 119
120LUA_API int lua_type (lua_State *L, int index); 120LUA_API int lua_type (lua_State *L, int index);
121LUA_API const l_char *lua_typename (lua_State *L, int t); 121LUA_API const lua_char *lua_typename (lua_State *L, int t);
122LUA_API const l_char *lua_xtype (lua_State *L, int index); 122LUA_API const lua_char *lua_xtype (lua_State *L, int index);
123LUA_API int lua_isnumber (lua_State *L, int index); 123LUA_API int lua_isnumber (lua_State *L, int index);
124LUA_API int lua_isstring (lua_State *L, int index); 124LUA_API int lua_isstring (lua_State *L, int index);
125LUA_API int lua_iscfunction (lua_State *L, int index); 125LUA_API int lua_iscfunction (lua_State *L, int index);
126LUA_API int lua_tag (lua_State *L, int index); 126LUA_API int lua_tag (lua_State *L, int index);
127 127
128LUA_API int lua_equal (lua_State *L, int index1, int index2); 128LUA_API int lua_equal (lua_State *L, int index1, int index2);
129LUA_API int lua_lessthan (lua_State *L, int index1, int index2); 129LUA_API int lua_lessthan (lua_State *L, int index1, int index2);
130 130
131LUA_API lua_Number lua_tonumber (lua_State *L, int index); 131LUA_API lua_Number lua_tonumber (lua_State *L, int index);
132LUA_API const l_char *lua_tostring (lua_State *L, int index); 132LUA_API const lua_char *lua_tostring (lua_State *L, int index);
133LUA_API size_t lua_strlen (lua_State *L, int index); 133LUA_API size_t lua_strlen (lua_State *L, int index);
134LUA_API lua_CFunction lua_tocfunction (lua_State *L, int index); 134LUA_API lua_CFunction lua_tocfunction (lua_State *L, int index);
135LUA_API void *lua_touserdata (lua_State *L, int index); 135LUA_API void *lua_touserdata (lua_State *L, int index);
136LUA_API const void *lua_topointer (lua_State *L, int index); 136LUA_API const void *lua_topointer (lua_State *L, int index);
137 137
138 138
139/* 139/*
@@ -141,8 +141,8 @@ LUA_API const void *lua_topointer (lua_State *L, int index);
141*/ 141*/
142LUA_API void lua_pushnil (lua_State *L); 142LUA_API void lua_pushnil (lua_State *L);
143LUA_API void lua_pushnumber (lua_State *L, lua_Number n); 143LUA_API void lua_pushnumber (lua_State *L, lua_Number n);
144LUA_API void lua_pushlstring (lua_State *L, const l_char *s, size_t len); 144LUA_API void lua_pushlstring (lua_State *L, const lua_char *s, size_t len);
145LUA_API void lua_pushstring (lua_State *L, const l_char *s); 145LUA_API void lua_pushstring (lua_State *L, const lua_char *s);
146LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n); 146LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n);
147LUA_API int lua_pushuserdata (lua_State *L, void *u); 147LUA_API int lua_pushuserdata (lua_State *L, void *u);
148 148
@@ -150,12 +150,12 @@ LUA_API int lua_pushuserdata (lua_State *L, void *u);
150/* 150/*
151** get functions (Lua -> stack) 151** get functions (Lua -> stack)
152*/ 152*/
153LUA_API void lua_getglobal (lua_State *L, const l_char *name); 153LUA_API void lua_getglobal (lua_State *L, const lua_char *name);
154LUA_API void lua_gettable (lua_State *L, int index); 154LUA_API void lua_gettable (lua_State *L, int index);
155LUA_API void lua_rawget (lua_State *L, int index); 155LUA_API void lua_rawget (lua_State *L, int index);
156LUA_API void lua_rawgeti (lua_State *L, int index, int n); 156LUA_API void lua_rawgeti (lua_State *L, int index, int n);
157LUA_API void lua_getglobals (lua_State *L); 157LUA_API void lua_getglobals (lua_State *L);
158LUA_API void lua_gettagmethod (lua_State *L, int tag, const l_char *event); 158LUA_API void lua_gettagmethod (lua_State *L, int tag, const lua_char *event);
159LUA_API int lua_getref (lua_State *L, int ref); 159LUA_API int lua_getref (lua_State *L, int ref);
160LUA_API void lua_newtable (lua_State *L); 160LUA_API void lua_newtable (lua_State *L);
161 161
@@ -163,12 +163,12 @@ LUA_API void lua_newtable (lua_State *L);
163/* 163/*
164** set functions (stack -> Lua) 164** set functions (stack -> Lua)
165*/ 165*/
166LUA_API void lua_setglobal (lua_State *L, const l_char *name); 166LUA_API void lua_setglobal (lua_State *L, const lua_char *name);
167LUA_API void lua_settable (lua_State *L, int index); 167LUA_API void lua_settable (lua_State *L, int index);
168LUA_API void lua_rawset (lua_State *L, int index); 168LUA_API void lua_rawset (lua_State *L, int index);
169LUA_API void lua_rawseti (lua_State *L, int index, int n); 169LUA_API void lua_rawseti (lua_State *L, int index, int n);
170LUA_API void lua_setglobals (lua_State *L); 170LUA_API void lua_setglobals (lua_State *L);
171LUA_API void lua_settagmethod (lua_State *L, int tag, const l_char *event); 171LUA_API void lua_settagmethod (lua_State *L, int tag, const lua_char *event);
172LUA_API int lua_ref (lua_State *L, int lock); 172LUA_API int lua_ref (lua_State *L, int lock);
173 173
174 174
@@ -177,10 +177,10 @@ LUA_API int lua_ref (lua_State *L, int lock);
177*/ 177*/
178LUA_API int lua_call (lua_State *L, int nargs, int nresults); 178LUA_API int lua_call (lua_State *L, int nargs, int nresults);
179LUA_API void lua_rawcall (lua_State *L, int nargs, int nresults); 179LUA_API void lua_rawcall (lua_State *L, int nargs, int nresults);
180LUA_API int lua_dofile (lua_State *L, const l_char *filename); 180LUA_API int lua_dofile (lua_State *L, const lua_char *filename);
181LUA_API int lua_dostring (lua_State *L, const l_char *str); 181LUA_API int lua_dostring (lua_State *L, const lua_char *str);
182LUA_API int lua_dobuffer (lua_State *L, const l_char *buff, size_t size, 182LUA_API int lua_dobuffer (lua_State *L, const lua_char *buff, size_t size,
183 const l_char *name); 183 const lua_char *name);
184 184
185/* 185/*
186** Garbage-collection functions 186** Garbage-collection functions
@@ -192,12 +192,12 @@ LUA_API void lua_setgcthreshold (lua_State *L, int newthreshold);
192/* 192/*
193** miscellaneous functions 193** miscellaneous functions
194*/ 194*/
195LUA_API int lua_newtype (lua_State *L, const l_char *name, int basictype); 195LUA_API int lua_newtype (lua_State *L, const lua_char *name, int basictype);
196LUA_API int lua_type2tag (lua_State *L, const l_char *name); 196LUA_API int lua_type2tag (lua_State *L, const lua_char *name);
197LUA_API int lua_copytagmethods (lua_State *L, int tagto, int tagfrom); 197LUA_API int lua_copytagmethods (lua_State *L, int tagto, int tagfrom);
198LUA_API void lua_settag (lua_State *L, int tag); 198LUA_API void lua_settag (lua_State *L, int tag);
199 199
200LUA_API void lua_error (lua_State *L, const l_char *s); 200LUA_API void lua_error (lua_State *L, const lua_char *s);
201 201
202LUA_API void lua_unref (lua_State *L, int ref); 202LUA_API void lua_unref (lua_State *L, int ref);
203 203
@@ -233,7 +233,7 @@ LUA_API void *lua_newuserdata (lua_State *L, size_t size);
233#define lua_getregistry(L) lua_getref(L, LUA_REFREGISTRY) 233#define lua_getregistry(L) lua_getref(L, LUA_REFREGISTRY)
234 234
235#define lua_pushliteral(L, s) lua_pushlstring(L, s, \ 235#define lua_pushliteral(L, s) lua_pushlstring(L, s, \
236 (sizeof(s)/sizeof(l_char))-1) 236 (sizeof(s)/sizeof(lua_char))-1)
237 237
238 238
239 239
@@ -249,6 +249,8 @@ LUA_API void *lua_newuserdata (lua_State *L, size_t size);
249*/ 249*/
250#ifdef LUA_PRIVATE 250#ifdef LUA_PRIVATE
251 251
252#define l_char lua_char
253
252/* macro to control type of literal strings */ 254/* macro to control type of literal strings */
253#ifndef l_s 255#ifndef l_s
254#define l_s(x) x 256#define l_s(x) x
diff --git a/luadebug.h b/luadebug.h
index f23216c5..9c2bc13e 100644
--- a/luadebug.h
+++ b/luadebug.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: luadebug.h,v 1.18 2001/02/23 17:17:25 roberto Exp roberto $ 2** $Id: luadebug.h,v 1.19 2001/03/07 18:09:25 roberto Exp roberto $
3** Debugging API 3** Debugging API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -18,9 +18,9 @@ typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);
18 18
19 19
20LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar); 20LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar);
21LUA_API int lua_getinfo (lua_State *L, const l_char *what, lua_Debug *ar); 21LUA_API int lua_getinfo (lua_State *L, const lua_char *what, lua_Debug *ar);
22LUA_API const l_char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n); 22LUA_API const lua_char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n);
23LUA_API const l_char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n); 23LUA_API const lua_char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n);
24 24
25LUA_API lua_Hook lua_setcallhook (lua_State *L, lua_Hook func); 25LUA_API lua_Hook lua_setcallhook (lua_State *L, lua_Hook func);
26LUA_API lua_Hook lua_setlinehook (lua_State *L, lua_Hook func); 26LUA_API lua_Hook lua_setlinehook (lua_State *L, lua_Hook func);
@@ -29,15 +29,15 @@ LUA_API lua_Hook lua_setlinehook (lua_State *L, lua_Hook func);
29#define LUA_IDSIZE 60 29#define LUA_IDSIZE 60
30 30
31struct lua_Debug { 31struct lua_Debug {
32 const l_char *event; /* `call', `return' */ 32 const lua_char *event; /* `call', `return' */
33 int currentline; /* (l) */ 33 int currentline; /* (l) */
34 const l_char *name; /* (n) */ 34 const lua_char *name; /* (n) */
35 const l_char *namewhat; /* (n) `global', `tag method', `local', `field' */ 35 const lua_char *namewhat; /* (n) `global', `tag method', `local', `field' */
36 int nups; /* (u) number of upvalues */ 36 int nups; /* (u) number of upvalues */
37 int linedefined; /* (S) */ 37 int linedefined; /* (S) */
38 const l_char *what; /* (S) `Lua' function, `C' function, Lua `main' */ 38 const lua_char *what; /* (S) `Lua' function, `C' function, Lua `main' */
39 const l_char *source; /* (S) */ 39 const lua_char *source; /* (S) */
40 l_char short_src[LUA_IDSIZE]; /* (S) */ 40 lua_char short_src[LUA_IDSIZE]; /* (S) */
41 /* private part */ 41 /* private part */
42 struct CallInfo *_ci; /* active function */ 42 struct CallInfo *_ci; /* active function */
43}; 43};