Lines Matching refs:narg
5871 static int luaL_argerror(lua_State*L,int narg,const char*extramsg){
5874 return luaL_error(L,"bad argument #%d (%s)",narg,extramsg);
5877 narg--;
5878 if(narg==0)
5885 narg,ar.name,extramsg);
5887 static int luaL_typerror(lua_State*L,int narg,const char*tname){
5889 tname,luaL_typename(L,narg));
5890 return luaL_argerror(L,narg,msg);
5892 static void tag_error(lua_State*L,int narg,int tag){
5893 luaL_typerror(L,narg,lua_typename(L,tag));
5943 static void luaL_checktype(lua_State*L,int narg,int t){
5944 if(lua_type(L,narg)!=t)
5945 tag_error(L,narg,t);
5947 static void luaL_checkany(lua_State*L,int narg){
5948 if(lua_type(L,narg)==(-1))
5949 luaL_argerror(L,narg,"value expected");
5951 static const char*luaL_checklstring(lua_State*L,int narg,size_t*len){
5952 const char*s=lua_tolstring(L,narg,len);
5953 if(!s)tag_error(L,narg,4);
5956 static const char*luaL_optlstring(lua_State*L,int narg,
5958 if(lua_isnoneornil(L,narg)){
5963 else return luaL_checklstring(L,narg,len);
5965 static lua_Number luaL_checknumber(lua_State*L,int narg){
5966 lua_Number d=lua_tonumber(L,narg);
5967 if(d==0&&!lua_isnumber(L,narg))
5968 tag_error(L,narg,3);
5971 static lua_Integer luaL_checkinteger(lua_State*L,int narg){
5972 lua_Integer d=lua_tointeger(L,narg);
5973 if(d==0&&!lua_isnumber(L,narg))
5974 tag_error(L,narg,3);
5977 static lua_Integer luaL_optinteger(lua_State*L,int narg,
5979 return luaL_opt(L,luaL_checkinteger,narg,def);