• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/contrib/openzfs/module/lua/

Lines Matching defs:narg

147 LUALIB_API int luaL_argerror (lua_State *L, int narg, const char *extramsg) {
150 return luaL_error(L, "bad argument #%d (%s)", narg, extramsg);
153 narg--; /* do not count `self' */
154 if (narg == 0) /* error is in the self argument itself? */
161 narg, ar.name, extramsg);
165 static int typeerror (lua_State *L, int narg, const char *tname) {
167 tname, luaL_typename(L, narg));
168 return luaL_argerror(L, narg, msg);
172 static void tag_error (lua_State *L, int narg, int tag) {
173 typeerror(L, narg, lua_typename(L, tag));
280 LUALIB_API int luaL_checkoption (lua_State *L, int narg, const char *def,
282 const char *name = (def) ? luaL_optstring(L, narg, def) :
283 luaL_checkstring(L, narg);
288 return luaL_argerror(L, narg,
305 LUALIB_API void luaL_checktype (lua_State *L, int narg, int t) {
306 if (lua_type(L, narg) != t)
307 tag_error(L, narg, t);
311 LUALIB_API void luaL_checkany (lua_State *L, int narg) {
312 if (lua_type(L, narg) == LUA_TNONE)
313 luaL_argerror(L, narg, "value expected");
317 LUALIB_API const char *luaL_checklstring (lua_State *L, int narg, size_t *len) {
318 const char *s = lua_tolstring(L, narg, len);
319 if (!s) tag_error(L, narg, LUA_TSTRING);
324 LUALIB_API const char *luaL_optlstring (lua_State *L, int narg,
326 if (lua_isnoneornil(L, narg)) {
331 else return luaL_checklstring(L, narg, len);
335 LUALIB_API lua_Number luaL_checknumber (lua_State *L, int narg) {
337 lua_Number d = lua_tonumberx(L, narg, &isnum);
339 tag_error(L, narg, LUA_TNUMBER);
344 LUALIB_API lua_Number luaL_optnumber (lua_State *L, int narg, lua_Number def) {
345 return luaL_opt(L, luaL_checknumber, narg, def);
349 LUALIB_API lua_Integer luaL_checkinteger (lua_State *L, int narg) {
351 lua_Integer d = lua_tointegerx(L, narg, &isnum);
353 tag_error(L, narg, LUA_TNUMBER);
358 LUALIB_API lua_Unsigned luaL_checkunsigned (lua_State *L, int narg) {
360 lua_Unsigned d = lua_tounsignedx(L, narg, &isnum);
362 tag_error(L, narg, LUA_TNUMBER);
367 LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int narg,
369 return luaL_opt(L, luaL_checkinteger, narg, def);
373 LUALIB_API lua_Unsigned luaL_optunsigned (lua_State *L, int narg,
375 return luaL_opt(L, luaL_checkunsigned, narg, def);