summaryrefslogtreecommitdiff
path: root/lua.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-02-23 14:17:25 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-02-23 14:17:25 -0300
commit39b79783297bee79db9853b63d199e120a009a8f (patch)
treec738c621c4c28d8822c2f785400786301985273b /lua.h
parentd164e2294f73d8e69f00d95a66014514b2dd0ec0 (diff)
downloadlua-39b79783297bee79db9853b63d199e120a009a8f.tar.gz
lua-39b79783297bee79db9853b63d199e120a009a8f.tar.bz2
lua-39b79783297bee79db9853b63d199e120a009a8f.zip
first (big) step to support wide chars
Diffstat (limited to 'lua.h')
-rw-r--r--lua.h41
1 files changed, 22 insertions, 19 deletions
diff --git a/lua.h b/lua.h
index 09221693..d786b025 100644
--- a/lua.h
+++ b/lua.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.h,v 1.87 2001/02/20 18:15:33 roberto Exp roberto $ 2** $Id: lua.h,v 1.88 2001/02/22 17:15:18 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
@@ -79,6 +79,8 @@ typedef int (*lua_CFunction) (lua_State *L);
79/* Lua numerical type */ 79/* Lua numerical type */
80typedef double lua_Number; 80typedef double lua_Number;
81 81
82/* Lua character type */
83typedef char l_char;
82 84
83 85
84/* mark for all API functions */ 86/* mark for all API functions */
@@ -111,8 +113,8 @@ LUA_API int lua_stackspace (lua_State *L);
111*/ 113*/
112 114
113LUA_API int lua_type (lua_State *L, int index); 115LUA_API int lua_type (lua_State *L, int index);
114LUA_API const char *lua_typename (lua_State *L, int t); 116LUA_API const l_char *lua_typename (lua_State *L, int t);
115LUA_API const char *lua_xtype (lua_State *L, int index); 117LUA_API const l_char *lua_xtype (lua_State *L, int index);
116LUA_API int lua_isnumber (lua_State *L, int index); 118LUA_API int lua_isnumber (lua_State *L, int index);
117LUA_API int lua_isstring (lua_State *L, int index); 119LUA_API int lua_isstring (lua_State *L, int index);
118LUA_API int lua_iscfunction (lua_State *L, int index); 120LUA_API int lua_iscfunction (lua_State *L, int index);
@@ -122,7 +124,7 @@ LUA_API int lua_equal (lua_State *L, int index1, int index2);
122LUA_API int lua_lessthan (lua_State *L, int index1, int index2); 124LUA_API int lua_lessthan (lua_State *L, int index1, int index2);
123 125
124LUA_API lua_Number lua_tonumber (lua_State *L, int index); 126LUA_API lua_Number lua_tonumber (lua_State *L, int index);
125LUA_API const char *lua_tostring (lua_State *L, int index); 127LUA_API const l_char *lua_tostring (lua_State *L, int index);
126LUA_API size_t lua_strlen (lua_State *L, int index); 128LUA_API size_t lua_strlen (lua_State *L, int index);
127LUA_API lua_CFunction lua_tocfunction (lua_State *L, int index); 129LUA_API lua_CFunction lua_tocfunction (lua_State *L, int index);
128LUA_API void *lua_touserdata (lua_State *L, int index); 130LUA_API void *lua_touserdata (lua_State *L, int index);
@@ -134,8 +136,8 @@ LUA_API const void *lua_topointer (lua_State *L, int index);
134*/ 136*/
135LUA_API void lua_pushnil (lua_State *L); 137LUA_API void lua_pushnil (lua_State *L);
136LUA_API void lua_pushnumber (lua_State *L, lua_Number n); 138LUA_API void lua_pushnumber (lua_State *L, lua_Number n);
137LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len); 139LUA_API void lua_pushlstring (lua_State *L, const l_char *s, size_t len);
138LUA_API void lua_pushstring (lua_State *L, const char *s); 140LUA_API void lua_pushstring (lua_State *L, const l_char *s);
139LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n); 141LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n);
140LUA_API int lua_pushuserdata (lua_State *L, void *u); 142LUA_API int lua_pushuserdata (lua_State *L, void *u);
141 143
@@ -143,12 +145,12 @@ LUA_API int lua_pushuserdata (lua_State *L, void *u);
143/* 145/*
144** get functions (Lua -> stack) 146** get functions (Lua -> stack)
145*/ 147*/
146LUA_API void lua_getglobal (lua_State *L, const char *name); 148LUA_API void lua_getglobal (lua_State *L, const l_char *name);
147LUA_API void lua_gettable (lua_State *L, int index); 149LUA_API void lua_gettable (lua_State *L, int index);
148LUA_API void lua_rawget (lua_State *L, int index); 150LUA_API void lua_rawget (lua_State *L, int index);
149LUA_API void lua_rawgeti (lua_State *L, int index, int n); 151LUA_API void lua_rawgeti (lua_State *L, int index, int n);
150LUA_API void lua_getglobals (lua_State *L); 152LUA_API void lua_getglobals (lua_State *L);
151LUA_API void lua_gettagmethod (lua_State *L, int tag, const char *event); 153LUA_API void lua_gettagmethod (lua_State *L, int tag, const l_char *event);
152LUA_API int lua_getref (lua_State *L, int ref); 154LUA_API int lua_getref (lua_State *L, int ref);
153LUA_API void lua_newtable (lua_State *L); 155LUA_API void lua_newtable (lua_State *L);
154 156
@@ -156,23 +158,24 @@ LUA_API void lua_newtable (lua_State *L);
156/* 158/*
157** set functions (stack -> Lua) 159** set functions (stack -> Lua)
158*/ 160*/
159LUA_API void lua_setglobal (lua_State *L, const char *name); 161LUA_API void lua_setglobal (lua_State *L, const l_char *name);
160LUA_API void lua_settable (lua_State *L, int index); 162LUA_API void lua_settable (lua_State *L, int index);
161LUA_API void lua_rawset (lua_State *L, int index); 163LUA_API void lua_rawset (lua_State *L, int index);
162LUA_API void lua_rawseti (lua_State *L, int index, int n); 164LUA_API void lua_rawseti (lua_State *L, int index, int n);
163LUA_API void lua_setglobals (lua_State *L); 165LUA_API void lua_setglobals (lua_State *L);
164LUA_API void lua_settagmethod (lua_State *L, int tag, const char *event); 166LUA_API void lua_settagmethod (lua_State *L, int tag, const l_char *event);
165LUA_API int lua_ref (lua_State *L, int lock); 167LUA_API int lua_ref (lua_State *L, int lock);
166 168
167 169
168/* 170/*
169** "do" functions (run Lua code) 171** `do' functions (run Lua code)
170*/ 172*/
171LUA_API int lua_call (lua_State *L, int nargs, int nresults); 173LUA_API int lua_call (lua_State *L, int nargs, int nresults);
172LUA_API void lua_rawcall (lua_State *L, int nargs, int nresults); 174LUA_API void lua_rawcall (lua_State *L, int nargs, int nresults);
173LUA_API int lua_dofile (lua_State *L, const char *filename); 175LUA_API int lua_dofile (lua_State *L, const l_char *filename);
174LUA_API int lua_dostring (lua_State *L, const char *str); 176LUA_API int lua_dostring (lua_State *L, const l_char *str);
175LUA_API int lua_dobuffer (lua_State *L, const char *buff, size_t size, const char *name); 177LUA_API int lua_dobuffer (lua_State *L, const l_char *buff, size_t size,
178 const l_char *name);
176 179
177/* 180/*
178** Garbage-collection functions 181** Garbage-collection functions
@@ -184,12 +187,12 @@ LUA_API void lua_setgcthreshold (lua_State *L, int newthreshold);
184/* 187/*
185** miscellaneous functions 188** miscellaneous functions
186*/ 189*/
187LUA_API int lua_newtype (lua_State *L, const char *name, int basictype); 190LUA_API int lua_newtype (lua_State *L, const l_char *name, int basictype);
188LUA_API int lua_type2tag (lua_State *L, const char *name); 191LUA_API int lua_type2tag (lua_State *L, const l_char *name);
189LUA_API int lua_copytagmethods (lua_State *L, int tagto, int tagfrom); 192LUA_API int lua_copytagmethods (lua_State *L, int tagto, int tagfrom);
190LUA_API void lua_settag (lua_State *L, int tag); 193LUA_API void lua_settag (lua_State *L, int tag);
191 194
192LUA_API void lua_error (lua_State *L, const char *s); 195LUA_API void lua_error (lua_State *L, const l_char *s);
193 196
194LUA_API void lua_unref (lua_State *L, int ref); 197LUA_API void lua_unref (lua_State *L, int ref);
195 198
@@ -222,8 +225,8 @@ LUA_API void *lua_newuserdata (lua_State *L, size_t size);
222 225
223#define lua_getregistry(L) lua_getref(L, LUA_REFREGISTRY) 226#define lua_getregistry(L) lua_getref(L, LUA_REFREGISTRY)
224 227
225#define lua_pushliteral(L, s) lua_pushlstring(L, "" s, \ 228#define lua_pushliteral(L, s) lua_pushlstring(L, l_s("") s, \
226 (sizeof(s)/sizeof(char))-1) 229 (sizeof(s)/sizeof(l_char))-1)
227 230
228 231
229 232