diff --git a/src/pre_generated-zmq.nobj.c b/src/pre_generated-zmq.nobj.c index 0678cb5..db8865c 100644 --- a/src/pre_generated-zmq.nobj.c +++ b/src/pre_generated-zmq.nobj.c @@ -59,7 +59,7 @@ typedef int bool; #define true 1 #endif #ifndef false -#define false 1 +#define false 0 #endif #endif @@ -306,7 +306,8 @@ static int nobj_check_ffi_support(lua_State *L) { if(!lua_isnil(L, -1)) { rc = lua_toboolean(L, -1); lua_pop(L, 1); - return rc; /* return results of previous check. */ + /* use results of previous check. */ + goto finished; } lua_pop(L, 1); /* pop nil. */ @@ -332,6 +333,7 @@ static int nobj_check_ffi_support(lua_State *L) { lua_pushboolean(L, rc); lua_rawset(L, LUA_REGISTRYINDEX); +finished: /* turn-on hint that there is FFI code enabled. */ if(rc) { nobj_ffi_support_enabled_hint = 1; @@ -340,9 +342,29 @@ static int nobj_check_ffi_support(lua_State *L) { return rc; } +typedef struct { + const char **ffi_init_code; + int offset; +} nobj_reader_state; + +static const char *nobj_lua_Reader(lua_State *L, void *data, size_t *size) { + nobj_reader_state *state = (nobj_reader_state *)data; + const char *ptr; + + ptr = state->ffi_init_code[state->offset]; + if(ptr != NULL) { + *size = strlen(ptr); + state->offset++; + } else { + *size = 0; + } + return ptr; +} + static int nobj_try_loading_ffi(lua_State *L, const char *ffi_mod_name, - const char *ffi_init_code, const ffi_export_symbol *ffi_exports, int priv_table) + const char *ffi_init_code[], const ffi_export_symbol *ffi_exports, int priv_table) { + nobj_reader_state state = { ffi_init_code, 0 }; int err; /* export symbols to priv_table. */ @@ -352,7 +374,7 @@ static int nobj_try_loading_ffi(lua_State *L, const char *ffi_mod_name, lua_settable(L, priv_table); ffi_exports++; } - err = luaL_loadbuffer(L, ffi_init_code, strlen(ffi_init_code), ffi_mod_name); + err = lua_load(L, nobj_lua_Reader, &state, ffi_mod_name); if(0 == err) { lua_pushvalue(L, -2); /* dup C module's table. */ lua_pushvalue(L, priv_table); /* move priv_table to top of stack. */ @@ -1018,7 +1040,7 @@ static FUNC_UNUSED int lua_checktype_ref(lua_State *L, int _index, int _type) { -static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" +static const char *zmq_ffi_lua_code[] = { "local ffi=require\"ffi\"\n" "local function ffi_safe_load(name, global)\n" " local stat, C = pcall(ffi.load, name, global)\n" " if not stat then return nil, C end\n" @@ -1195,6 +1217,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "local Cmod = ffi_load_cmodule(\"zmq\", false)\n" +"local C = Cmod\n" "\n" "ffi.cdef[[\n" "typedef int ZMQ_Error;\n" @@ -1590,7 +1613,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" " function obj_type_ZMQ_Ctx_check(ptr)\n" " -- if ptr is nil or is the correct type, then just return it.\n" " if not ptr or ffi.istype(obj_ctype, ptr) then return ptr end\n" -" -- check if it is a compatible type.\n" +" -- check if it is a compatible type.\n", /* ----- CUT ----- */ " local ctype = tostring(ffi.typeof(ptr))\n" " local bcaster = _obj_subs.ZMQ_Ctx[ctype]\n" " if bcaster then\n" @@ -2107,7 +2130,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local hwm_value_tmp = ffi.new(\"int[1]\")\n" "-- method: hwm\n" -"if (VERSION_2_0 or VERSION_3_0) then\n" +"if (_M.VERSION_2_0 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.hwm(self)\n" " \n" " local value1 = hwm_value_tmp\n" @@ -2122,7 +2145,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_hwm\n" -"if (VERSION_2_0 or VERSION_3_0) then\n" +"if (_M.VERSION_2_0 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.set_hwm(self, value2)\n" " \n" " \n" @@ -2139,7 +2162,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local swap_value_tmp = ffi.new(\"int[1]\")\n" "-- method: swap\n" -"if (VERSION_2_0) then\n" +"if (_M.VERSION_2_0) then\n" "function _meth.ZMQ_Socket.swap(self)\n" " \n" " local value1 = swap_value_tmp\n" @@ -2154,7 +2177,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_swap\n" -"if (VERSION_2_0) then\n" +"if (_M.VERSION_2_0) then\n" "function _meth.ZMQ_Socket.set_swap(self, value2)\n" " \n" " \n" @@ -2171,7 +2194,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local affinity_value_tmp = ffi.new(\"uint64_t[1]\")\n" "-- method: affinity\n" -"if (VERSION_2_0 or VERSION_3_0) then\n" +"if (_M.VERSION_2_0 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.affinity(self)\n" " \n" " local value1 = affinity_value_tmp\n" @@ -2185,8 +2208,8 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "end\n" "\n" -"-- method: set_affinity\n" -"if (VERSION_2_0 or VERSION_3_0) then\n" +"-- method: set_affinity\n", /* ----- CUT ----- */ +"if (_M.VERSION_2_0 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.set_affinity(self, value2)\n" " \n" " \n" @@ -2201,7 +2224,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: identity\n" -"if (VERSION_2_0 or VERSION_3_0) then\n" +"if (_M.VERSION_2_0 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.identity(self)\n" " \n" " local value_len1 = 0\n" @@ -2216,7 +2239,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_identity\n" -"if (VERSION_2_0 or VERSION_3_0) then\n" +"if (_M.VERSION_2_0 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.set_identity(self, value2)\n" " \n" " local value_len2 = #value2\n" @@ -2231,7 +2254,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: subscribe\n" -"if (VERSION_2_0 or VERSION_3_0) then\n" +"if (_M.VERSION_2_0 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.subscribe(self, value2)\n" " \n" " local value_len2 = #value2\n" @@ -2246,7 +2269,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: unsubscribe\n" -"if (VERSION_2_0 or VERSION_3_0) then\n" +"if (_M.VERSION_2_0 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.unsubscribe(self, value2)\n" " \n" " local value_len2 = #value2\n" @@ -2263,7 +2286,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local rate_value_tmp = ffi.new(\"int[1]\")\n" "-- method: rate\n" -"if (VERSION_2_0 or VERSION_3_0) then\n" +"if (_M.VERSION_2_0 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.rate(self)\n" " \n" " local value1 = rate_value_tmp\n" @@ -2278,7 +2301,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_rate\n" -"if (VERSION_2_0 or VERSION_3_0) then\n" +"if (_M.VERSION_2_0 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.set_rate(self, value2)\n" " \n" " \n" @@ -2295,7 +2318,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local recovery_ivl_value_tmp = ffi.new(\"int[1]\")\n" "-- method: recovery_ivl\n" -"if (VERSION_2_0 or VERSION_3_0) then\n" +"if (_M.VERSION_2_0 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.recovery_ivl(self)\n" " \n" " local value1 = recovery_ivl_value_tmp\n" @@ -2310,7 +2333,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_recovery_ivl\n" -"if (VERSION_2_0 or VERSION_3_0) then\n" +"if (_M.VERSION_2_0 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.set_recovery_ivl(self, value2)\n" " \n" " \n" @@ -2327,7 +2350,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local mcast_loop_value_tmp = ffi.new(\"int[1]\")\n" "-- method: mcast_loop\n" -"if (VERSION_2_0) then\n" +"if (_M.VERSION_2_0) then\n" "function _meth.ZMQ_Socket.mcast_loop(self)\n" " \n" " local value1 = mcast_loop_value_tmp\n" @@ -2342,7 +2365,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_mcast_loop\n" -"if (VERSION_2_0) then\n" +"if (_M.VERSION_2_0) then\n" "function _meth.ZMQ_Socket.set_mcast_loop(self, value2)\n" " \n" " \n" @@ -2359,7 +2382,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local sndbuf_value_tmp = ffi.new(\"int[1]\")\n" "-- method: sndbuf\n" -"if (VERSION_2_0 or VERSION_3_0) then\n" +"if (_M.VERSION_2_0 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.sndbuf(self)\n" " \n" " local value1 = sndbuf_value_tmp\n" @@ -2374,7 +2397,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_sndbuf\n" -"if (VERSION_2_0 or VERSION_3_0) then\n" +"if (_M.VERSION_2_0 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.set_sndbuf(self, value2)\n" " \n" " \n" @@ -2391,7 +2414,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local rcvbuf_value_tmp = ffi.new(\"int[1]\")\n" "-- method: rcvbuf\n" -"if (VERSION_2_0 or VERSION_3_0) then\n" +"if (_M.VERSION_2_0 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.rcvbuf(self)\n" " \n" " local value1 = rcvbuf_value_tmp\n" @@ -2406,7 +2429,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_rcvbuf\n" -"if (VERSION_2_0 or VERSION_3_0) then\n" +"if (_M.VERSION_2_0 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.set_rcvbuf(self, value2)\n" " \n" " \n" @@ -2423,7 +2446,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local rcvmore_value_tmp = ffi.new(\"int[1]\")\n" "-- method: rcvmore\n" -"if (VERSION_2_0 or VERSION_3_0) then\n" +"if (_M.VERSION_2_0 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.rcvmore(self)\n" " \n" " local value1 = rcvmore_value_tmp\n" @@ -2440,7 +2463,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local fd_value_tmp = ffi.new(\"int[1]\")\n" "-- method: fd\n" -"if (VERSION_2_1 or VERSION_3_0) then\n" +"if (_M.VERSION_2_1 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.fd(self)\n" " \n" " local value1 = fd_value_tmp\n" @@ -2457,7 +2480,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local events_value_tmp = ffi.new(\"int[1]\")\n" "-- method: events\n" -"if (VERSION_2_1 or VERSION_3_0) then\n" +"if (_M.VERSION_2_1 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.events(self)\n" " \n" " local value1 = events_value_tmp\n" @@ -2474,7 +2497,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local type_value_tmp = ffi.new(\"int[1]\")\n" "-- method: type\n" -"if (VERSION_2_1 or VERSION_3_0) then\n" +"if (_M.VERSION_2_1 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.type(self)\n" " \n" " local value1 = type_value_tmp\n" @@ -2491,7 +2514,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local linger_value_tmp = ffi.new(\"int[1]\")\n" "-- method: linger\n" -"if (VERSION_2_1 or VERSION_3_0) then\n" +"if (_M.VERSION_2_1 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.linger(self)\n" " \n" " local value1 = linger_value_tmp\n" @@ -2506,7 +2529,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_linger\n" -"if (VERSION_2_1 or VERSION_3_0) then\n" +"if (_M.VERSION_2_1 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.set_linger(self, value2)\n" " \n" " \n" @@ -2523,7 +2546,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local reconnect_ivl_value_tmp = ffi.new(\"int[1]\")\n" "-- method: reconnect_ivl\n" -"if (VERSION_2_1 or VERSION_3_0) then\n" +"if (_M.VERSION_2_1 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.reconnect_ivl(self)\n" " \n" " local value1 = reconnect_ivl_value_tmp\n" @@ -2538,7 +2561,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_reconnect_ivl\n" -"if (VERSION_2_1 or VERSION_3_0) then\n" +"if (_M.VERSION_2_1 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.set_reconnect_ivl(self, value2)\n" " \n" " \n" @@ -2555,7 +2578,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local backlog_value_tmp = ffi.new(\"int[1]\")\n" "-- method: backlog\n" -"if (VERSION_2_1 or VERSION_3_0) then\n" +"if (_M.VERSION_2_1 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.backlog(self)\n" " \n" " local value1 = backlog_value_tmp\n" @@ -2570,7 +2593,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_backlog\n" -"if (VERSION_2_1 or VERSION_3_0) then\n" +"if (_M.VERSION_2_1 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.set_backlog(self, value2)\n" " \n" " \n" @@ -2587,7 +2610,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local recovery_ivl_msec_value_tmp = ffi.new(\"int64_t[1]\")\n" "-- method: recovery_ivl_msec\n" -"if (VERSION_2_1) then\n" +"if (_M.VERSION_2_1) then\n" "function _meth.ZMQ_Socket.recovery_ivl_msec(self)\n" " \n" " local value1 = recovery_ivl_msec_value_tmp\n" @@ -2602,7 +2625,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_recovery_ivl_msec\n" -"if (VERSION_2_1) then\n" +"if (_M.VERSION_2_1) then\n" "function _meth.ZMQ_Socket.set_recovery_ivl_msec(self, value2)\n" " \n" " \n" @@ -2619,7 +2642,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local reconnect_ivl_max_value_tmp = ffi.new(\"int[1]\")\n" "-- method: reconnect_ivl_max\n" -"if (VERSION_2_1 or VERSION_3_0) then\n" +"if (_M.VERSION_2_1 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.reconnect_ivl_max(self)\n" " \n" " local value1 = reconnect_ivl_max_value_tmp\n" @@ -2634,7 +2657,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_reconnect_ivl_max\n" -"if (VERSION_2_1 or VERSION_3_0) then\n" +"if (_M.VERSION_2_1 or _M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.set_reconnect_ivl_max(self, value2)\n" " \n" " \n" @@ -2651,7 +2674,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local maxmsgsize_value_tmp = ffi.new(\"int64_t[1]\")\n" "-- method: maxmsgsize\n" -"if (VERSION_3_0) then\n" +"if (_M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.maxmsgsize(self)\n" " \n" " local value1 = maxmsgsize_value_tmp\n" @@ -2666,7 +2689,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_maxmsgsize\n" -"if (VERSION_3_0) then\n" +"if (_M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.set_maxmsgsize(self, value2)\n" " \n" " \n" @@ -2683,7 +2706,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local sndhwm_value_tmp = ffi.new(\"int[1]\")\n" "-- method: sndhwm\n" -"if (VERSION_3_0) then\n" +"if (_M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.sndhwm(self)\n" " \n" " local value1 = sndhwm_value_tmp\n" @@ -2698,14 +2721,14 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_sndhwm\n" -"if (VERSION_3_0) then\n" +"if (_M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.set_sndhwm(self, value2)\n" " \n" " \n" " local rc_lzmq_socket_set_sndhwm1 = 0\n" " rc_lzmq_socket_set_sndhwm1 = Cmod.lzmq_socket_set_sndhwm(self, value2)\n" " -- check for error.\n" -" if (-1 == rc_lzmq_socket_set_sndhwm1) then\n" +" if (-1 == rc_lzmq_socket_set_sndhwm1) then\n", /* ----- CUT ----- */ " return nil, error_code__ZMQ_Error__push(rc_lzmq_socket_set_sndhwm1)\n" " end\n" " return true\n" @@ -2715,7 +2738,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local rcvhwm_value_tmp = ffi.new(\"int[1]\")\n" "-- method: rcvhwm\n" -"if (VERSION_3_0) then\n" +"if (_M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.rcvhwm(self)\n" " \n" " local value1 = rcvhwm_value_tmp\n" @@ -2730,7 +2753,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_rcvhwm\n" -"if (VERSION_3_0) then\n" +"if (_M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.set_rcvhwm(self, value2)\n" " \n" " \n" @@ -2747,7 +2770,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local multicast_hops_value_tmp = ffi.new(\"int[1]\")\n" "-- method: multicast_hops\n" -"if (VERSION_3_0) then\n" +"if (_M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.multicast_hops(self)\n" " \n" " local value1 = multicast_hops_value_tmp\n" @@ -2762,7 +2785,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_multicast_hops\n" -"if (VERSION_3_0) then\n" +"if (_M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.set_multicast_hops(self, value2)\n" " \n" " \n" @@ -2779,7 +2802,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local rcvtimeo_value_tmp = ffi.new(\"int[1]\")\n" "-- method: rcvtimeo\n" -"if (VERSION_3_0) then\n" +"if (_M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.rcvtimeo(self)\n" " \n" " local value1 = rcvtimeo_value_tmp\n" @@ -2794,7 +2817,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_rcvtimeo\n" -"if (VERSION_3_0) then\n" +"if (_M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.set_rcvtimeo(self, value2)\n" " \n" " \n" @@ -2811,7 +2834,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local sndtimeo_value_tmp = ffi.new(\"int[1]\")\n" "-- method: sndtimeo\n" -"if (VERSION_3_0) then\n" +"if (_M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.sndtimeo(self)\n" " \n" " local value1 = sndtimeo_value_tmp\n" @@ -2826,7 +2849,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_sndtimeo\n" -"if (VERSION_3_0) then\n" +"if (_M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.set_sndtimeo(self, value2)\n" " \n" " \n" @@ -2843,7 +2866,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "do\n" " local ipv4only_value_tmp = ffi.new(\"int[1]\")\n" "-- method: ipv4only\n" -"if (VERSION_3_0) then\n" +"if (_M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.ipv4only(self)\n" " \n" " local value1 = ipv4only_value_tmp\n" @@ -2858,7 +2881,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: set_ipv4only\n" -"if (VERSION_3_0) then\n" +"if (_M.VERSION_3_0) then\n" "function _meth.ZMQ_Socket.set_ipv4only(self, value2)\n" " \n" " \n" @@ -3109,7 +3132,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" "end\n" "\n" "-- method: device\n" -"if (VERSION_2_0) then\n" +"if (_M.VERSION_2_0) then\n" "function _M.device(device1, insock2, outsock3)\n" " \n" " \n" @@ -3138,8 +3161,7 @@ static const char zmq_ffi_lua_code[] = "local ffi=require\"ffi\"\n" " C.zmq_sleep(seconds_1)\n" " return \n" "end\n" -"\n" -""; +"\n", NULL }; static char *zmq_ZErrors_key = "zmq_ZErrors_key"; /* * This wrapper function is to make the EAGAIN/ETERM error messages more like @@ -5677,17 +5699,6 @@ static int zmq__sleep__func(lua_State *L) { return 0; } -/* method: dump_ffi */ -static int zmq__dump_ffi__func(lua_State *L) { - size_t ffi_code_len1 = 0; - const char * ffi_code1 = NULL; - ffi_code1 = zmq_ffi_lua_code; - ffi_code_len1 = sizeof(zmq_ffi_lua_code) - 1; - - if(ffi_code1 == NULL) lua_pushnil(L); else lua_pushlstring(L, ffi_code1,ffi_code_len1); - return 1; -} - static const luaL_reg obj_ZErrors_pub_funcs[] = { @@ -6436,7 +6447,6 @@ static const luaL_reg zmq_function[] = { #endif {"stopwatch_start", zmq__stopwatch_start__func}, {"sleep", zmq__sleep__func}, - {"dump_ffi", zmq__dump_ffi__func}, {NULL, NULL} }; diff --git a/zmq.nobj.lua b/zmq.nobj.lua index 095d0f2..1c5a6ab 100644 --- a/zmq.nobj.lua +++ b/zmq.nobj.lua @@ -220,16 +220,5 @@ c_function "stopwatch_start" { c_function "sleep" { c_call "void" "zmq_sleep" { "int", "seconds_" }, }, --- --- This dump function is for getting a copy of the FFI-based bindings code and is --- only for debugging. --- -c_function "dump_ffi" { - var_out{ "const char *", "ffi_code", has_length = true, }, - c_source[[ - ${ffi_code} = ${module_c_name}_ffi_lua_code; - ${ffi_code_len} = sizeof(${module_c_name}_ffi_lua_code) - 1; -]], -}, }