commit 33ace03b5a1cde68445f5718ecc42619e46a6644
parent 085181a08a78244d20177a40cbe223d6ad0a2ff6
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Mon, 9 Jun 1997 14:29:25 -0300
udata is just void * again, so there is no point for function "getbyte".
Diffstat:
M | iolib.c | | | 45 | --------------------------------------------- |
1 file changed, 0 insertions(+), 45 deletions(-)
diff --git a/iolib.c b/iolib.c
@@ -276,49 +276,6 @@ static void errorfb (void)
}
-/* --------------------------------------------
-* functions to manipulate userdata
-*/
-static void getbyte (void)
-{
- lua_Object ud = lua_getparam(1);
- int i = luaL_opt_number(2, -1);
- luaL_arg_check(lua_isuserdata(ud), 1, "userdata expected");
- if (i == -1)
- lua_pushnumber(lua_getbindatasize(ud));
- else {
- i--;
- if (0 <= i && i < lua_getbindatasize(ud))
- lua_pushnumber(*(((char *)lua_getbindata(ud))+i));
- else
- lua_pushnil();
- }
-}
-
-static void newuserdata (void)
-{
- lua_Object t = lua_getparam(1);
- int tag = luaL_opt_number(2, 0);
- int i;
- luaI_emptybuff();
- luaL_arg_check(lua_istable(t), 1, "table expected");
- for (i=0; ; i++) {
- lua_Object o;
- lua_beginblock();
- lua_pushobject(t);
- lua_pushnumber(i+1);
- o = lua_rawgettable();
- if (lua_isnil(o)) {
- lua_endblock();
- break;
- }
- luaL_arg_check(lua_isnumber(o), 1, "table values must be numbers");
- luaI_addchar(lua_getnumber(o));
- lua_endblock();
- }
- lua_pushbindata(luaI_addchar(0), i, tag);
-}
-
static struct luaL_reg iolib[] = {
{"readfrom", io_readfrom},
@@ -334,8 +291,6 @@ static struct luaL_reg iolib[] = {
{"date", io_date},
{"exit", io_exit},
{"debug", io_debug},
-{"getbyte", getbyte},
-{"userdata", newuserdata},
{"print_stack", errorfb}
};