diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-04-06 18:17:37 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-04-06 18:17:37 -0300 |
| commit | 2a501882692afaa08ecc38af3052e9b4f60f6e85 (patch) | |
| tree | 6a7b1fcba9e355a3aa7bab442931afd9ae2fdb87 /lua.h | |
| parent | 9aedea6ec8feaa163fe0503005dee30d4ed0ba55 (diff) | |
| download | lua-2a501882692afaa08ecc38af3052e9b4f60f6e85.tar.gz lua-2a501882692afaa08ecc38af3052e9b4f60f6e85.tar.bz2 lua-2a501882692afaa08ecc38af3052e9b4f60f6e85.zip | |
avoid use of l_char outside INTERNALs (use lua_char instead)
Diffstat (limited to 'lua.h')
| -rw-r--r-- | lua.h | 60 |
1 files changed, 31 insertions, 29 deletions
| @@ -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 |
| 89 | typedef L_CHAR l_char; | 89 | typedef 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 | ||
| 120 | LUA_API int lua_type (lua_State *L, int index); | 120 | LUA_API int lua_type (lua_State *L, int index); |
| 121 | LUA_API const l_char *lua_typename (lua_State *L, int t); | 121 | LUA_API const lua_char *lua_typename (lua_State *L, int t); |
| 122 | LUA_API const l_char *lua_xtype (lua_State *L, int index); | 122 | LUA_API const lua_char *lua_xtype (lua_State *L, int index); |
| 123 | LUA_API int lua_isnumber (lua_State *L, int index); | 123 | LUA_API int lua_isnumber (lua_State *L, int index); |
| 124 | LUA_API int lua_isstring (lua_State *L, int index); | 124 | LUA_API int lua_isstring (lua_State *L, int index); |
| 125 | LUA_API int lua_iscfunction (lua_State *L, int index); | 125 | LUA_API int lua_iscfunction (lua_State *L, int index); |
| 126 | LUA_API int lua_tag (lua_State *L, int index); | 126 | LUA_API int lua_tag (lua_State *L, int index); |
| 127 | 127 | ||
| 128 | LUA_API int lua_equal (lua_State *L, int index1, int index2); | 128 | LUA_API int lua_equal (lua_State *L, int index1, int index2); |
| 129 | LUA_API int lua_lessthan (lua_State *L, int index1, int index2); | 129 | LUA_API int lua_lessthan (lua_State *L, int index1, int index2); |
| 130 | 130 | ||
| 131 | LUA_API lua_Number lua_tonumber (lua_State *L, int index); | 131 | LUA_API lua_Number lua_tonumber (lua_State *L, int index); |
| 132 | LUA_API const l_char *lua_tostring (lua_State *L, int index); | 132 | LUA_API const lua_char *lua_tostring (lua_State *L, int index); |
| 133 | LUA_API size_t lua_strlen (lua_State *L, int index); | 133 | LUA_API size_t lua_strlen (lua_State *L, int index); |
| 134 | LUA_API lua_CFunction lua_tocfunction (lua_State *L, int index); | 134 | LUA_API lua_CFunction lua_tocfunction (lua_State *L, int index); |
| 135 | LUA_API void *lua_touserdata (lua_State *L, int index); | 135 | LUA_API void *lua_touserdata (lua_State *L, int index); |
| 136 | LUA_API const void *lua_topointer (lua_State *L, int index); | 136 | LUA_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 | */ |
| 142 | LUA_API void lua_pushnil (lua_State *L); | 142 | LUA_API void lua_pushnil (lua_State *L); |
| 143 | LUA_API void lua_pushnumber (lua_State *L, lua_Number n); | 143 | LUA_API void lua_pushnumber (lua_State *L, lua_Number n); |
| 144 | LUA_API void lua_pushlstring (lua_State *L, const l_char *s, size_t len); | 144 | LUA_API void lua_pushlstring (lua_State *L, const lua_char *s, size_t len); |
| 145 | LUA_API void lua_pushstring (lua_State *L, const l_char *s); | 145 | LUA_API void lua_pushstring (lua_State *L, const lua_char *s); |
| 146 | LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n); | 146 | LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n); |
| 147 | LUA_API int lua_pushuserdata (lua_State *L, void *u); | 147 | LUA_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 | */ |
| 153 | LUA_API void lua_getglobal (lua_State *L, const l_char *name); | 153 | LUA_API void lua_getglobal (lua_State *L, const lua_char *name); |
| 154 | LUA_API void lua_gettable (lua_State *L, int index); | 154 | LUA_API void lua_gettable (lua_State *L, int index); |
| 155 | LUA_API void lua_rawget (lua_State *L, int index); | 155 | LUA_API void lua_rawget (lua_State *L, int index); |
| 156 | LUA_API void lua_rawgeti (lua_State *L, int index, int n); | 156 | LUA_API void lua_rawgeti (lua_State *L, int index, int n); |
| 157 | LUA_API void lua_getglobals (lua_State *L); | 157 | LUA_API void lua_getglobals (lua_State *L); |
| 158 | LUA_API void lua_gettagmethod (lua_State *L, int tag, const l_char *event); | 158 | LUA_API void lua_gettagmethod (lua_State *L, int tag, const lua_char *event); |
| 159 | LUA_API int lua_getref (lua_State *L, int ref); | 159 | LUA_API int lua_getref (lua_State *L, int ref); |
| 160 | LUA_API void lua_newtable (lua_State *L); | 160 | LUA_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 | */ |
| 166 | LUA_API void lua_setglobal (lua_State *L, const l_char *name); | 166 | LUA_API void lua_setglobal (lua_State *L, const lua_char *name); |
| 167 | LUA_API void lua_settable (lua_State *L, int index); | 167 | LUA_API void lua_settable (lua_State *L, int index); |
| 168 | LUA_API void lua_rawset (lua_State *L, int index); | 168 | LUA_API void lua_rawset (lua_State *L, int index); |
| 169 | LUA_API void lua_rawseti (lua_State *L, int index, int n); | 169 | LUA_API void lua_rawseti (lua_State *L, int index, int n); |
| 170 | LUA_API void lua_setglobals (lua_State *L); | 170 | LUA_API void lua_setglobals (lua_State *L); |
| 171 | LUA_API void lua_settagmethod (lua_State *L, int tag, const l_char *event); | 171 | LUA_API void lua_settagmethod (lua_State *L, int tag, const lua_char *event); |
| 172 | LUA_API int lua_ref (lua_State *L, int lock); | 172 | LUA_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 | */ |
| 178 | LUA_API int lua_call (lua_State *L, int nargs, int nresults); | 178 | LUA_API int lua_call (lua_State *L, int nargs, int nresults); |
| 179 | LUA_API void lua_rawcall (lua_State *L, int nargs, int nresults); | 179 | LUA_API void lua_rawcall (lua_State *L, int nargs, int nresults); |
| 180 | LUA_API int lua_dofile (lua_State *L, const l_char *filename); | 180 | LUA_API int lua_dofile (lua_State *L, const lua_char *filename); |
| 181 | LUA_API int lua_dostring (lua_State *L, const l_char *str); | 181 | LUA_API int lua_dostring (lua_State *L, const lua_char *str); |
| 182 | LUA_API int lua_dobuffer (lua_State *L, const l_char *buff, size_t size, | 182 | LUA_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 | */ |
| 195 | LUA_API int lua_newtype (lua_State *L, const l_char *name, int basictype); | 195 | LUA_API int lua_newtype (lua_State *L, const lua_char *name, int basictype); |
| 196 | LUA_API int lua_type2tag (lua_State *L, const l_char *name); | 196 | LUA_API int lua_type2tag (lua_State *L, const lua_char *name); |
| 197 | LUA_API int lua_copytagmethods (lua_State *L, int tagto, int tagfrom); | 197 | LUA_API int lua_copytagmethods (lua_State *L, int tagto, int tagfrom); |
| 198 | LUA_API void lua_settag (lua_State *L, int tag); | 198 | LUA_API void lua_settag (lua_State *L, int tag); |
| 199 | 199 | ||
| 200 | LUA_API void lua_error (lua_State *L, const l_char *s); | 200 | LUA_API void lua_error (lua_State *L, const lua_char *s); |
| 201 | 201 | ||
| 202 | LUA_API void lua_unref (lua_State *L, int ref); | 202 | LUA_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 |
