From 64d7b02490042b0434a69e663b8c59a54345f607 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Wed, 5 Oct 2005 03:17:29 +0000 Subject: [PATCH] Returning a function. --- src/unix.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/unix.c b/src/unix.c index 217a600..3071608 100644 --- a/src/unix.c +++ b/src/unix.c @@ -70,12 +70,6 @@ static t_opt opt[] = { {NULL, NULL} }; -/* functions in library namespace */ -static luaL_reg func[] = { - {"unix", global_create}, - {NULL, NULL} -}; - /*-------------------------------------------------------------------------*\ * Initializes module \*-------------------------------------------------------------------------*/ @@ -89,7 +83,7 @@ int luaopen_socketunix(lua_State *L) { aux_add2group(L, "unix{client}", "unix{any}"); aux_add2group(L, "unix{server}", "unix{any}"); /* define library functions */ - luaL_openlib(L, "socket", func, 0); + lua_pushcfunction(L, global_create); return 1; }