diff options
Diffstat (limited to 'lua.h')
| -rw-r--r-- | lua.h | 142 |
1 files changed, 71 insertions, 71 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lua.h,v 1.197 2004/12/13 12:15:11 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.198 2005/01/07 19:53:32 roberto Exp roberto $ |
| 3 | ** Lua - An Extensible Extension Language | 3 | ** Lua - An Extensible Extension Language |
| 4 | ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil | 4 | ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil |
| 5 | ** http://www.lua.org mailto:info@lua.org | 5 | ** http://www.lua.org mailto:info@lua.org |
| @@ -110,112 +110,112 @@ typedef LUA_INTEGER lua_Integer; | |||
| 110 | /* | 110 | /* |
| 111 | ** state manipulation | 111 | ** state manipulation |
| 112 | */ | 112 | */ |
| 113 | LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud); | 113 | LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud); |
| 114 | LUA_API void lua_close (lua_State *L); | 114 | LUA_API void (lua_close) (lua_State *L); |
| 115 | LUA_API lua_State *lua_newthread (lua_State *L); | 115 | LUA_API lua_State *(lua_newthread) (lua_State *L); |
| 116 | 116 | ||
| 117 | LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf); | 117 | LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf); |
| 118 | 118 | ||
| 119 | 119 | ||
| 120 | /* | 120 | /* |
| 121 | ** basic stack manipulation | 121 | ** basic stack manipulation |
| 122 | */ | 122 | */ |
| 123 | LUA_API int lua_gettop (lua_State *L); | 123 | LUA_API int (lua_gettop) (lua_State *L); |
| 124 | LUA_API void lua_settop (lua_State *L, int idx); | 124 | LUA_API void (lua_settop) (lua_State *L, int idx); |
| 125 | LUA_API void lua_pushvalue (lua_State *L, int idx); | 125 | LUA_API void (lua_pushvalue) (lua_State *L, int idx); |
| 126 | LUA_API void lua_remove (lua_State *L, int idx); | 126 | LUA_API void (lua_remove) (lua_State *L, int idx); |
| 127 | LUA_API void lua_insert (lua_State *L, int idx); | 127 | LUA_API void (lua_insert) (lua_State *L, int idx); |
| 128 | LUA_API void lua_replace (lua_State *L, int idx); | 128 | LUA_API void (lua_replace) (lua_State *L, int idx); |
| 129 | LUA_API int lua_checkstack (lua_State *L, int sz); | 129 | LUA_API int (lua_checkstack) (lua_State *L, int sz); |
| 130 | 130 | ||
| 131 | LUA_API void lua_xmove (lua_State *from, lua_State *to, int n); | 131 | LUA_API void (lua_xmove) (lua_State *from, lua_State *to, int n); |
| 132 | 132 | ||
| 133 | 133 | ||
| 134 | /* | 134 | /* |
| 135 | ** access functions (stack -> C) | 135 | ** access functions (stack -> C) |
| 136 | */ | 136 | */ |
| 137 | 137 | ||
| 138 | LUA_API int lua_isnumber (lua_State *L, int idx); | 138 | LUA_API int (lua_isnumber) (lua_State *L, int idx); |
| 139 | LUA_API int lua_isstring (lua_State *L, int idx); | 139 | LUA_API int (lua_isstring) (lua_State *L, int idx); |
| 140 | LUA_API int lua_iscfunction (lua_State *L, int idx); | 140 | LUA_API int (lua_iscfunction) (lua_State *L, int idx); |
| 141 | LUA_API int lua_isuserdata (lua_State *L, int idx); | 141 | LUA_API int (lua_isuserdata) (lua_State *L, int idx); |
| 142 | LUA_API int lua_type (lua_State *L, int idx); | 142 | LUA_API int (lua_type) (lua_State *L, int idx); |
| 143 | LUA_API const char *lua_typename (lua_State *L, int tp); | 143 | LUA_API const char *(lua_typename) (lua_State *L, int tp); |
| 144 | 144 | ||
| 145 | LUA_API int lua_equal (lua_State *L, int idx1, int idx2); | 145 | LUA_API int (lua_equal) (lua_State *L, int idx1, int idx2); |
| 146 | LUA_API int lua_rawequal (lua_State *L, int idx1, int idx2); | 146 | LUA_API int (lua_rawequal) (lua_State *L, int idx1, int idx2); |
| 147 | LUA_API int lua_lessthan (lua_State *L, int idx1, int idx2); | 147 | LUA_API int (lua_lessthan) (lua_State *L, int idx1, int idx2); |
| 148 | 148 | ||
| 149 | LUA_API lua_Number lua_tonumber (lua_State *L, int idx); | 149 | LUA_API lua_Number (lua_tonumber) (lua_State *L, int idx); |
| 150 | LUA_API lua_Integer lua_tointeger (lua_State *L, int idx); | 150 | LUA_API lua_Integer (lua_tointeger) (lua_State *L, int idx); |
| 151 | LUA_API int lua_toboolean (lua_State *L, int idx); | 151 | LUA_API int (lua_toboolean) (lua_State *L, int idx); |
| 152 | LUA_API const char *lua_tostring (lua_State *L, int idx); | 152 | LUA_API const char *(lua_tostring) (lua_State *L, int idx); |
| 153 | LUA_API size_t lua_objsize (lua_State *L, int idx); | 153 | LUA_API size_t (lua_objsize) (lua_State *L, int idx); |
| 154 | LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx); | 154 | LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx); |
| 155 | LUA_API void *lua_touserdata (lua_State *L, int idx); | 155 | LUA_API void *(lua_touserdata) (lua_State *L, int idx); |
| 156 | LUA_API lua_State *lua_tothread (lua_State *L, int idx); | 156 | LUA_API lua_State *(lua_tothread) (lua_State *L, int idx); |
| 157 | LUA_API const void *lua_topointer (lua_State *L, int idx); | 157 | LUA_API const void *(lua_topointer) (lua_State *L, int idx); |
| 158 | 158 | ||
| 159 | 159 | ||
| 160 | /* | 160 | /* |
| 161 | ** push functions (C -> stack) | 161 | ** push functions (C -> stack) |
| 162 | */ | 162 | */ |
| 163 | LUA_API void lua_pushnil (lua_State *L); | 163 | LUA_API void (lua_pushnil) (lua_State *L); |
| 164 | LUA_API void lua_pushnumber (lua_State *L, lua_Number n); | 164 | LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n); |
| 165 | LUA_API void lua_pushinteger (lua_State *L, lua_Integer n); | 165 | LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n); |
| 166 | LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t l); | 166 | LUA_API void (lua_pushlstring) (lua_State *L, const char *s, size_t l); |
| 167 | LUA_API void lua_pushstring (lua_State *L, const char *s); | 167 | LUA_API void (lua_pushstring) (lua_State *L, const char *s); |
| 168 | LUA_API const char *lua_pushvfstring (lua_State *L, const char *fmt, | 168 | LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt, |
| 169 | va_list argp); | 169 | va_list argp); |
| 170 | LUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...); | 170 | LUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...); |
| 171 | LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n); | 171 | LUA_API void (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n); |
| 172 | LUA_API void lua_pushboolean (lua_State *L, int b); | 172 | LUA_API void (lua_pushboolean) (lua_State *L, int b); |
| 173 | LUA_API void lua_pushlightuserdata (lua_State *L, void *p); | 173 | LUA_API void (lua_pushlightuserdata) (lua_State *L, void *p); |
| 174 | LUA_API int lua_pushthread (lua_State *L); | 174 | LUA_API int (lua_pushthread) (lua_State *L); |
| 175 | 175 | ||
| 176 | 176 | ||
| 177 | /* | 177 | /* |
| 178 | ** get functions (Lua -> stack) | 178 | ** get functions (Lua -> stack) |
| 179 | */ | 179 | */ |
| 180 | LUA_API void lua_gettable (lua_State *L, int idx); | 180 | LUA_API void (lua_gettable) (lua_State *L, int idx); |
| 181 | LUA_API void lua_getfield (lua_State *L, int idx, const char *k); | 181 | LUA_API void (lua_getfield) (lua_State *L, int idx, const char *k); |
| 182 | LUA_API void lua_rawget (lua_State *L, int idx); | 182 | LUA_API void (lua_rawget) (lua_State *L, int idx); |
| 183 | LUA_API void lua_rawgeti (lua_State *L, int idx, int n); | 183 | LUA_API void (lua_rawgeti) (lua_State *L, int idx, int n); |
| 184 | LUA_API void lua_createtable (lua_State *L, int narr, int nrec); | 184 | LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); |
| 185 | LUA_API void *lua_newuserdata (lua_State *L, size_t sz); | 185 | LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); |
| 186 | LUA_API int lua_getmetatable (lua_State *L, int objindex); | 186 | LUA_API int (lua_getmetatable) (lua_State *L, int objindex); |
| 187 | LUA_API void lua_getfenv (lua_State *L, int idx); | 187 | LUA_API void (lua_getfenv) (lua_State *L, int idx); |
| 188 | 188 | ||
| 189 | 189 | ||
| 190 | /* | 190 | /* |
| 191 | ** set functions (stack -> Lua) | 191 | ** set functions (stack -> Lua) |
| 192 | */ | 192 | */ |
| 193 | LUA_API void lua_settable (lua_State *L, int idx); | 193 | LUA_API void (lua_settable) (lua_State *L, int idx); |
| 194 | LUA_API void lua_setfield (lua_State *L, int idx, const char *k); | 194 | LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k); |
| 195 | LUA_API void lua_rawset (lua_State *L, int idx); | 195 | LUA_API void (lua_rawset) (lua_State *L, int idx); |
| 196 | LUA_API void lua_rawseti (lua_State *L, int idx, int n); | 196 | LUA_API void (lua_rawseti) (lua_State *L, int idx, int n); |
| 197 | LUA_API int lua_setmetatable (lua_State *L, int objindex); | 197 | LUA_API int (lua_setmetatable) (lua_State *L, int objindex); |
| 198 | LUA_API int lua_setfenv (lua_State *L, int idx); | 198 | LUA_API int (lua_setfenv) (lua_State *L, int idx); |
| 199 | 199 | ||
| 200 | 200 | ||
| 201 | /* | 201 | /* |
| 202 | ** `load' and `call' functions (load and run Lua code) | 202 | ** `load' and `call' functions (load and run Lua code) |
| 203 | */ | 203 | */ |
| 204 | LUA_API void lua_call (lua_State *L, int nargs, int nresults); | 204 | LUA_API void (lua_call) (lua_State *L, int nargs, int nresults); |
| 205 | LUA_API int lua_pcall (lua_State *L, int nargs, int nresults, int errfunc); | 205 | LUA_API int (lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc); |
| 206 | LUA_API int lua_cpcall (lua_State *L, lua_CFunction func, void *ud); | 206 | LUA_API int (lua_cpcall) (lua_State *L, lua_CFunction func, void *ud); |
| 207 | LUA_API int lua_load (lua_State *L, lua_Chunkreader reader, void *dt, | 207 | LUA_API int (lua_load) (lua_State *L, lua_Chunkreader reader, void *dt, |
| 208 | const char *chunkname); | 208 | const char *chunkname); |
| 209 | 209 | ||
| 210 | LUA_API int lua_dump (lua_State *L, lua_Chunkwriter writer, void *data); | 210 | LUA_API int (lua_dump) (lua_State *L, lua_Chunkwriter writer, void *data); |
| 211 | 211 | ||
| 212 | 212 | ||
| 213 | /* | 213 | /* |
| 214 | ** coroutine functions | 214 | ** coroutine functions |
| 215 | */ | 215 | */ |
| 216 | LUA_API int lua_yield (lua_State *L, int nresults); | 216 | LUA_API int (lua_yield) (lua_State *L, int nresults); |
| 217 | LUA_API int lua_resume (lua_State *L, int narg); | 217 | LUA_API int (lua_resume) (lua_State *L, int narg); |
| 218 | LUA_API int lua_status (lua_State *L); | 218 | LUA_API int (lua_status) (lua_State *L); |
| 219 | 219 | ||
| 220 | /* | 220 | /* |
| 221 | ** garbage-collection function and options | 221 | ** garbage-collection function and options |
| @@ -229,20 +229,20 @@ LUA_API int lua_status (lua_State *L); | |||
| 229 | #define LUA_GCSETPACE 5 | 229 | #define LUA_GCSETPACE 5 |
| 230 | #define LUA_GCSETINCMODE 6 | 230 | #define LUA_GCSETINCMODE 6 |
| 231 | 231 | ||
| 232 | LUA_API int lua_gc (lua_State *L, int what, int data); | 232 | LUA_API int (lua_gc) (lua_State *L, int what, int data); |
| 233 | 233 | ||
| 234 | 234 | ||
| 235 | /* | 235 | /* |
| 236 | ** miscellaneous functions | 236 | ** miscellaneous functions |
| 237 | */ | 237 | */ |
| 238 | 238 | ||
| 239 | LUA_API int lua_error (lua_State *L); | 239 | LUA_API int (lua_error) (lua_State *L); |
| 240 | 240 | ||
| 241 | LUA_API int lua_next (lua_State *L, int idx); | 241 | LUA_API int (lua_next) (lua_State *L, int idx); |
| 242 | 242 | ||
| 243 | LUA_API void lua_concat (lua_State *L, int n); | 243 | LUA_API void (lua_concat) (lua_State *L, int n); |
| 244 | 244 | ||
| 245 | LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud); | 245 | LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud); |
| 246 | 246 | ||
| 247 | 247 | ||
| 248 | 248 | ||
