summaryrefslogtreecommitdiff
path: root/lauxlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lauxlib.c')
-rw-r--r--lauxlib.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/lauxlib.c b/lauxlib.c
index 85bb04ac..ed893f70 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.c,v 1.3 1997/11/04 15:27:53 roberto Exp roberto $ 2** $Id: lauxlib.c,v 1.4 1997/11/21 19:00:46 roberto Exp roberto $
3** Auxiliar functions for building Lua libraries 3** Auxiliar functions for building Lua libraries
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -55,6 +55,21 @@ double luaL_opt_number (int numArg, double def)
55{ 55{
56 return (lua_getparam(numArg) == LUA_NOOBJECT) ? def : 56 return (lua_getparam(numArg) == LUA_NOOBJECT) ? def :
57 luaL_check_number(numArg); 57 luaL_check_number(numArg);
58}
59
60
61lua_Object luaL_tablearg (int arg)
62{
63 lua_Object o = lua_getparam(arg);
64 luaL_arg_check(lua_istable(o), arg, "table expected");
65 return o;
66}
67
68lua_Object luaL_functionarg (int arg)
69{
70 lua_Object o = lua_getparam(arg);
71 luaL_arg_check(lua_isfunction(o), arg, "function expected");
72 return o;
58} 73}
59 74
60lua_Object luaL_nonnullarg (int numArg) 75lua_Object luaL_nonnullarg (int numArg)