From 9839659de3f7d8e8827af776d23efe15627c7d3e Mon Sep 17 00:00:00 2001 From: Martin Lucina Date: Mon, 21 May 2012 13:44:02 +0200 Subject: Fixes a conflict with XenStore (see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=668550) Signed-off-by: Martin Lucina --- doc/xs.txt | 2 +- include/xs.h | 323 -------------------------------------------------- include/xs/xs.h | 323 ++++++++++++++++++++++++++++++++++++++++++++++++++ perf/inproc_lat.cpp | 2 +- perf/inproc_thr.cpp | 2 +- perf/local_lat.cpp | 2 +- perf/local_thr.cpp | 2 +- perf/remote_lat.cpp | 2 +- perf/remote_thr.cpp | 2 +- src/Makefile.am | 8 +- src/core.cpp | 2 +- src/ctx.hpp | 2 +- src/err.hpp | 2 +- src/msg.cpp | 2 +- src/object.hpp | 2 +- src/options.cpp | 2 +- src/precompiled.hpp | 2 +- src/prefix_filter.cpp | 2 +- src/sub.hpp | 2 +- src/upoll.hpp | 2 +- src/xpub.cpp | 2 +- src/xpub.hpp | 2 +- src/xsub.hpp | 2 +- src/xszmq.cpp | 2 +- tests/testutil.hpp | 2 +- version.sh | 12 +- 26 files changed, 355 insertions(+), 355 deletions(-) delete mode 100644 include/xs.h create mode 100644 include/xs/xs.h diff --git a/doc/xs.txt b/doc/xs.txt index d417456..4df3fee 100644 --- a/doc/xs.txt +++ b/doc/xs.txt @@ -9,7 +9,7 @@ xs - Crossroads I/O, a lightweight messaging layer SYNOPSIS -------- -*#include * +*#include * *cc* ['flags'] 'files' *-lxs* ['libraries'] diff --git a/include/xs.h b/include/xs.h deleted file mode 100644 index 56efa52..0000000 --- a/include/xs.h +++ /dev/null @@ -1,323 +0,0 @@ -/* - Copyright (c) 2009-2012 250bpm s.r.o. - Copyright (c) 2007-2010 iMatix Corporation - Copyright (c) 2011 VMware, Inc. - Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file - - This file is part of Crossroads I/O project. - - Crossroads I/O is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - Crossroads is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . -*/ - -#ifndef __XS_H_INCLUDED__ -#define __XS_H_INCLUDED__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#if defined _WIN32 -#include -#endif - -/* Handle DSO symbol visibility */ -#if defined _WIN32 -# if defined DLL_EXPORT -# define XS_EXPORT __declspec(dllexport) -# else -# define XS_EXPORT __declspec(dllimport) -# endif -#else -# if defined __SUNPRO_C || defined __SUNPRO_CC -# define XS_EXPORT __global -# elif (defined __GNUC__ && __GNUC__ >= 4) || defined __INTEL_COMPILER -# define XS_EXPORT __attribute__ ((visibility("default"))) -# else -# define XS_EXPORT -# endif -#endif - -/******************************************************************************/ -/* Crossroads versioning support. */ -/******************************************************************************/ - -/* Version macros for compile-time API version detection */ -#define XS_VERSION_MAJOR 1 -#define XS_VERSION_MINOR 1 -#define XS_VERSION_PATCH 0 - -#define XS_MAKE_VERSION(major, minor, patch) \ - ((major) * 10000 + (minor) * 100 + (patch)) -#define XS_VERSION \ - XS_MAKE_VERSION(XS_VERSION_MAJOR, XS_VERSION_MINOR, XS_VERSION_PATCH) - -/* Run-time API version detection */ -XS_EXPORT void xs_version (int *major, int *minor, int *patch); - -/******************************************************************************/ -/* Crossroads errors. */ -/******************************************************************************/ - -/* A number random enough not to collide with different errno ranges on */ -/* different OSes. The assumption is that error_t is at least 32-bit type. */ -#define XS_HAUSNUMERO 156384712 - -/* On Windows platform some of the standard POSIX errnos are not defined. */ -#ifndef ENOTSUP -#define ENOTSUP (XS_HAUSNUMERO + 1) -#endif -#ifndef EPROTONOSUPPORT -#define EPROTONOSUPPORT (XS_HAUSNUMERO + 2) -#endif -#ifndef ENOBUFS -#define ENOBUFS (XS_HAUSNUMERO + 3) -#endif -#ifndef ENETDOWN -#define ENETDOWN (XS_HAUSNUMERO + 4) -#endif -#ifndef EADDRINUSE -#define EADDRINUSE (XS_HAUSNUMERO + 5) -#endif -#ifndef EADDRNOTAVAIL -#define EADDRNOTAVAIL (XS_HAUSNUMERO + 6) -#endif -#ifndef ECONNREFUSED -#define ECONNREFUSED (XS_HAUSNUMERO + 7) -#endif -#ifndef EINPROGRESS -#define EINPROGRESS (XS_HAUSNUMERO + 8) -#endif -#ifndef ENOTSOCK -#define ENOTSOCK (XS_HAUSNUMERO + 9) -#endif -#ifndef EAFNOSUPPORT -#define EAFNOSUPPORT (XS_HAUSNUMERO + 10) -#endif - -/* Native Crossroads error codes. */ -#define EFSM (XS_HAUSNUMERO + 51) -#define ENOCOMPATPROTO (XS_HAUSNUMERO + 52) -#define ETERM (XS_HAUSNUMERO + 53) -#define EMTHREAD (XS_HAUSNUMERO + 54) /* Kept for backward compatibility. */ - /* Not used anymore. */ - -/* This function retrieves the errno as it is known to Crossroads library. */ -/* The goal of this function is to make the code 100% portable, including */ -/* where Crossroads are compiled with certain CRT library (on Windows) is */ -/* linked to an application that uses different CRT library. */ -XS_EXPORT int xs_errno (void); - -/* Resolves system errors and Crossroads errors to human-readable string. */ -XS_EXPORT const char *xs_strerror (int errnum); - -/******************************************************************************/ -/* Crossroads message definition. */ -/******************************************************************************/ - -typedef struct {unsigned char _ [32];} xs_msg_t; - -typedef void (xs_free_fn) (void *data, void *hint); - -XS_EXPORT int xs_msg_init (xs_msg_t *msg); -XS_EXPORT int xs_msg_init_size (xs_msg_t *msg, size_t size); -XS_EXPORT int xs_msg_init_data (xs_msg_t *msg, void *data, - size_t size, xs_free_fn *ffn, void *hint); -XS_EXPORT int xs_msg_close (xs_msg_t *msg); -XS_EXPORT int xs_msg_move (xs_msg_t *dest, xs_msg_t *src); -XS_EXPORT int xs_msg_copy (xs_msg_t *dest, xs_msg_t *src); -XS_EXPORT void *xs_msg_data (xs_msg_t *msg); -XS_EXPORT size_t xs_msg_size (xs_msg_t *msg); -XS_EXPORT int xs_getmsgopt (xs_msg_t *msg, int option, void *optval, - size_t *optvallen); - -/******************************************************************************/ -/* Crossroads context definition. */ -/******************************************************************************/ - -#define XS_MAX_SOCKETS 1 -#define XS_IO_THREADS 2 -#define XS_PLUGIN 3 - -XS_EXPORT void *xs_init (void); -XS_EXPORT int xs_term (void *context); -XS_EXPORT int xs_setctxopt (void *context, int option, const void *optval, - size_t optvallen); - -/******************************************************************************/ -/* Crossroads socket definition. */ -/******************************************************************************/ - -/* Socket types. */ -#define XS_PAIR 0 -#define XS_PUB 1 -#define XS_SUB 2 -#define XS_REQ 3 -#define XS_REP 4 -#define XS_XREQ 5 -#define XS_XREP 6 -#define XS_PULL 7 -#define XS_PUSH 8 -#define XS_XPUB 9 -#define XS_XSUB 10 -#define XS_SURVEYOR 11 -#define XS_RESPONDENT 12 -#define XS_XSURVEYOR 13 -#define XS_XRESPONDENT 14 - -/* Legacy socket type aliases. */ -#define XS_ROUTER XS_XREP -#define XS_DEALER XS_XREQ - -/* Socket options. */ -#define XS_AFFINITY 4 -#define XS_IDENTITY 5 -#define XS_SUBSCRIBE 6 -#define XS_UNSUBSCRIBE 7 -#define XS_RATE 8 -#define XS_RECOVERY_IVL 9 -#define XS_SNDBUF 11 -#define XS_RCVBUF 12 -#define XS_RCVMORE 13 -#define XS_FD 14 -#define XS_EVENTS 15 -#define XS_TYPE 16 -#define XS_LINGER 17 -#define XS_RECONNECT_IVL 18 -#define XS_BACKLOG 19 -#define XS_RECONNECT_IVL_MAX 21 -#define XS_MAXMSGSIZE 22 -#define XS_SNDHWM 23 -#define XS_RCVHWM 24 -#define XS_MULTICAST_HOPS 25 -#define XS_RCVTIMEO 27 -#define XS_SNDTIMEO 28 -#define XS_IPV4ONLY 31 -#define XS_KEEPALIVE 32 -#define XS_PROTOCOL 33 -#define XS_SURVEY_TIMEOUT 35 - -/* Message options */ -#define XS_MORE 1 - -/* Send/recv options. */ -#define XS_DONTWAIT 1 -#define XS_SNDMORE 2 - -XS_EXPORT void *xs_socket (void *context, int type); -XS_EXPORT int xs_close (void *s); -XS_EXPORT int xs_setsockopt (void *s, int option, const void *optval, - size_t optvallen); -XS_EXPORT int xs_getsockopt (void *s, int option, void *optval, - size_t *optvallen); -XS_EXPORT int xs_bind (void *s, const char *addr); -XS_EXPORT int xs_connect (void *s, const char *addr); -XS_EXPORT int xs_shutdown (void *s, int how); -XS_EXPORT int xs_send (void *s, const void *buf, size_t len, int flags); -XS_EXPORT int xs_recv (void *s, void *buf, size_t len, int flags); -XS_EXPORT int xs_sendmsg (void *s, xs_msg_t *msg, int flags); -XS_EXPORT int xs_recvmsg (void *s, xs_msg_t *msg, int flags); - -/******************************************************************************/ -/* I/O multiplexing. */ -/******************************************************************************/ - -#define XS_POLLIN 1 -#define XS_POLLOUT 2 -#define XS_POLLERR 4 - -typedef struct -{ - void *socket; -#if defined _WIN32 - SOCKET fd; -#else - int fd; -#endif - short events; - short revents; -} xs_pollitem_t; - -XS_EXPORT int xs_poll (xs_pollitem_t *items, int nitems, int timeout); - -/******************************************************************************/ -/* The following utility functions are exported for use from language */ -/* bindings in performance tests, for the purpose of consistent results in */ -/* such tests. They are not considered part of the core XS API per se, */ -/* use at your own risk! */ -/******************************************************************************/ - -/* Starts the stopwatch. Returns the handle to the watch. */ -XS_EXPORT void *xs_stopwatch_start (void); - -/* Stops the stopwatch. Returns the number of microseconds elapsed since */ -/* the stopwatch was started. */ -XS_EXPORT unsigned long xs_stopwatch_stop (void *watch); - -/******************************************************************************/ -/* The API for pluggable filters. */ -/* THIS IS EXPERIMENTAL WORK AND MAY CHANGE WITHOUT PRIOR NOTICE. */ -/******************************************************************************/ - -#define XS_FILTER 34 - -#define XS_PLUGIN_FILTER 1 - -#define XS_FILTER_ALL 0 -#define XS_FILTER_PREFIX 1 - -typedef struct -{ - int type; - int version; - - int (*id) (void *core); - void *(*pf_create) (void *core); - void (*pf_destroy) (void *core, void *pf); - int (*pf_subscribe) (void *core, void *pf, void *subscriber, - const unsigned char *data, size_t size); - int (*pf_unsubscribe) (void *core, void *pf, void *subscriber, - const unsigned char *data, size_t size); - void (*pf_unsubscribe_all) (void *core, void *pf, void *subscriber); - void (*pf_match) (void *core, void *pf, - const unsigned char *data, size_t size); - - void *(*sf_create) (void *core); - void (*sf_destroy) (void *core, void *sf); - int (*sf_subscribe) (void *core, void *sf, - const unsigned char *data, size_t size); - int (*sf_unsubscribe) (void *core, void *sf, - const unsigned char *data, size_t size); - int (*sf_match) (void *core, void *sf, - const unsigned char *data, size_t size); - -} xs_filter_t; - -XS_EXPORT int xs_filter_subscribed (void *core, - const unsigned char *data, size_t size); - -XS_EXPORT int xs_filter_unsubscribed (void *core, - const unsigned char *data, size_t size); - -XS_EXPORT int xs_filter_matching (void *core, void *subscriber); - -#undef XS_EXPORT - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/include/xs/xs.h b/include/xs/xs.h new file mode 100644 index 0000000..56efa52 --- /dev/null +++ b/include/xs/xs.h @@ -0,0 +1,323 @@ +/* + Copyright (c) 2009-2012 250bpm s.r.o. + Copyright (c) 2007-2010 iMatix Corporation + Copyright (c) 2011 VMware, Inc. + Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file + + This file is part of Crossroads I/O project. + + Crossroads I/O is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + Crossroads is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . +*/ + +#ifndef __XS_H_INCLUDED__ +#define __XS_H_INCLUDED__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#if defined _WIN32 +#include +#endif + +/* Handle DSO symbol visibility */ +#if defined _WIN32 +# if defined DLL_EXPORT +# define XS_EXPORT __declspec(dllexport) +# else +# define XS_EXPORT __declspec(dllimport) +# endif +#else +# if defined __SUNPRO_C || defined __SUNPRO_CC +# define XS_EXPORT __global +# elif (defined __GNUC__ && __GNUC__ >= 4) || defined __INTEL_COMPILER +# define XS_EXPORT __attribute__ ((visibility("default"))) +# else +# define XS_EXPORT +# endif +#endif + +/******************************************************************************/ +/* Crossroads versioning support. */ +/******************************************************************************/ + +/* Version macros for compile-time API version detection */ +#define XS_VERSION_MAJOR 1 +#define XS_VERSION_MINOR 1 +#define XS_VERSION_PATCH 0 + +#define XS_MAKE_VERSION(major, minor, patch) \ + ((major) * 10000 + (minor) * 100 + (patch)) +#define XS_VERSION \ + XS_MAKE_VERSION(XS_VERSION_MAJOR, XS_VERSION_MINOR, XS_VERSION_PATCH) + +/* Run-time API version detection */ +XS_EXPORT void xs_version (int *major, int *minor, int *patch); + +/******************************************************************************/ +/* Crossroads errors. */ +/******************************************************************************/ + +/* A number random enough not to collide with different errno ranges on */ +/* different OSes. The assumption is that error_t is at least 32-bit type. */ +#define XS_HAUSNUMERO 156384712 + +/* On Windows platform some of the standard POSIX errnos are not defined. */ +#ifndef ENOTSUP +#define ENOTSUP (XS_HAUSNUMERO + 1) +#endif +#ifndef EPROTONOSUPPORT +#define EPROTONOSUPPORT (XS_HAUSNUMERO + 2) +#endif +#ifndef ENOBUFS +#define ENOBUFS (XS_HAUSNUMERO + 3) +#endif +#ifndef ENETDOWN +#define ENETDOWN (XS_HAUSNUMERO + 4) +#endif +#ifndef EADDRINUSE +#define EADDRINUSE (XS_HAUSNUMERO + 5) +#endif +#ifndef EADDRNOTAVAIL +#define EADDRNOTAVAIL (XS_HAUSNUMERO + 6) +#endif +#ifndef ECONNREFUSED +#define ECONNREFUSED (XS_HAUSNUMERO + 7) +#endif +#ifndef EINPROGRESS +#define EINPROGRESS (XS_HAUSNUMERO + 8) +#endif +#ifndef ENOTSOCK +#define ENOTSOCK (XS_HAUSNUMERO + 9) +#endif +#ifndef EAFNOSUPPORT +#define EAFNOSUPPORT (XS_HAUSNUMERO + 10) +#endif + +/* Native Crossroads error codes. */ +#define EFSM (XS_HAUSNUMERO + 51) +#define ENOCOMPATPROTO (XS_HAUSNUMERO + 52) +#define ETERM (XS_HAUSNUMERO + 53) +#define EMTHREAD (XS_HAUSNUMERO + 54) /* Kept for backward compatibility. */ + /* Not used anymore. */ + +/* This function retrieves the errno as it is known to Crossroads library. */ +/* The goal of this function is to make the code 100% portable, including */ +/* where Crossroads are compiled with certain CRT library (on Windows) is */ +/* linked to an application that uses different CRT library. */ +XS_EXPORT int xs_errno (void); + +/* Resolves system errors and Crossroads errors to human-readable string. */ +XS_EXPORT const char *xs_strerror (int errnum); + +/******************************************************************************/ +/* Crossroads message definition. */ +/******************************************************************************/ + +typedef struct {unsigned char _ [32];} xs_msg_t; + +typedef void (xs_free_fn) (void *data, void *hint); + +XS_EXPORT int xs_msg_init (xs_msg_t *msg); +XS_EXPORT int xs_msg_init_size (xs_msg_t *msg, size_t size); +XS_EXPORT int xs_msg_init_data (xs_msg_t *msg, void *data, + size_t size, xs_free_fn *ffn, void *hint); +XS_EXPORT int xs_msg_close (xs_msg_t *msg); +XS_EXPORT int xs_msg_move (xs_msg_t *dest, xs_msg_t *src); +XS_EXPORT int xs_msg_copy (xs_msg_t *dest, xs_msg_t *src); +XS_EXPORT void *xs_msg_data (xs_msg_t *msg); +XS_EXPORT size_t xs_msg_size (xs_msg_t *msg); +XS_EXPORT int xs_getmsgopt (xs_msg_t *msg, int option, void *optval, + size_t *optvallen); + +/******************************************************************************/ +/* Crossroads context definition. */ +/******************************************************************************/ + +#define XS_MAX_SOCKETS 1 +#define XS_IO_THREADS 2 +#define XS_PLUGIN 3 + +XS_EXPORT void *xs_init (void); +XS_EXPORT int xs_term (void *context); +XS_EXPORT int xs_setctxopt (void *context, int option, const void *optval, + size_t optvallen); + +/******************************************************************************/ +/* Crossroads socket definition. */ +/******************************************************************************/ + +/* Socket types. */ +#define XS_PAIR 0 +#define XS_PUB 1 +#define XS_SUB 2 +#define XS_REQ 3 +#define XS_REP 4 +#define XS_XREQ 5 +#define XS_XREP 6 +#define XS_PULL 7 +#define XS_PUSH 8 +#define XS_XPUB 9 +#define XS_XSUB 10 +#define XS_SURVEYOR 11 +#define XS_RESPONDENT 12 +#define XS_XSURVEYOR 13 +#define XS_XRESPONDENT 14 + +/* Legacy socket type aliases. */ +#define XS_ROUTER XS_XREP +#define XS_DEALER XS_XREQ + +/* Socket options. */ +#define XS_AFFINITY 4 +#define XS_IDENTITY 5 +#define XS_SUBSCRIBE 6 +#define XS_UNSUBSCRIBE 7 +#define XS_RATE 8 +#define XS_RECOVERY_IVL 9 +#define XS_SNDBUF 11 +#define XS_RCVBUF 12 +#define XS_RCVMORE 13 +#define XS_FD 14 +#define XS_EVENTS 15 +#define XS_TYPE 16 +#define XS_LINGER 17 +#define XS_RECONNECT_IVL 18 +#define XS_BACKLOG 19 +#define XS_RECONNECT_IVL_MAX 21 +#define XS_MAXMSGSIZE 22 +#define XS_SNDHWM 23 +#define XS_RCVHWM 24 +#define XS_MULTICAST_HOPS 25 +#define XS_RCVTIMEO 27 +#define XS_SNDTIMEO 28 +#define XS_IPV4ONLY 31 +#define XS_KEEPALIVE 32 +#define XS_PROTOCOL 33 +#define XS_SURVEY_TIMEOUT 35 + +/* Message options */ +#define XS_MORE 1 + +/* Send/recv options. */ +#define XS_DONTWAIT 1 +#define XS_SNDMORE 2 + +XS_EXPORT void *xs_socket (void *context, int type); +XS_EXPORT int xs_close (void *s); +XS_EXPORT int xs_setsockopt (void *s, int option, const void *optval, + size_t optvallen); +XS_EXPORT int xs_getsockopt (void *s, int option, void *optval, + size_t *optvallen); +XS_EXPORT int xs_bind (void *s, const char *addr); +XS_EXPORT int xs_connect (void *s, const char *addr); +XS_EXPORT int xs_shutdown (void *s, int how); +XS_EXPORT int xs_send (void *s, const void *buf, size_t len, int flags); +XS_EXPORT int xs_recv (void *s, void *buf, size_t len, int flags); +XS_EXPORT int xs_sendmsg (void *s, xs_msg_t *msg, int flags); +XS_EXPORT int xs_recvmsg (void *s, xs_msg_t *msg, int flags); + +/******************************************************************************/ +/* I/O multiplexing. */ +/******************************************************************************/ + +#define XS_POLLIN 1 +#define XS_POLLOUT 2 +#define XS_POLLERR 4 + +typedef struct +{ + void *socket; +#if defined _WIN32 + SOCKET fd; +#else + int fd; +#endif + short events; + short revents; +} xs_pollitem_t; + +XS_EXPORT int xs_poll (xs_pollitem_t *items, int nitems, int timeout); + +/******************************************************************************/ +/* The following utility functions are exported for use from language */ +/* bindings in performance tests, for the purpose of consistent results in */ +/* such tests. They are not considered part of the core XS API per se, */ +/* use at your own risk! */ +/******************************************************************************/ + +/* Starts the stopwatch. Returns the handle to the watch. */ +XS_EXPORT void *xs_stopwatch_start (void); + +/* Stops the stopwatch. Returns the number of microseconds elapsed since */ +/* the stopwatch was started. */ +XS_EXPORT unsigned long xs_stopwatch_stop (void *watch); + +/******************************************************************************/ +/* The API for pluggable filters. */ +/* THIS IS EXPERIMENTAL WORK AND MAY CHANGE WITHOUT PRIOR NOTICE. */ +/******************************************************************************/ + +#define XS_FILTER 34 + +#define XS_PLUGIN_FILTER 1 + +#define XS_FILTER_ALL 0 +#define XS_FILTER_PREFIX 1 + +typedef struct +{ + int type; + int version; + + int (*id) (void *core); + void *(*pf_create) (void *core); + void (*pf_destroy) (void *core, void *pf); + int (*pf_subscribe) (void *core, void *pf, void *subscriber, + const unsigned char *data, size_t size); + int (*pf_unsubscribe) (void *core, void *pf, void *subscriber, + const unsigned char *data, size_t size); + void (*pf_unsubscribe_all) (void *core, void *pf, void *subscriber); + void (*pf_match) (void *core, void *pf, + const unsigned char *data, size_t size); + + void *(*sf_create) (void *core); + void (*sf_destroy) (void *core, void *sf); + int (*sf_subscribe) (void *core, void *sf, + const unsigned char *data, size_t size); + int (*sf_unsubscribe) (void *core, void *sf, + const unsigned char *data, size_t size); + int (*sf_match) (void *core, void *sf, + const unsigned char *data, size_t size); + +} xs_filter_t; + +XS_EXPORT int xs_filter_subscribed (void *core, + const unsigned char *data, size_t size); + +XS_EXPORT int xs_filter_unsubscribed (void *core, + const unsigned char *data, size_t size); + +XS_EXPORT int xs_filter_matching (void *core, void *subscriber); + +#undef XS_EXPORT + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/perf/inproc_lat.cpp b/perf/inproc_lat.cpp index 54973db..d4f97f5 100644 --- a/perf/inproc_lat.cpp +++ b/perf/inproc_lat.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . */ -#include "../include/xs.h" +#include "../include/xs/xs.h" #include #include diff --git a/perf/inproc_thr.cpp b/perf/inproc_thr.cpp index 570d87e..905c2be 100644 --- a/perf/inproc_thr.cpp +++ b/perf/inproc_thr.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . */ -#include "../include/xs.h" +#include "../include/xs/xs.h" #include #include diff --git a/perf/local_lat.cpp b/perf/local_lat.cpp index 1fcf3f4..57d05af 100644 --- a/perf/local_lat.cpp +++ b/perf/local_lat.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . */ -#include "../include/xs.h" +#include "../include/xs/xs.h" #include #include diff --git a/perf/local_thr.cpp b/perf/local_thr.cpp index 5a9e6f1..a70491c 100644 --- a/perf/local_thr.cpp +++ b/perf/local_thr.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . */ -#include "../include/xs.h" +#include "../include/xs/xs.h" #include #include diff --git a/perf/remote_lat.cpp b/perf/remote_lat.cpp index 6aaf1e9..483400c 100644 --- a/perf/remote_lat.cpp +++ b/perf/remote_lat.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . */ -#include "../include/xs.h" +#include "../include/xs/xs.h" #include #include #include diff --git a/perf/remote_thr.cpp b/perf/remote_thr.cpp index b93c4d7..91f61b6 100644 --- a/perf/remote_thr.cpp +++ b/perf/remote_thr.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . */ -#include "../include/xs.h" +#include "../include/xs/xs.h" #include #include #include diff --git a/src/Makefile.am b/src/Makefile.am index 390dc50..8c3de7c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,16 +5,16 @@ lib_LTLIBRARIES = libxs.la libzmq.la pkgconfig_DATA = libxs.pc libzmq.pc -include_HEADERS = ../include/xs.h \ - ../include/zmq.h ../include/zmq_utils.h +include_HEADERS = ../include/zmq.h ../include/zmq_utils.h else lib_LTLIBRARIES = libxs.la pkgconfig_DATA = libxs.pc - -include_HEADERS = ../include/xs.h endif +xsincludedir = $(includedir)/xs +xsinclude_HEADERS = ../include/xs/xs.h + libxs_la_SOURCES = \ address.hpp \ array.hpp \ diff --git a/src/core.cpp b/src/core.cpp index 2d16167..ea80791 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -18,7 +18,7 @@ along with this program. If not, see . */ -#include "../include/xs.h" +#include "../include/xs/xs.h" #include "core.hpp" #include "err.hpp" diff --git a/src/ctx.hpp b/src/ctx.hpp index 8e2fd03..24e879d 100644 --- a/src/ctx.hpp +++ b/src/ctx.hpp @@ -26,7 +26,7 @@ #include #include -#include "../include/xs.h" +#include "../include/xs/xs.h" #include "mailbox.hpp" #include "array.hpp" diff --git a/src/err.hpp b/src/err.hpp index 64ab545..28b3303 100644 --- a/src/err.hpp +++ b/src/err.hpp @@ -23,7 +23,7 @@ #define __XS_ERR_HPP_INCLUDED__ // Crossroads-specific error codes are defined in xs.h -#include "../include/xs.h" +#include "../include/xs/xs.h" #include #include diff --git a/src/msg.cpp b/src/msg.cpp index aa6960d..3b97366 100644 --- a/src/msg.cpp +++ b/src/msg.cpp @@ -20,7 +20,7 @@ */ #include "msg.hpp" -#include "../include/xs.h" +#include "../include/xs/xs.h" #include #include diff --git a/src/object.hpp b/src/object.hpp index b695308..fe3c510 100644 --- a/src/object.hpp +++ b/src/object.hpp @@ -22,7 +22,7 @@ #ifndef __XS_OBJECT_HPP_INCLUDED__ #define __XS_OBJECT_HPP_INCLUDED__ -#include "../include/xs.h" +#include "../include/xs/xs.h" #include "stdint.hpp" diff --git a/src/options.cpp b/src/options.cpp index f7bbdc4..62c03a2 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -23,7 +23,7 @@ #include #include -#include "../include/xs.h" +#include "../include/xs/xs.h" #include "options.hpp" #include "err.hpp" diff --git a/src/precompiled.hpp b/src/precompiled.hpp index 8ae2246..c77b4c5 100644 --- a/src/precompiled.hpp +++ b/src/precompiled.hpp @@ -40,7 +40,7 @@ #include // Crossroads definitions and exported functions -#include "../include/xs.h" +#include "../include/xs/xs.h" #endif // _MSC_VER diff --git a/src/prefix_filter.cpp b/src/prefix_filter.cpp index 5f1a72a..06a77f5 100644 --- a/src/prefix_filter.cpp +++ b/src/prefix_filter.cpp @@ -24,7 +24,7 @@ #include #include -#include "../include/xs.h" +#include "../include/xs/xs.h" #include "prefix_filter.hpp" #include "err.hpp" diff --git a/src/sub.hpp b/src/sub.hpp index c50c0bd..0519af5 100644 --- a/src/sub.hpp +++ b/src/sub.hpp @@ -24,7 +24,7 @@ #include -#include "../include/xs.h" +#include "../include/xs/xs.h" #include "xsub.hpp" #include "core.hpp" diff --git a/src/upoll.hpp b/src/upoll.hpp index d08cf5e..dbb5077 100644 --- a/src/upoll.hpp +++ b/src/upoll.hpp @@ -21,7 +21,7 @@ #ifndef __XS_UPOLL_HPP_INCLUDED__ #define __XS_UPOLL_HPP_INCLUDED__ -#include "../include/xs.h" +#include "../include/xs/xs.h" namespace xs { diff --git a/src/xpub.cpp b/src/xpub.cpp index fe0b9a7..fbb45fb 100644 --- a/src/xpub.cpp +++ b/src/xpub.cpp @@ -21,7 +21,7 @@ #include -#include "../include/xs.h" +#include "../include/xs/xs.h" #include "xpub.hpp" #include "pipe.hpp" diff --git a/src/xpub.hpp b/src/xpub.hpp index c0e47ff..c76f03c 100644 --- a/src/xpub.hpp +++ b/src/xpub.hpp @@ -21,7 +21,7 @@ #ifndef __XS_XPUB_HPP_INCLUDED__ #define __XS_XPUB_HPP_INCLUDED__ -#include "../include/xs.h" +#include "../include/xs/xs.h" #include #include diff --git a/src/xsub.hpp b/src/xsub.hpp index 5bc11c4..0cf81b5 100644 --- a/src/xsub.hpp +++ b/src/xsub.hpp @@ -23,7 +23,7 @@ #include -#include "../include/xs.h" +#include "../include/xs/xs.h" #include "socket_base.hpp" #include "session_base.hpp" diff --git a/src/xszmq.cpp b/src/xszmq.cpp index f6e6fa1..21db52c 100644 --- a/src/xszmq.cpp +++ b/src/xszmq.cpp @@ -22,7 +22,7 @@ #include "../include/zmq.h" #include "../include/zmq_utils.h" -#include "../include/xs.h" +#include "../include/xs/xs.h" #include "platform.hpp" diff --git a/tests/testutil.hpp b/tests/testutil.hpp index 58f1afd..b6a55a2 100644 --- a/tests/testutil.hpp +++ b/tests/testutil.hpp @@ -28,7 +28,7 @@ #include #include -#include "../include/xs.h" +#include "../include/xs/xs.h" #include "../src/platform.hpp" #if !defined XS_HAVE_WINDOWS diff --git a/version.sh b/version.sh index 23c453f..569b53a 100755 --- a/version.sh +++ b/version.sh @@ -3,15 +3,15 @@ # This script extracts the Crossroads version from include/xs.h, # which is the master location for this information. # -if [ ! -f include/xs.h ]; then - echo "version.sh: error: include/xs.h does not exist" 1>&2 +if [ ! -f include/xs/xs.h ]; then + echo "version.sh: error: include/xs/xs.h does not exist" 1>&2 exit 1 fi -MAJOR=`egrep '^#define +XS_VERSION_MAJOR +[0-9]+$' include/xs.h` -MINOR=`egrep '^#define +XS_VERSION_MINOR +[0-9]+$' include/xs.h` -PATCH=`egrep '^#define +XS_VERSION_PATCH +[0-9]+$' include/xs.h` +MAJOR=`egrep '^#define +XS_VERSION_MAJOR +[0-9]+$' include/xs/xs.h` +MINOR=`egrep '^#define +XS_VERSION_MINOR +[0-9]+$' include/xs/xs.h` +PATCH=`egrep '^#define +XS_VERSION_PATCH +[0-9]+$' include/xs/xs.h` if [ -z "$MAJOR" -o -z "$MINOR" -o -z "$PATCH" ]; then - echo "version.sh: error: could not extract version from include/xs.h" 1>&2 + echo "version.sh: error: could not extract version from include/xs/xs.h" 1>&2 exit 1 fi MAJOR=`echo $MAJOR | awk '{ print $3 }'` -- cgit v1.2.3