diff options
| author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2005-10-05 03:17:29 +0000 |
|---|---|---|
| committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2005-10-05 03:17:29 +0000 |
| commit | 64d7b02490042b0434a69e663b8c59a54345f607 (patch) | |
| tree | a148f7500056e68cf05dfc7f2b9f8f00eb858203 /src | |
| parent | 72eceedc62d2cb65421fe9e0062a5d8f8c2bd3c4 (diff) | |
| download | luasocket-64d7b02490042b0434a69e663b8c59a54345f607.tar.gz luasocket-64d7b02490042b0434a69e663b8c59a54345f607.tar.bz2 luasocket-64d7b02490042b0434a69e663b8c59a54345f607.zip | |
Returning a function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/unix.c | 8 |
1 files changed, 1 insertions, 7 deletions
| @@ -70,12 +70,6 @@ static t_opt opt[] = { | |||
| 70 | {NULL, NULL} | 70 | {NULL, NULL} |
| 71 | }; | 71 | }; |
| 72 | 72 | ||
| 73 | /* functions in library namespace */ | ||
| 74 | static luaL_reg func[] = { | ||
| 75 | {"unix", global_create}, | ||
| 76 | {NULL, NULL} | ||
| 77 | }; | ||
| 78 | |||
| 79 | /*-------------------------------------------------------------------------*\ | 73 | /*-------------------------------------------------------------------------*\ |
| 80 | * Initializes module | 74 | * Initializes module |
| 81 | \*-------------------------------------------------------------------------*/ | 75 | \*-------------------------------------------------------------------------*/ |
| @@ -89,7 +83,7 @@ int luaopen_socketunix(lua_State *L) { | |||
| 89 | aux_add2group(L, "unix{client}", "unix{any}"); | 83 | aux_add2group(L, "unix{client}", "unix{any}"); |
| 90 | aux_add2group(L, "unix{server}", "unix{any}"); | 84 | aux_add2group(L, "unix{server}", "unix{any}"); |
| 91 | /* define library functions */ | 85 | /* define library functions */ |
| 92 | luaL_openlib(L, "socket", func, 0); | 86 | lua_pushcfunction(L, global_create); |
| 93 | return 1; | 87 | return 1; |
| 94 | } | 88 | } |
| 95 | 89 | ||
