From 309aad06ea60368c2fdf55ceb97b47a5254fbd9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Sun, 10 Nov 2013 16:14:01 +0100 Subject: [PATCH] 3rdparty: lua-nanomsg: Update to the latest nanomsg version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Petr Štetiar --- 3rdparty/lua-nanomsg/CMakeLists.txt | 1 + 3rdparty/lua-nanomsg/nanomsg.nobj.lua | 30 ++++++++++-------------------- 3rdparty/lua-nanomsg/src/socket.nobj.lua | 4 ++-- 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/3rdparty/lua-nanomsg/CMakeLists.txt b/3rdparty/lua-nanomsg/CMakeLists.txt index 46efb1a..14bfbf3 100755 --- a/3rdparty/lua-nanomsg/CMakeLists.txt +++ b/3rdparty/lua-nanomsg/CMakeLists.txt @@ -82,6 +82,7 @@ set(LUA_NANOMSG_SRC_LUA_MODS src/threads.lua ) +set(USE_PRE_GENERATED_BINDINGS 0) if(${USE_PRE_GENERATED_BINDINGS}) set(LUA_NANOMSG_SRC src/pre_generated-nanomsg.nobj.c) else() diff --git a/3rdparty/lua-nanomsg/nanomsg.nobj.lua b/3rdparty/lua-nanomsg/nanomsg.nobj.lua index 038ca63..e62b682 100644 --- a/3rdparty/lua-nanomsg/nanomsg.nobj.lua +++ b/3rdparty/lua-nanomsg/nanomsg.nobj.lua @@ -25,9 +25,9 @@ c_module "nanomsg" { -- module settings. use_globals = false, hide_meta_info = true, -luajit_ffi = true, +luajit_ffi = false, -- needed for functions exported from module. -luajit_ffi_load_cmodule = true, +luajit_ffi_load_cmodule = false, ffi_load { "nanomsg", -- default lib name. @@ -42,8 +42,7 @@ include "nanomsg/tcp.h", include "nanomsg/pair.h", include "nanomsg/pubsub.h", include "nanomsg/reqrep.h", -include "nanomsg/fanin.h", -include "nanomsg/fanout.h", +include "nanomsg/pipeline.h", include "nanomsg/survey.h", include "nanomsg/bus.h", @@ -74,8 +73,8 @@ BUS = "NN_BUS", -- pub/sub PUB = "NN_PUB", SUB = "NN_SUB", -SUBSCRIBE = "NN_SUBSCRIBE", -UNSUBSCRIBE = "NN_UNSUBSCRIBE", +SUB_SUBSCRIBE = "NN_SUB_SUBSCRIBE", +SUB_UNSUBSCRIBE = "NN_SUB_UNSUBSCRIBE", -- req/resp REQ = "NN_REQ", @@ -87,14 +86,10 @@ SURVEY = "NN_SURVEY", RESPONDENT = "NN_RESPONDENT", DEADLINE = "NN_DEADLINE", - -- fanout + -- pipeline PUSH = "NN_PUSH", PULL = "NN_PULL", - -- fanout -SOURCE = "NN_SOURCE", -SINK = "NN_SINK", - -- socket options levels SOL_SOCKET = "NN_SOL_SOCKET", @@ -122,7 +117,7 @@ subfiles { "src/error.nobj.lua", "src/msg.nobj.lua", "src/socket.nobj.lua", -"src/stopwatch.nobj.lua", +-- "src/stopwatch.nobj.lua", }, -- @@ -132,7 +127,9 @@ c_function "version" { var_out{ "", "ver" }, c_source[[ int major, minor, patch; - nn_version(&(major), &(minor), &(patch)); + nn_symbol(NN_VERSION_CURRENT, &major); + nn_symbol(NN_VERSION_REVISION, &minor); + nn_symbol(NN_VERSION_AGE, &patch); /* return version as a table: { major, minor, patch } */ lua_createtable(L, 3, 0); @@ -154,12 +151,5 @@ c_function "socket" { c_call "!NN_Socket" "nn_socket" { "int", "domain", "int", "protocol" } }, -include "nanomsg/utils/sleep.h", -c_function "sleep" { - var_in{ "double", "seconds_" }, - c_source[[ - nn_sleep(${seconds_} * 1000); -]], -}, } diff --git a/3rdparty/lua-nanomsg/src/socket.nobj.lua b/3rdparty/lua-nanomsg/src/socket.nobj.lua index 0c562e0..fe37ce3 100644 --- a/3rdparty/lua-nanomsg/src/socket.nobj.lua +++ b/3rdparty/lua-nanomsg/src/socket.nobj.lua @@ -54,8 +54,8 @@ local socket_options = { { name="domain", otype="INT", mode="rw", ltype="int" }, { name="protocol", otype="INT", mode="rw", ltype="int" }, - { name="subscribe", otype="BLOB", mode="w", ltype="const char *", level = "SUB" }, - { name="unsubscribe", otype="BLOB", mode="w", ltype="const char *", level = "SUB" }, + { name="sub_subscribe", otype="BLOB", mode="w", ltype="const char *", level = "SUB" }, + { name="sub_unsubscribe", otype="BLOB", mode="w", ltype="const char *", level = "SUB" }, }, } -- 1.7.9.5