diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-01-10 15:31:50 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-01-10 15:31:50 -0200 |
commit | 6eb68ba57a58679cc69837b03490b12ba0cba8d4 (patch) | |
tree | 23aa714ea6259e027b58cd45fa1d074158438828 | |
parent | a27497aa03b080d8e7a2481aaf7af5d4784b40ec (diff) | |
download | lua-6eb68ba57a58679cc69837b03490b12ba0cba8d4.tar.gz lua-6eb68ba57a58679cc69837b03490b12ba0cba8d4.tar.bz2 lua-6eb68ba57a58679cc69837b03490b12ba0cba8d4.zip |
all function declarations surround name with parentheses
-rw-r--r-- | lauxlib.h | 89 | ||||
-rw-r--r-- | lua.h | 142 |
2 files changed, 117 insertions, 114 deletions
@@ -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 | ||
28 | LUALIB_API void luaL_openlib (lua_State *L, const char *libname, | 28 | LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname, |
29 | const luaL_reg *l, int nup); | 29 | const luaL_reg *l, int nup); |
30 | LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *e); | 30 | LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e); |
31 | LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *e); | 31 | LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e); |
32 | LUALIB_API int luaL_typerror (lua_State *L, int narg, const char *tname); | 32 | LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname); |
33 | LUALIB_API int luaL_argerror (lua_State *L, int numarg, const char *extramsg); | 33 | LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg); |
34 | LUALIB_API const char *luaL_checklstring (lua_State *L, int numArg, size_t *l); | 34 | LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg, |
35 | LUALIB_API const char *luaL_optlstring (lua_State *L, int numArg, | 35 | size_t *l); |
36 | const char *def, size_t *l); | 36 | LUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg, |
37 | LUALIB_API lua_Number luaL_checknumber (lua_State *L, int numArg); | 37 | const char *def, size_t *l); |
38 | LUALIB_API lua_Number luaL_optnumber (lua_State *L, int nArg, lua_Number def); | 38 | LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg); |
39 | LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def); | ||
39 | 40 | ||
40 | LUALIB_API lua_Integer luaL_checkinteger (lua_State *L, int numArg); | 41 | LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg); |
41 | LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int nArg, | 42 | LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg, |
42 | lua_Integer def); | 43 | lua_Integer def); |
43 | 44 | ||
44 | LUALIB_API void luaL_checkstack (lua_State *L, int sz, const char *msg); | 45 | LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg); |
45 | LUALIB_API void luaL_checktype (lua_State *L, int narg, int t); | 46 | LUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t); |
46 | LUALIB_API void luaL_checkany (lua_State *L, int narg); | 47 | LUALIB_API void (luaL_checkany) (lua_State *L, int narg); |
47 | 48 | ||
48 | LUALIB_API int luaL_newmetatable (lua_State *L, const char *tname); | 49 | LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname); |
49 | LUALIB_API void luaL_getmetatable (lua_State *L, const char *tname); | 50 | LUALIB_API void (luaL_getmetatable) (lua_State *L, const char *tname); |
50 | LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname); | 51 | LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname); |
51 | 52 | ||
52 | LUALIB_API void luaL_where (lua_State *L, int lvl); | 53 | LUALIB_API void (luaL_where) (lua_State *L, int lvl); |
53 | LUALIB_API int luaL_error (lua_State *L, const char *fmt, ...); | 54 | LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...); |
54 | 55 | ||
55 | LUALIB_API int luaL_findstring (const char *st, const char *const lst[]); | 56 | LUALIB_API int (luaL_findstring) (const char *st, const char *const lst[]); |
56 | 57 | ||
57 | LUALIB_API const char *luaL_searchpath (lua_State *L, const char *name, | 58 | LUALIB_API const char *(luaL_searchpath) (lua_State *L, const char *name, |
58 | const char *path); | 59 | const char *path); |
59 | 60 | ||
60 | LUALIB_API int luaL_ref (lua_State *L, int t); | 61 | LUALIB_API int (luaL_ref) (lua_State *L, int t); |
61 | LUALIB_API void luaL_unref (lua_State *L, int t, int ref); | 62 | LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref); |
62 | 63 | ||
63 | LUALIB_API int luaL_getn (lua_State *L, int t); | 64 | LUALIB_API int (luaL_getn) (lua_State *L, int t); |
64 | LUALIB_API void luaL_setn (lua_State *L, int t, int n); | 65 | LUALIB_API void (luaL_setn) (lua_State *L, int t, int n); |
65 | 66 | ||
66 | LUALIB_API int luaL_loadfile (lua_State *L, const char *filename); | 67 | LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename); |
67 | LUALIB_API int luaL_loadbuffer (lua_State *L, const char *buff, size_t sz, | 68 | LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz, |
68 | const char *name); | 69 | const char *name); |
69 | 70 | ||
70 | LUALIB_API lua_State *(luaL_newstate) (void); | 71 | LUALIB_API lua_State *(luaL_newstate) (void); |
71 | 72 | ||
72 | 73 | ||
73 | LUALIB_API const char *luaL_gsub (lua_State *L, const char *s, const char *p, | 74 | LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p, |
74 | const char *r); | 75 | const char *r); |
75 | LUALIB_API const char *luaL_getfield (lua_State *L, int idx, const char *fname); | 76 | LUALIB_API const char *(luaL_getfield) (lua_State *L, int idx, |
76 | LUALIB_API const char *luaL_setfield (lua_State *L, int idx, const char *fname); | 77 | const char *fname); |
78 | LUALIB_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 | ||
118 | LUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B); | 121 | LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B); |
119 | LUALIB_API char *luaL_prepbuffer (luaL_Buffer *B); | 122 | LUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B); |
120 | LUALIB_API void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l); | 123 | LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l); |
121 | LUALIB_API void luaL_addstring (luaL_Buffer *B, const char *s); | 124 | LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s); |
122 | LUALIB_API void luaL_addvalue (luaL_Buffer *B); | 125 | LUALIB_API void (luaL_addvalue) (luaL_Buffer *B); |
123 | LUALIB_API void luaL_pushresult (luaL_Buffer *B); | 126 | LUALIB_API void (luaL_pushresult) (luaL_Buffer *B); |
124 | 127 | ||
125 | 128 | ||
126 | /* }====================================================== */ | 129 | /* }====================================================== */ |
@@ -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 | ||