diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-10-07 17:13:41 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-10-07 17:13:41 -0300 |
commit | f04fe526cd9de3e5460b614b2ff06268ad51872d (patch) | |
tree | 9e9fd4fc0bae4858d74c04a22d8ce5748191d5a9 /lauxlib.h | |
parent | 21947deddc5976536665cd2397d7d5c9e6bd7e48 (diff) | |
download | lua-f04fe526cd9de3e5460b614b2ff06268ad51872d.tar.gz lua-f04fe526cd9de3e5460b614b2ff06268ad51872d.tar.bz2 lua-f04fe526cd9de3e5460b614b2ff06268ad51872d.zip |
new functions `lua_tointeger' and lua_pushinteger'
Diffstat (limited to 'lauxlib.h')
-rw-r--r-- | lauxlib.h | 27 |
1 files changed, 9 insertions, 18 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.h,v 1.60 2003/04/03 13:35:34 roberto Exp roberto $ | 2 | ** $Id: lauxlib.h,v 1.61 2003/10/02 20:31:17 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 | */ |
@@ -39,6 +39,10 @@ LUALIB_API const char *luaL_optlstring (lua_State *L, int numArg, | |||
39 | LUALIB_API lua_Number luaL_checknumber (lua_State *L, int numArg); | 39 | LUALIB_API lua_Number luaL_checknumber (lua_State *L, int numArg); |
40 | LUALIB_API lua_Number luaL_optnumber (lua_State *L, int nArg, lua_Number def); | 40 | LUALIB_API lua_Number luaL_optnumber (lua_State *L, int nArg, lua_Number def); |
41 | 41 | ||
42 | LUALIB_API lua_Integer luaL_checkinteger (lua_State *L, int numArg); | ||
43 | LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int nArg, | ||
44 | lua_Integer def); | ||
45 | |||
42 | LUALIB_API void luaL_checkstack (lua_State *L, int sz, const char *msg); | 46 | LUALIB_API void luaL_checkstack (lua_State *L, int sz, const char *msg); |
43 | LUALIB_API void luaL_checktype (lua_State *L, int narg, int t); | 47 | LUALIB_API void luaL_checktype (lua_State *L, int narg, int t); |
44 | LUALIB_API void luaL_checkany (lua_State *L, int narg); | 48 | LUALIB_API void luaL_checkany (lua_State *L, int narg); |
@@ -76,10 +80,10 @@ LUALIB_API lua_State *(luaL_newstate) (void); | |||
76 | luaL_argerror(L, numarg,extramsg) | 80 | luaL_argerror(L, numarg,extramsg) |
77 | #define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL)) | 81 | #define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL)) |
78 | #define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL)) | 82 | #define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL)) |
79 | #define luaL_checkint(L,n) ((int)luaL_checknumber(L, n)) | 83 | #define luaL_checkint(L,n) ((int)luaL_checkinteger(L, n)) |
80 | #define luaL_checklong(L,n) ((long)luaL_checknumber(L, n)) | 84 | #define luaL_optint(L,n,d) ((int)luaL_optinteger(L, n,d)) |
81 | #define luaL_optint(L,n,d) ((int)luaL_optnumber(L, n,(lua_Number)(d))) | 85 | #define luaL_checklong(L,n) ((long)luaL_checkinteger(L, n)) |
82 | #define luaL_optlong(L,n,d) ((long)luaL_optnumber(L, n,(lua_Number)(d))) | 86 | #define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, n,d)) |
83 | 87 | ||
84 | 88 | ||
85 | /* | 89 | /* |
@@ -129,19 +133,6 @@ LUALIB_API int lua_dobuffer (lua_State *L, const char *buff, size_t sz, | |||
129 | const char *n); | 133 | const char *n); |
130 | 134 | ||
131 | 135 | ||
132 | #define luaL_check_lstr luaL_checklstring | ||
133 | #define luaL_opt_lstr luaL_optlstring | ||
134 | #define luaL_check_number luaL_checknumber | ||
135 | #define luaL_opt_number luaL_optnumber | ||
136 | #define luaL_arg_check luaL_argcheck | ||
137 | #define luaL_check_string luaL_checkstring | ||
138 | #define luaL_opt_string luaL_optstring | ||
139 | #define luaL_check_int luaL_checkint | ||
140 | #define luaL_check_long luaL_checklong | ||
141 | #define luaL_opt_int luaL_optint | ||
142 | #define luaL_opt_long luaL_optlong | ||
143 | |||
144 | |||
145 | #endif | 136 | #endif |
146 | 137 | ||
147 | 138 | ||