]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
all functions in lua can be called from there library
authorMiek Gieben <miekg@NLnetLabs.nl>
Thu, 25 Aug 2005 09:50:42 +0000 (09:50 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Thu, 25 Aug 2005 09:50:42 +0000 (09:50 +0000)
lua/lua-rns.c
lua/rns.lua

index e20df45402b60644c0aa3f8e1ef96c7614c251d0..334eb30c56f1cdc0214a615e388ccefebdff0562 100644 (file)
@@ -582,15 +582,12 @@ register_ldns_functions(void)
        /* NETWORKING */
        static const struct luaL_reg l_udpnet_lib [] = {
                {"write",       l_write_wire_udp},
-               /* {"read",     l_read_wire_udp}, */ /* DOESN'T WORK???? */
+               {"read",        l_read_wire_udp}, 
                {"open",        l_server_socket_udp},
                {"close",       l_server_socket_close_udp},
                 {NULL,          NULL}
        };
        luaL_openlib(L, "udp", l_udpnet_lib, 0);
-       lua_register(L, "udp_read", l_read_wire_udp); /* THIS DOESNT WORK FROM WITHIN
-                                                        THE LIBRARY...!!! ???? XXX */
-                               /* I DON'T KNOW WHY */
 }
 
 int
index a0e86e393bc52619681896e223c4709600893865..5306102baf9134c09e35b9e55103583109dd34b1 100644 (file)
@@ -22,8 +22,7 @@ socket = udp.open(rdf_ip, 5353)
 while true do
 
 -- read from the socket, this blocks...
-wirebuf, sockaddr_from  = udp_read(socket) -- this works
---wirebuf, sockaddr_from  = udp.read(socket) -- this doesn't
+wirebuf, sockaddr_from  = udp.read(socket)
 
 -- wrap this in new functions
 if wirebuf == nil then