diff options
author | Christian Pointner <equinox@spreadspace.org> | 2011-03-29 23:28:52 +0000 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2011-03-29 23:28:52 +0000 |
commit | b48f6d21cf776ca4afa389a72dc37ce676624134 (patch) | |
tree | f8cf615af48ee7805f9e3cab85569f481cd71996 | |
parent | fixed control and rules file (diff) |
moved to lua-mq (mq)
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | config | 2 | ||||
-rw-r--r-- | debian/Makefile.Debian.conf | 43 | ||||
-rw-r--r-- | debian/compat | 1 | ||||
-rw-r--r-- | src/lua-mq.c (renamed from src/luamq.c) | 33 | ||||
-rwxr-xr-x | test.lua | 2 |
6 files changed, 64 insertions, 21 deletions
@@ -2,8 +2,8 @@ CONFIG= ./config include $(CONFIG) -OBJS= src/luamq.o -SRCS= src/luamq.h src/luamq.c +OBJS= src/lua-mq.o +SRCS= src/lua-mq.h src/lua-mq.c AR= ar rcu RANLIB= ranlib @@ -17,7 +17,7 @@ LIB_OPTION= -lrt -shared #for Linux V= 0.1 -LIBNAME= luamq.so +LIBNAME= lua-mq.so WARN= -Wall -Wmissing-prototypes -Wmissing-declarations -pedantic -fPIC INCS= -I$(LUA_INC) diff --git a/debian/Makefile.Debian.conf b/debian/Makefile.Debian.conf new file mode 100644 index 0000000..447860f --- /dev/null +++ b/debian/Makefile.Debian.conf @@ -0,0 +1,43 @@ +### $Id: Makefile.Debian.conf.sample 1398 2009-11-13 21:10:12Z gareuselesinge $ + +### mandatory fields +PKG_NAME=mq + +### things relative to the C library part +CLIB_CFLAGS= -I src/ +CLIB_LDFLAGS= +CLIB_LDFLAGS_STATIC= +CLIB_OBJS=src/luamq.lo +VERSION_INFO=0:1:0 +LUA_MODNAME_CPART= + +### things relative to the lua library part +LUA_HEADER= +LUA_SOURCES= +LUA_MODNAME=mq +LUA_TEST= + +### this part is relative to pkg-config +PKG_VERSION=$(shell dpkg-parsechangelog|grep ^Ver|cut -d ' ' -f 2|cut -d '-' -f 1) +PKG_LIBS_PRIVATE= +PKG_URL= +PKG_REQUIRES= +PKG_CONFLICTS= + +### this part is relative to debian libs naming policy +DEB_EXTRA_DASH= + +### In addition, to gather flexibility, you can set these hooks +### (called in this order) +pre-all-hook:: +post-all-hook:: +pre-test-hook:: +pre-lua-dynamic-test-hook:: +pre-dynamic-link-hook:: +pre-app-dynamic-test-hook:: +pre-static-link-hook:: +pre-app-static-test-hook:: +pre-install-hook:: +post-install-hook:: +pre-clean-hook:: +post-clean-hook:: diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/src/luamq.c b/src/lua-mq.c index 53677fb..2975d16 100644 --- a/src/luamq.c +++ b/src/lua-mq.c @@ -9,8 +9,7 @@ #include <stdlib.h> #define MQD_TYPENAME "mqd_t" - -LUALIB_API int luaopen_luamq(lua_State *L); +#include "lua-mq.h" static mode_t get_mode(const char* modestr) { @@ -41,7 +40,7 @@ static void push_errno(lua_State *L) lua_pushstring(L, "unknown error"); } -static int l_luamq_create(lua_State *L) +static int l_mq_create(lua_State *L) { mqd_t id, *ptr; int flags; @@ -62,7 +61,7 @@ static int l_luamq_create(lua_State *L) return 1; } -static int l_luamq_open(lua_State *L) +static int l_mq_open(lua_State *L) { mqd_t id, *ptr; int flags; @@ -80,7 +79,7 @@ static int l_luamq_open(lua_State *L) return 1; } -static int l_luamq_send(lua_State *L) +static int l_mq_send(lua_State *L) { mqd_t* id; unsigned int prio; @@ -100,7 +99,7 @@ static int l_luamq_send(lua_State *L) return 1; } -static int l_luamq_receive(lua_State *L) +static int l_mq_receive(lua_State *L) { mqd_t* id; unsigned int prio; @@ -137,7 +136,7 @@ static int l_luamq_receive(lua_State *L) return 2; } -static int l_luamq_close(lua_State *L) +static int l_mq_close(lua_State *L) { mqd_t* id; id = luaL_checkudata(L, 1, MQD_TYPENAME); @@ -151,7 +150,7 @@ static int l_luamq_close(lua_State *L) return 1; } -static int l_luamq_unlink(lua_State *L) +static int l_mq_unlink(lua_State *L) { if(mq_unlink(luaL_checkstring(L, 1))) { lua_pushnil(L); @@ -163,18 +162,18 @@ static int l_luamq_unlink(lua_State *L) return 1; } -static const struct luaL_reg luamq_funcs [] = { - { "create", l_luamq_create }, - { "open", l_luamq_open }, - { "send", l_luamq_send }, - { "receive", l_luamq_receive }, - { "close", l_luamq_close }, - { "unlink", l_luamq_unlink }, +static const struct luaL_reg mq_funcs [] = { + { "create", l_mq_create }, + { "open", l_mq_open }, + { "send", l_mq_send }, + { "receive", l_mq_receive }, + { "close", l_mq_close }, + { "unlink", l_mq_unlink }, { NULL, NULL } }; -LUALIB_API int luaopen_luamq(lua_State *L) +LUALIB_API int luaopen_mq(lua_State *L) { - luaL_register(L, "luamq", luamq_funcs); + luaL_register(L, "mq", mq_funcs); return 1; } @@ -1,6 +1,6 @@ #!/usr/bin/lua -mq = require "luamq" +mq = require "mq" q, err = mq.create("/nownext", "wo") if q == nil then |