aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lauxlib.h89
-rw-r--r--lua.h142
2 files changed, 117 insertions, 114 deletions
diff --git a/lauxlib.h b/lauxlib.h
index 74db18d6..396ebdcc 100644
--- a/lauxlib.h
+++ b/lauxlib.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.h,v 1.72 2004/09/29 21:00:25 roberto Exp roberto $ 2** $Id: lauxlib.h,v 1.73 2004/10/18 12:51:44 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*/
@@ -25,55 +25,58 @@ typedef struct luaL_reg {
25} luaL_reg; 25} luaL_reg;
26 26
27 27
28LUALIB_API void luaL_openlib (lua_State *L, const char *libname, 28LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname,
29 const luaL_reg *l, int nup); 29 const luaL_reg *l, int nup);
30LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *e); 30LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e);
31LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *e); 31LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e);
32LUALIB_API int luaL_typerror (lua_State *L, int narg, const char *tname); 32LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname);
33LUALIB_API int luaL_argerror (lua_State *L, int numarg, const char *extramsg); 33LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg);
34LUALIB_API const char *luaL_checklstring (lua_State *L, int numArg, size_t *l); 34LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg,
35LUALIB_API const char *luaL_optlstring (lua_State *L, int numArg, 35 size_t *l);
36 const char *def, size_t *l); 36LUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg,
37LUALIB_API lua_Number luaL_checknumber (lua_State *L, int numArg); 37 const char *def, size_t *l);
38LUALIB_API lua_Number luaL_optnumber (lua_State *L, int nArg, lua_Number def); 38LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg);
39LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def);
39 40
40LUALIB_API lua_Integer luaL_checkinteger (lua_State *L, int numArg); 41LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg);
41LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int nArg, 42LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg,
42 lua_Integer def); 43 lua_Integer def);
43 44
44LUALIB_API void luaL_checkstack (lua_State *L, int sz, const char *msg); 45LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg);
45LUALIB_API void luaL_checktype (lua_State *L, int narg, int t); 46LUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t);
46LUALIB_API void luaL_checkany (lua_State *L, int narg); 47LUALIB_API void (luaL_checkany) (lua_State *L, int narg);
47 48
48LUALIB_API int luaL_newmetatable (lua_State *L, const char *tname); 49LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname);
49LUALIB_API void luaL_getmetatable (lua_State *L, const char *tname); 50LUALIB_API void (luaL_getmetatable) (lua_State *L, const char *tname);
50LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname); 51LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname);
51 52
52LUALIB_API void luaL_where (lua_State *L, int lvl); 53LUALIB_API void (luaL_where) (lua_State *L, int lvl);
53LUALIB_API int luaL_error (lua_State *L, const char *fmt, ...); 54LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...);
54 55
55LUALIB_API int luaL_findstring (const char *st, const char *const lst[]); 56LUALIB_API int (luaL_findstring) (const char *st, const char *const lst[]);
56 57
57LUALIB_API const char *luaL_searchpath (lua_State *L, const char *name, 58LUALIB_API const char *(luaL_searchpath) (lua_State *L, const char *name,
58 const char *path); 59 const char *path);
59 60
60LUALIB_API int luaL_ref (lua_State *L, int t); 61LUALIB_API int (luaL_ref) (lua_State *L, int t);
61LUALIB_API void luaL_unref (lua_State *L, int t, int ref); 62LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref);
62 63
63LUALIB_API int luaL_getn (lua_State *L, int t); 64LUALIB_API int (luaL_getn) (lua_State *L, int t);
64LUALIB_API void luaL_setn (lua_State *L, int t, int n); 65LUALIB_API void (luaL_setn) (lua_State *L, int t, int n);
65 66
66LUALIB_API int luaL_loadfile (lua_State *L, const char *filename); 67LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename);
67LUALIB_API int luaL_loadbuffer (lua_State *L, const char *buff, size_t sz, 68LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz,
68 const char *name); 69 const char *name);
69 70
70LUALIB_API lua_State *(luaL_newstate) (void); 71LUALIB_API lua_State *(luaL_newstate) (void);
71 72
72 73
73LUALIB_API const char *luaL_gsub (lua_State *L, const char *s, const char *p, 74LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p,
74 const char *r); 75 const char *r);
75LUALIB_API const char *luaL_getfield (lua_State *L, int idx, const char *fname); 76LUALIB_API const char *(luaL_getfield) (lua_State *L, int idx,
76LUALIB_API const char *luaL_setfield (lua_State *L, int idx, const char *fname); 77 const char *fname);
78LUALIB_API const char *(luaL_setfield) (lua_State *L, int idx,
79 const char *fname);
77 80
78 81
79 82
@@ -115,12 +118,12 @@ typedef struct luaL_Buffer {
115 118
116#define luaL_addsize(B,n) ((B)->p += (n)) 119#define luaL_addsize(B,n) ((B)->p += (n))
117 120
118LUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B); 121LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B);
119LUALIB_API char *luaL_prepbuffer (luaL_Buffer *B); 122LUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B);
120LUALIB_API void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l); 123LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l);
121LUALIB_API void luaL_addstring (luaL_Buffer *B, const char *s); 124LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s);
122LUALIB_API void luaL_addvalue (luaL_Buffer *B); 125LUALIB_API void (luaL_addvalue) (luaL_Buffer *B);
123LUALIB_API void luaL_pushresult (luaL_Buffer *B); 126LUALIB_API void (luaL_pushresult) (luaL_Buffer *B);
124 127
125 128
126/* }====================================================== */ 129/* }====================================================== */
diff --git a/lua.h b/lua.h
index b319e1ce..3d629f3a 100644
--- a/lua.h
+++ b/lua.h
@@ -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*/
113LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud); 113LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud);
114LUA_API void lua_close (lua_State *L); 114LUA_API void (lua_close) (lua_State *L);
115LUA_API lua_State *lua_newthread (lua_State *L); 115LUA_API lua_State *(lua_newthread) (lua_State *L);
116 116
117LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf); 117LUA_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*/
123LUA_API int lua_gettop (lua_State *L); 123LUA_API int (lua_gettop) (lua_State *L);
124LUA_API void lua_settop (lua_State *L, int idx); 124LUA_API void (lua_settop) (lua_State *L, int idx);
125LUA_API void lua_pushvalue (lua_State *L, int idx); 125LUA_API void (lua_pushvalue) (lua_State *L, int idx);
126LUA_API void lua_remove (lua_State *L, int idx); 126LUA_API void (lua_remove) (lua_State *L, int idx);
127LUA_API void lua_insert (lua_State *L, int idx); 127LUA_API void (lua_insert) (lua_State *L, int idx);
128LUA_API void lua_replace (lua_State *L, int idx); 128LUA_API void (lua_replace) (lua_State *L, int idx);
129LUA_API int lua_checkstack (lua_State *L, int sz); 129LUA_API int (lua_checkstack) (lua_State *L, int sz);
130 130
131LUA_API void lua_xmove (lua_State *from, lua_State *to, int n); 131LUA_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
138LUA_API int lua_isnumber (lua_State *L, int idx); 138LUA_API int (lua_isnumber) (lua_State *L, int idx);
139LUA_API int lua_isstring (lua_State *L, int idx); 139LUA_API int (lua_isstring) (lua_State *L, int idx);
140LUA_API int lua_iscfunction (lua_State *L, int idx); 140LUA_API int (lua_iscfunction) (lua_State *L, int idx);
141LUA_API int lua_isuserdata (lua_State *L, int idx); 141LUA_API int (lua_isuserdata) (lua_State *L, int idx);
142LUA_API int lua_type (lua_State *L, int idx); 142LUA_API int (lua_type) (lua_State *L, int idx);
143LUA_API const char *lua_typename (lua_State *L, int tp); 143LUA_API const char *(lua_typename) (lua_State *L, int tp);
144 144
145LUA_API int lua_equal (lua_State *L, int idx1, int idx2); 145LUA_API int (lua_equal) (lua_State *L, int idx1, int idx2);
146LUA_API int lua_rawequal (lua_State *L, int idx1, int idx2); 146LUA_API int (lua_rawequal) (lua_State *L, int idx1, int idx2);
147LUA_API int lua_lessthan (lua_State *L, int idx1, int idx2); 147LUA_API int (lua_lessthan) (lua_State *L, int idx1, int idx2);
148 148
149LUA_API lua_Number lua_tonumber (lua_State *L, int idx); 149LUA_API lua_Number (lua_tonumber) (lua_State *L, int idx);
150LUA_API lua_Integer lua_tointeger (lua_State *L, int idx); 150LUA_API lua_Integer (lua_tointeger) (lua_State *L, int idx);
151LUA_API int lua_toboolean (lua_State *L, int idx); 151LUA_API int (lua_toboolean) (lua_State *L, int idx);
152LUA_API const char *lua_tostring (lua_State *L, int idx); 152LUA_API const char *(lua_tostring) (lua_State *L, int idx);
153LUA_API size_t lua_objsize (lua_State *L, int idx); 153LUA_API size_t (lua_objsize) (lua_State *L, int idx);
154LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx); 154LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx);
155LUA_API void *lua_touserdata (lua_State *L, int idx); 155LUA_API void *(lua_touserdata) (lua_State *L, int idx);
156LUA_API lua_State *lua_tothread (lua_State *L, int idx); 156LUA_API lua_State *(lua_tothread) (lua_State *L, int idx);
157LUA_API const void *lua_topointer (lua_State *L, int idx); 157LUA_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*/
163LUA_API void lua_pushnil (lua_State *L); 163LUA_API void (lua_pushnil) (lua_State *L);
164LUA_API void lua_pushnumber (lua_State *L, lua_Number n); 164LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n);
165LUA_API void lua_pushinteger (lua_State *L, lua_Integer n); 165LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n);
166LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t l); 166LUA_API void (lua_pushlstring) (lua_State *L, const char *s, size_t l);
167LUA_API void lua_pushstring (lua_State *L, const char *s); 167LUA_API void (lua_pushstring) (lua_State *L, const char *s);
168LUA_API const char *lua_pushvfstring (lua_State *L, const char *fmt, 168LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt,
169 va_list argp); 169 va_list argp);
170LUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...); 170LUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...);
171LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n); 171LUA_API void (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n);
172LUA_API void lua_pushboolean (lua_State *L, int b); 172LUA_API void (lua_pushboolean) (lua_State *L, int b);
173LUA_API void lua_pushlightuserdata (lua_State *L, void *p); 173LUA_API void (lua_pushlightuserdata) (lua_State *L, void *p);
174LUA_API int lua_pushthread (lua_State *L); 174LUA_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*/
180LUA_API void lua_gettable (lua_State *L, int idx); 180LUA_API void (lua_gettable) (lua_State *L, int idx);
181LUA_API void lua_getfield (lua_State *L, int idx, const char *k); 181LUA_API void (lua_getfield) (lua_State *L, int idx, const char *k);
182LUA_API void lua_rawget (lua_State *L, int idx); 182LUA_API void (lua_rawget) (lua_State *L, int idx);
183LUA_API void lua_rawgeti (lua_State *L, int idx, int n); 183LUA_API void (lua_rawgeti) (lua_State *L, int idx, int n);
184LUA_API void lua_createtable (lua_State *L, int narr, int nrec); 184LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec);
185LUA_API void *lua_newuserdata (lua_State *L, size_t sz); 185LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz);
186LUA_API int lua_getmetatable (lua_State *L, int objindex); 186LUA_API int (lua_getmetatable) (lua_State *L, int objindex);
187LUA_API void lua_getfenv (lua_State *L, int idx); 187LUA_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*/
193LUA_API void lua_settable (lua_State *L, int idx); 193LUA_API void (lua_settable) (lua_State *L, int idx);
194LUA_API void lua_setfield (lua_State *L, int idx, const char *k); 194LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k);
195LUA_API void lua_rawset (lua_State *L, int idx); 195LUA_API void (lua_rawset) (lua_State *L, int idx);
196LUA_API void lua_rawseti (lua_State *L, int idx, int n); 196LUA_API void (lua_rawseti) (lua_State *L, int idx, int n);
197LUA_API int lua_setmetatable (lua_State *L, int objindex); 197LUA_API int (lua_setmetatable) (lua_State *L, int objindex);
198LUA_API int lua_setfenv (lua_State *L, int idx); 198LUA_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*/
204LUA_API void lua_call (lua_State *L, int nargs, int nresults); 204LUA_API void (lua_call) (lua_State *L, int nargs, int nresults);
205LUA_API int lua_pcall (lua_State *L, int nargs, int nresults, int errfunc); 205LUA_API int (lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc);
206LUA_API int lua_cpcall (lua_State *L, lua_CFunction func, void *ud); 206LUA_API int (lua_cpcall) (lua_State *L, lua_CFunction func, void *ud);
207LUA_API int lua_load (lua_State *L, lua_Chunkreader reader, void *dt, 207LUA_API int (lua_load) (lua_State *L, lua_Chunkreader reader, void *dt,
208 const char *chunkname); 208 const char *chunkname);
209 209
210LUA_API int lua_dump (lua_State *L, lua_Chunkwriter writer, void *data); 210LUA_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*/
216LUA_API int lua_yield (lua_State *L, int nresults); 216LUA_API int (lua_yield) (lua_State *L, int nresults);
217LUA_API int lua_resume (lua_State *L, int narg); 217LUA_API int (lua_resume) (lua_State *L, int narg);
218LUA_API int lua_status (lua_State *L); 218LUA_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
232LUA_API int lua_gc (lua_State *L, int what, int data); 232LUA_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
239LUA_API int lua_error (lua_State *L); 239LUA_API int (lua_error) (lua_State *L);
240 240
241LUA_API int lua_next (lua_State *L, int idx); 241LUA_API int (lua_next) (lua_State *L, int idx);
242 242
243LUA_API void lua_concat (lua_State *L, int n); 243LUA_API void (lua_concat) (lua_State *L, int n);
244 244
245LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud); 245LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud);
246 246
247 247
248 248