[PATCH 46/50] [unit tests] Fixed unit tests build
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
Signed-off-by: Mike Schonberg <mschonberg@...> --- mama/c_cpp/src/gunittest/c/Makefile.am | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/mama/c_cpp/src/gunittest/c/Makefile.am b/mama/c_cpp/src/gunittest/c/Makefile.am index abbfee9..13b5915 100644 --- a/mama/c_cpp/src/gunittest/c/Makefile.am +++ b/mama/c_cpp/src/gunittest/c/Makefile.am @@ -29,13 +29,16 @@ CFLAGS += -pedantic -Wno-long-long -O2 -pthread -fPIC CPPFLAGS += -pedantic -Wno-long-long -O2 -pthread -fPIC endif -INCLUDES = -I$(srcdir)/.. -I$(srcdir)/../.. -I$(srcdir)/../../../examples +INCLUDES = -I$(srcdir)/.. -I$(srcdir)/../.. -I$(srcdir)/../../../examples -I$(srcdir)/../../../../../common/c_cpp/src/c CFLAGS += -I@builddir@/../../c CPPFLAGS += -I@builddir@/../../c -LIBS = -lmama -lwombatcommon -lgtest +LDFLAGS += -L${srcdir}/../../c \ + -L${srcdir}/../../../../../common/c_cpp/src/c + +LIBS = -lmama -lwombatcommon -lgtest bin_PROGRAMS = MainUnitTestC -- 1.7.7.6
|
|
[PATCH 45/50] [mama] Remove msgFieldPayload from mamaMsg
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
Signed-off-by: Mike Schonberg <mschonberg@...> --- mama/c_cpp/src/c/msg.c | 26 +------------------------- 1 files changed, 1 insertions(+), 25 deletions(-)
diff --git a/mama/c_cpp/src/c/msg.c b/mama/c_cpp/src/c/msg.c index d3c0e80..c0530a6 100644 --- a/mama/c_cpp/src/c/msg.c +++ b/mama/c_cpp/src/c/msg.c @@ -85,8 +85,6 @@ typedef struct mamaMsgImpl_ mamaMsgField mCurrentField; mamaDateTime mCurrentDateTime; - - msgFieldPayload mFieldPayload; /*Hold onto the bridge impl for later use*/ mamaBridgeImpl* mBridgeImpl; /*The bridge specific message*/ @@ -124,13 +122,6 @@ mamaMsg_destroy (mamaMsg msg) if (impl->mPayloadBridge && impl->mMessageOwner) { - if (impl->mFieldPayload) - { - impl->mPayloadBridge->msgFieldPayloadDestroy ( - impl->mFieldPayload); - impl->mFieldPayload = NULL; - } - if (MAMA_STATUS_OK != impl->mPayloadBridge->msgPayloadDestroy (impl->mPayload)) { mama_log (MAMA_LOG_LEVEL_ERROR, "mamaMsg_destroy(): " @@ -197,12 +188,6 @@ mamaMsg_clear (mamaMsg msg) if (impl->mPayloadBridge) { - if (impl->mFieldPayload) - { - impl->mPayloadBridge->msgFieldPayloadDestroy ( - impl->mFieldPayload); - } - if (MAMA_STATUS_OK != impl->mPayloadBridge->msgPayloadClear (impl->mPayload)) { mama_log (MAMA_LOG_LEVEL_ERROR, "mamaMsg_clear(): " @@ -579,7 +564,6 @@ mamaMsgImpl_createNestedForPayload (mamaMsg* result, mamaMsgField_create (&impl->mCurrentField); impl->mCurrentField->myPayloadBridge = parent->mPayloadBridge; - impl->mFieldPayload = NULL; impl->mPayloadBridge = parent->mPayloadBridge; impl->mPayload = payload; impl->mParent = parent; @@ -645,7 +629,6 @@ mamaMsgImpl_createForPayload (mamaMsg* msg, impl->mPayload = payload; impl->mPayloadBridge = payloadBridge; - impl->mFieldPayload = NULL; /*These will be set later if necessary*/ impl->mBridgeImpl = NULL; impl->mBridgeMessage = NULL; @@ -1740,22 +1723,15 @@ mamaMsg_getField( mamaField = (mamaMsgFieldImpl*)impl->mCurrentField; - if (!impl->mFieldPayload) - { - impl->mPayloadBridge->msgFieldPayloadCreate ( - &impl->mFieldPayload); - } - if (MAMA_STATUS_OK!=(status = impl->mPayloadBridge->msgPayloadGetField ( impl->mPayload, name, fid, - &impl->mFieldPayload))) + &impl->mCurrentField->myPayload))) { return status; } impl->mCurrentField->myPayloadBridge = impl->mPayloadBridge; - impl->mCurrentField->myPayload = impl->mFieldPayload; impl->mCurrentField->myMsg = impl; mamaField = (mamaMsgFieldImpl*)impl->mCurrentField; -- 1.7.7.6
|
|
[PATCH 44/50] [testtools] Renamed shutdown() method in executables
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
Renamed shutdown() to xxxShutdown() to avoid namespace conflicts with Windows system libraries.
Signed-off-by: Mike Schonberg <mschonberg@...> --- .../src/testtools/performance/c/mamaconsumerc_v2.c | 6 +++--- .../src/testtools/performance/c/mamapingpongc.c | 6 +++--- .../src/testtools/performance/c/mamaproducerc_v2.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c index 13b52c6..2dd8153 100644 --- a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c +++ b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc_v2.c @@ -457,7 +457,7 @@ static void signalCatcher int sig ); -static void shutdown(void); +static void consumerShutdown (void); static void printHeader ( @@ -1126,7 +1126,7 @@ int main (int argc, const char** argv) displayStatsGroupBuckets(&gStatsGroup); } - shutdown(); + consumerShutdown(); for(i=0; i<NUM_STATS_GROUPS; ++i) destroyStatsGroup(&(gStatsGroups[i])); @@ -1195,7 +1195,7 @@ static void printHeader } -static void shutdown(void) +static void consumerShutdown (void) { int i; unsigned nsecSleep = gThrottle != -1 ? 1000000000 / gThrottle : 0; diff --git a/mama/c_cpp/src/testtools/performance/c/mamapingpongc.c b/mama/c_cpp/src/testtools/performance/c/mamapingpongc.c index 8069892..775db81 100644 --- a/mama/c_cpp/src/testtools/performance/c/mamapingpongc.c +++ b/mama/c_cpp/src/testtools/performance/c/mamapingpongc.c @@ -243,7 +243,7 @@ static void signalCatcher int sig ); -static void shutdown(pingPongCtx* ppCtx, pingPongEventCtx* eventCtx); +static void pingpongShutdown (pingPongCtx* ppCtx, pingPongEventCtx* eventCtx); static void initMessages(message* pMsgs, @@ -375,7 +375,7 @@ int main (int argc, const char** argv) /* start the mama bridge, blocks here */ mama_start (gPingPongCtx.mBridge); - shutdown(&gPingPongCtx, &eventCtx); + pingpongShutdown (&gPingPongCtx, &eventCtx); mama_close (); if(!eventCtx.mServer) @@ -491,7 +491,7 @@ static void publishMessage seqNum++; } -static void shutdown(pingPongCtx* ppCtx, pingPongEventCtx* eventCtx) +static void pingpongShutdown (pingPongCtx* ppCtx, pingPongEventCtx* eventCtx) { pthread_mutexattr_t attr; diff --git a/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c b/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c index b8884df..bb64e53 100644 --- a/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c +++ b/mama/c_cpp/src/testtools/performance/c/mamaproducerc_v2.c @@ -309,7 +309,7 @@ static void displayCallback void* closure ); -static void shutdown +static void producerShutdown ( uint32_t msgVar ); @@ -943,7 +943,7 @@ int main (int argc, const char **argv) } pthread_mutex_unlock (&pendingShutdownLock); - shutdown(msgVar); + producerShutdown (msgVar); MAMA_CHECK (mamaDateTime_destroy (gLastDisplayTime)); MAMA_CHECK (mamaDateTime_destroy (gNowTime)); @@ -953,7 +953,7 @@ int main (int argc, const char **argv) return 0; } -static void shutdown +static void producerShutdown ( uint32_t msgVar ) -- 1.7.7.6
|
|
[PATCH 43/50] [mama] GCC 4.6.2 Support
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
GCC 4.6.2 requires -ldl and -lrt.
Signed-off-by: Mike Schonberg <mschonberg@...> --- .../src/testtools/capturereplay/c/Makefile.am | 2 +- mama/c_cpp/src/testtools/load/c/Makefile.am | 2 +- mama/c_cpp/src/testtools/performance/c/Makefile.am | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/mama/c_cpp/src/testtools/capturereplay/c/Makefile.am b/mama/c_cpp/src/testtools/capturereplay/c/Makefile.am index 9614251..fc398ed 100644 --- a/mama/c_cpp/src/testtools/capturereplay/c/Makefile.am +++ b/mama/c_cpp/src/testtools/capturereplay/c/Makefile.am @@ -37,7 +37,7 @@ CFLAGS += -Wmissing-prototypes -Wstrict-prototypes CPPFLAGS += -pedantic -Wall -Wimplicit -Wno-long-long -D_GNU_SOURCE endif -LDADD = -lmama -lpthread -lm -lwombatcommon +LDADD = -lmama -lpthread -lm -lwombatcommon -ldl bin_PROGRAMS = capturereplayc capturec captureconvert diff --git a/mama/c_cpp/src/testtools/load/c/Makefile.am b/mama/c_cpp/src/testtools/load/c/Makefile.am index fbf016f..75fc832 100755 --- a/mama/c_cpp/src/testtools/load/c/Makefile.am +++ b/mama/c_cpp/src/testtools/load/c/Makefile.am @@ -36,7 +36,7 @@ CFLAGS += -Wmissing-prototypes -Wstrict-prototypes CPPFLAGS += -pedantic -Wall -Wimplicit -Wno-long-long -D_GNU_SOURCE endif -LDADD = -lmama -lpthread -lm -lwombatcommon +LDADD = -lmama -lpthread -lm -lwombatcommon -ldl bin_PROGRAMS = mamachurnc diff --git a/mama/c_cpp/src/testtools/performance/c/Makefile.am b/mama/c_cpp/src/testtools/performance/c/Makefile.am index eb19b6e..26f9673 100644 --- a/mama/c_cpp/src/testtools/performance/c/Makefile.am +++ b/mama/c_cpp/src/testtools/performance/c/Makefile.am @@ -36,7 +36,7 @@ CFLAGS += -Wmissing-prototypes -Wstrict-prototypes CPPFLAGS += -pedantic -Wall -Wimplicit -Wno-long-long -D_GNU_SOURCE endif -LDADD = -lmama -lpthread -lm -lwombatcommon +LDADD = -lmama -lpthread -lm -lwombatcommon -ldl -lrt bin_PROGRAMS = mamaproducerc \ -- 1.7.7.6
|
|
[PATCH 42/50] [common] C Linkage for Detroy Handle
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
Signed-off-by: Mike Schonberg <mschonberg@...> --- common/c_cpp/src/c/destroyHandle.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/common/c_cpp/src/c/destroyHandle.h b/common/c_cpp/src/c/destroyHandle.h index 08d2067..80c008d 100644 --- a/common/c_cpp/src/c/destroyHandle.h +++ b/common/c_cpp/src/c/destroyHandle.h @@ -33,6 +33,9 @@ * although the object may be gone the thread will have valid memory to access. */ +#if defined(__cplusplus) +extern "C" { +#endif /* ************************************************************** */ /* Includes. */ /* ************************************************************** */ @@ -121,5 +124,8 @@ extern void * destroyHandle_removeReference( pDestroyHandle handle); +#if defined(__cplusplus) +} +#endif #endif -- 1.7.7.6
|
|
[PATCH 41/50] [common] Windows int MIN and MAX Definititions
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
Also moved 8 byte integer typedefs to wombat/strutils with the other similiar typedefs.
Signed-off-by: Mike Schonberg <mschonberg@...> --- common/c_cpp/src/c/linux/port.h | 4 --- common/c_cpp/src/c/windows/port.h | 36 ++++++++++++++++++++++++++++++++++ common/c_cpp/src/c/wombat/strutils.h | 2 + 3 files changed, 38 insertions(+), 4 deletions(-)
diff --git a/common/c_cpp/src/c/linux/port.h b/common/c_cpp/src/c/linux/port.h index 67ae0c9..b40b4fa 100644 --- a/common/c_cpp/src/c/linux/port.h +++ b/common/c_cpp/src/c/linux/port.h @@ -67,10 +67,6 @@ typedef void* LIB_HANDLE; /* suffix for shared libraries */ #define LIB_EXTENSION ".so" -/* 8 byte int typedefs */ -typedef unsigned long long int w_u64_t; -typedef long long int w_i64_t; - /* Network conversion function */ #if __BYTE_ORDER == __LITTLE_ENDIAN #define htonll(x) \ diff --git a/common/c_cpp/src/c/windows/port.h b/common/c_cpp/src/c/windows/port.h index ded944a..ac35348 100644 --- a/common/c_cpp/src/c/windows/port.h +++ b/common/c_cpp/src/c/windows/port.h @@ -174,6 +174,42 @@ const char *index( const char *str, char c ); */ #define PRId64 "I64d" #define PRIu64 "I64u" +#ifndef INT8_MIN +#define INT8_MIN SCHAR_MIN +#endif +#ifndef INT8_MAX +#define INT8_MAX SCHAR_MAX +#endif +#ifndef INT16_MIN +#define INT16_MIN SHRT_MIN +#endif +#ifndef INT16_MAX +#define INT16_MAX SHRT_MAX +#endif +#ifndef INT32_MIN +#define INT32_MIN INT_MIN +#endif +#ifndef INT32_MAX +#define INT32_MAX INT_MAX +#endif +#ifndef INT64_MIN +#define INT64_MIN LLONG_MIN +#endif +#ifndef INT64_MAX +#define INT64_MAX LLONG_MAX +#endif +#ifndef UINT8_MAX +#define UINT8_MAX UCHAR_MAX +#endif +#ifndef UINT16_MAX +#define UINT16_MAX USHRT_MAX +#endif +#ifndef UINT32_MAX +#define UINT32_MAX UINT_MAX +#endif +#ifndef UINT64_MAX +#define UINT64_MAX ULLONG_MAX +#endif #define wthread_detach( h ) /* noop */ #define wthread_self GetCurrentThread diff --git a/common/c_cpp/src/c/wombat/strutils.h b/common/c_cpp/src/c/wombat/strutils.h index d5d1fb8..be7da86 100644 --- a/common/c_cpp/src/c/wombat/strutils.h +++ b/common/c_cpp/src/c/wombat/strutils.h @@ -33,6 +33,8 @@ typedef unsigned long int w_u32_t; typedef long int w_i32_t; typedef float w_f32_t; typedef double w_f64_t; +typedef unsigned long long int w_u64_t; +typedef long long int w_i64_t; COMMONExpDLL int wmFastCopyAndShiftStr ( -- 1.7.7.6
|
|
[PATCH 40/50] [common] Added Missing LGPL Headers
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
Also shortened the "#define VCx 1" macros shortened to "#define VC_X".
Signed-off-by: Mike Schonberg <mschonberg@...> --- common/c_cpp/src/c/linux/wUuid.h | 20 +++++++++++++++++ common/c_cpp/src/c/wMessageStats.c | 20 +++++++++++++++++ common/c_cpp/src/c/windows/wombat/targetsxs.h | 28 +++++++++++++++++++++--- common/c_cpp/src/c/wombat/wMessageStats.h | 20 +++++++++++++++++ mama/c_cpp/src/gunittest/c/MainUnitTestC.cpp | 20 +++++++++++++++++ mama/c_cpp/src/gunittest/c/MainUnitTestC.h | 22 ++++++++++++++++--- 6 files changed, 122 insertions(+), 8 deletions(-)
diff --git a/common/c_cpp/src/c/linux/wUuid.h b/common/c_cpp/src/c/linux/wUuid.h index 608eee7..92090ec 100644 --- a/common/c_cpp/src/c/linux/wUuid.h +++ b/common/c_cpp/src/c/linux/wUuid.h @@ -1,3 +1,23 @@ +/* $Id: wUuid.h,v 1.1.2.4.2.1 2012/04/17 10:52:12 emmapollock Exp $ + * + * OpenMAMA: The open middleware agnostic messaging API + * Copyright (C) 2011 NYSE Inc. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA + */ #ifndef WUUID_H__ diff --git a/common/c_cpp/src/c/wMessageStats.c b/common/c_cpp/src/c/wMessageStats.c index 5ae85ce..7fa479c 100644 --- a/common/c_cpp/src/c/wMessageStats.c +++ b/common/c_cpp/src/c/wMessageStats.c @@ -1,3 +1,23 @@ +/* $Id: wMessageStats.c,v 1.76.18.3.8.1 2012/04/17 10:52:12 emmapollock Exp $ + * + * OpenMAMA: The open middleware agnostic messaging API + * Copyright (C) 2011 NYSE Inc. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA + */ #include "wombat/machine.h" #include "wombat/wMessageStats.h" diff --git a/common/c_cpp/src/c/windows/wombat/targetsxs.h b/common/c_cpp/src/c/windows/wombat/targetsxs.h index 2341000..babeaa3 100644 --- a/common/c_cpp/src/c/windows/wombat/targetsxs.h +++ b/common/c_cpp/src/c/windows/wombat/targetsxs.h @@ -1,14 +1,34 @@ +/* $Id: targetsxs.h,v 1.1.4.3.2.2 2012/04/17 10:52:12 emmapollock Exp $ + * + * OpenMAMA: The open middleware agnostic messaging API + * Copyright (C) 2011 NYSE Inc. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA + */ #ifndef _WOMBAT_TARGETSXS_H #define _WOMBAT_TARGETSXS_H #if (_MSC_VER >= 1600 && _MSC_VER < 1700) -#define VC10 1 +#define VC10 #elif (_MSC_VER >= 1600 && _MSC_VER < 1500) -#define VC9 1 +#define VC9 #elif (_MSC_VER >= 1400 && _MSC_VER < 1500) -#define VC8 1 +#define VC8 #elif (_MSC_VER >= 1400 && _MSC_VER < 1400) -#define VC7 1 +#define VC7 #endif #ifndef VC7 diff --git a/common/c_cpp/src/c/wombat/wMessageStats.h b/common/c_cpp/src/c/wombat/wMessageStats.h index 4a8916d..a4c3546 100644 --- a/common/c_cpp/src/c/wombat/wMessageStats.h +++ b/common/c_cpp/src/c/wombat/wMessageStats.h @@ -1,3 +1,23 @@ +/* $Id: wMessageStats.h,v 1.7.16.3.8.1 2012/04/17 10:52:12 emmapollock Exp $ + * + * OpenMAMA: The open middleware agnostic messaging API + * Copyright (C) 2011 NYSE Inc. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA + */ #ifndef _PERF_DATA_H__ #define _PERF_DATA_H__ diff --git a/mama/c_cpp/src/gunittest/c/MainUnitTestC.cpp b/mama/c_cpp/src/gunittest/c/MainUnitTestC.cpp index 95a1e9f..9b0ea7d 100644 --- a/mama/c_cpp/src/gunittest/c/MainUnitTestC.cpp +++ b/mama/c_cpp/src/gunittest/c/MainUnitTestC.cpp @@ -1,3 +1,23 @@ +/* $Id: MainUnitTestC.cpp,v 1.2.22.2.16.1 2012/04/17 10:52:12 emmapollock Exp $ + * + * OpenMAMA: The open middleware agnostic messaging API + * Copyright (C) 2011 NYSE Inc. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA + */ #include <cstdlib> #include <iostream> #include <gtest/gtest.h> diff --git a/mama/c_cpp/src/gunittest/c/MainUnitTestC.h b/mama/c_cpp/src/gunittest/c/MainUnitTestC.h index 866df1b..595521b 100644 --- a/mama/c_cpp/src/gunittest/c/MainUnitTestC.h +++ b/mama/c_cpp/src/gunittest/c/MainUnitTestC.h @@ -1,8 +1,22 @@ -/* - * MainUnitTestC.h +/* $Id: MainUnitTestC.h,v 1.1.2.1.16.1 2012/04/17 10:52:12 emmapollock Exp $ * - * Created on: 13 Sep 2011 - * Author: ianb + * OpenMAMA: The open middleware agnostic messaging API + * Copyright (C) 2011 NYSE Inc. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA */ #ifndef MAINUNITTESTC_H_ -- 1.7.7.6
|
|
[PATCH 39/50] [avis-payload] Correct Calling Convention for Windows
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
The avis payload headers need the correct calling convention to export functions from the dynamic libraries.
Signed-off-by: Mike Schonberg <mschonberg@...> --- common/c_cpp/src/c/windows/wombat/wConfig.h | 5 +---- mama/c_cpp/src/c/payload/avismsg/avispayload.h | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/common/c_cpp/src/c/windows/wombat/wConfig.h b/common/c_cpp/src/c/windows/wombat/wConfig.h index 2b944be..1c9f788 100644 --- a/common/c_cpp/src/c/windows/wombat/wConfig.h +++ b/common/c_cpp/src/c/windows/wombat/wConfig.h @@ -36,11 +36,8 @@ #elif defined( MAMA_DLL ) && defined( BRIDGE ) /* We are building mama bridge as a dll */ # define MAMAExpDLL __declspec( dllimport ) -# define MAMAExpBridgeDLL __declspec( dllimport ) # define COMMONExpDLL __declspec( dllimport ) -# define MAMACPPExpDLL -# define MAMDAExpDLL -# define MAMDAOPTExpDLL +# define MAMAExpBridgeDLL __declspec( dllexport ) # define WMWExpDLL __declspec( dllimport ) #elif defined( MAMA_DLL ) && defined( MAMACPP ) /* We are building mamacpp as a dll */ diff --git a/mama/c_cpp/src/c/payload/avismsg/avispayload.h b/mama/c_cpp/src/c/payload/avismsg/avispayload.h index 2e87888..69135e2 100755 --- a/mama/c_cpp/src/c/payload/avismsg/avispayload.h +++ b/mama/c_cpp/src/c/payload/avismsg/avispayload.h @@ -30,11 +30,11 @@ extern "C" { #endif -MAMAExpDLL +MAMAExpBridgeDLL extern mama_status avismsgPayload_destroyImpl (mamaPayloadBridge mamaPayloadBridge); -MAMAExpDLL +MAMAExpBridgeDLL extern mama_status avismsgPayload_createImpl (mamaPayloadBridge* result, char* identifier); -- 1.7.7.6
|
|
[PATCH 38/50] [common] Change uuid to char* from int for Windows
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
Signed-off-by: Mike Schonberg <mschonberg@...> --- common/c_cpp/src/c/windows/wombat/wUuid.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/common/c_cpp/src/c/windows/wombat/wUuid.h b/common/c_cpp/src/c/windows/wombat/wUuid.h index 43f4b2c..442e39a 100644 --- a/common/c_cpp/src/c/windows/wombat/wUuid.h +++ b/common/c_cpp/src/c/windows/wombat/wUuid.h @@ -23,7 +23,7 @@ #include "wombat/port.h" -typedef int wUuid; +typedef char* wUuid; COMMONExpDLL void wUuid_generate_time (wUuid myUuid); -- 1.7.7.6
|
|
[PATCH 37/50] [testtools] Calling Convention for Windows Callbacks
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
Use MAMACALLTYPE for callbacks in mamachurn and mamaconsumer in the test tools directory.
Signed-off-by: Mike Schonberg <mschonberg@...> --- mama/c_cpp/src/testtools/load/c/mamachurnc.c | 16 ++++++++-------- .../src/testtools/performance/c/mamaconsumerc.c | 19 ++++++++----------- 2 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/mama/c_cpp/src/testtools/load/c/mamachurnc.c b/mama/c_cpp/src/testtools/load/c/mamachurnc.c index 37a89dd..0f3d037 100644 --- a/mama/c_cpp/src/testtools/load/c/mamachurnc.c +++ b/mama/c_cpp/src/testtools/load/c/mamachurnc.c @@ -110,7 +110,7 @@ static void ClearCounters(void) #define STATS_FIELD_WIDTH -5 /* negative = left alignment */ -static void statsCallback(mamaTimer timer, void *closure) +static void MAMACALLTYPE statsCallback(mamaTimer timer, void *closure) { time_t t; struct tm tmResult; @@ -166,7 +166,7 @@ static void checkStatus(char *err, mama_status status) } } -static void subscriptionOnCreate(mamaSubscription subscription, void* closure) +static void MAMACALLTYPE subscriptionOnCreate(mamaSubscription subscription, void* closure) { const char* symbol = NULL; @@ -178,7 +178,7 @@ static void subscriptionOnCreate(mamaSubscription subscription, void* closure) } } -static void subscriptionOnError(mamaSubscription subscription, +static void MAMACALLTYPE subscriptionOnError(mamaSubscription subscription, mama_status status, void* platformError, const char* subject, @@ -193,7 +193,7 @@ static void subscriptionOnError(mamaSubscription subscription, mamaSubscription_activate(subscription); } -static void subscriptionOnMsg(mamaSubscription subscription, +static void MAMACALLTYPE subscriptionOnMsg(mamaSubscription subscription, mamaMsg msg, void *closure, void *itemClosure) @@ -286,13 +286,13 @@ static void createSubscription(int index) checkStatus("mamaSubscription_create()",status); } -static void lifetimeCallback(mamaTimer timer, void *closure) +static void MAMACALLTYPE lifetimeCallback(mamaTimer timer, void *closure) { mama_stop(gBridge); printf("Lifetime expired\n"); } -static void recreateCallback(mamaTimer timer, void *closure) +static void MAMACALLTYPE recreateCallback(mamaTimer timer, void *closure) { /* try to destroy existing subscription */ destroySubscription((int)closure); @@ -300,7 +300,7 @@ static void recreateCallback(mamaTimer timer, void *closure) mamaTimer_destroy(timer); } -static void churnCallback(mamaTimer timer, void *closure) +static void MAMACALLTYPE churnCallback(mamaTimer timer, void *closure) { int churnCount = 0; int churnIndex = 0; @@ -324,7 +324,7 @@ static void churnCallback(mamaTimer timer, void *closure) gChurned+=churnCount; } -static void transportCb(mamaTransport tport,mamaTransportEvent ev, +static void MAMACALLTYPE transportCb(mamaTransport tport,mamaTransportEvent ev, short cause,const void *opaque,void *closure) { mamaQuality quality = MAMA_QUALITY_UNKNOWN; diff --git a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c index 106a0ef..2df8881 100644 --- a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c +++ b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c @@ -24,9 +24,6 @@ #include "string.h" #include <stdlib.h> -#include "pthread.h" -#include <unistd.h> - /* MAMA function checking macro */ #define MAMA_CHECK(status) \ { \ @@ -107,13 +104,13 @@ static void mc_createSubscriber mamaQueue queue ); -static void mc_createCb +static void MAMACALLTYPE mc_createCb ( mamaSubscription subscription, void * closure ); -static void mc_errorCb +static void MAMACALLTYPE mc_errorCb ( mamaSubscription subscription, mama_status status, @@ -122,7 +119,7 @@ static void mc_errorCb void* closure ); -static void mc_msgCb +static void MAMACALLTYPE mc_msgCb ( mamaSubscription subscription, mamaMsg msg, @@ -130,7 +127,7 @@ static void mc_msgCb void * itemClosure ); -static void mc_msgCb2 +static void MAMACALLTYPE mc_msgCb2 ( mamaSubscription subscription, mamaMsg msg, @@ -296,7 +293,7 @@ static void mc_createSubscriber /********************************************************** * mc_createCb * **********************************************************/ -static void mc_createCb +static void MAMACALLTYPE mc_createCb ( mamaSubscription subscription, void * closure @@ -308,7 +305,7 @@ static void mc_createCb /********************************************************** * mc_errorCb * **********************************************************/ -static void mc_errorCb +static void MAMACALLTYPE mc_errorCb ( mamaSubscription subscription, mama_status status, @@ -327,7 +324,7 @@ static void mc_errorCb /********************************************************** * mc_msgCb * **********************************************************/ -static void mc_msgCb +static void MAMACALLTYPE mc_msgCb ( mamaSubscription subscription, mamaMsg msg, @@ -400,7 +397,7 @@ static void mc_msgCb /********************************************************** * mc_msgCb2 * **********************************************************/ -static void mc_msgCb2 +static void MAMACALLTYPE mc_msgCb2 ( mamaSubscription subscription, mamaMsg msg, -- 1.7.7.6
|
|
[PATCH 36/50] [mama] Renamed Methods in ft.c for Consistency
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
Signed-off-by: Mike Schonberg <mschonberg@...> --- mama/c_cpp/src/c/ft.c | 25 ++++++++++--------------- 1 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/mama/c_cpp/src/c/ft.c b/mama/c_cpp/src/c/ft.c index 97c9bae..a6b886c 100644 --- a/mama/c_cpp/src/c/ft.c +++ b/mama/c_cpp/src/c/ft.c @@ -26,6 +26,7 @@ #include <stdlib.h> #include <mama/ft.h> #include <mama/io.h> +#include <wombat/wCommon.h> #include <sys/types.h> @@ -97,9 +98,7 @@ static void bridgeFt_sendHeartbeat (mamaFtMember member); static int multicastFt_receiveHeartbeat(void* member); static int bridgeFt_receiveHeartbeat(void* member); -static const char* -multicastFt_getProperty(char *buffer, const char *propertyName, const char - *transportName); +const char *multicastFt_getProperty(char *buffer, const char *propertyName, const char *transportName); static int foundheartbeat=0; @@ -196,7 +195,7 @@ static mamaIo gReadHandler = NULL; /* General implementation functions. */ int receiveHeartbeat (mamaFtMemberImpl* impl); -void checkHeartbeat (mamaFtMemberImpl* impl, +void mamaCheckHeartbeat (mamaFtMemberImpl* impl, unsigned int hbWeight, unsigned int hbIncarnation, int hbPid, @@ -204,8 +203,6 @@ void checkHeartbeat (mamaFtMemberImpl* impl, int hbPrimary, char* hbGroupName); -struct in_addr wresolve_ip (const char * arg); - /* FT callbacks: */ static void MAMACALLTYPE ftSubCreateCb (mamaSubscription subscription, void* closure); @@ -665,7 +662,7 @@ mama_status resetTimeoutTimer (mamaFtMemberImpl* impl) return mamaTimer_reset (impl->myTimeoutTimer); } -int betterCredentials(mamaFtMemberImpl* impl, unsigned int weight, +int mamaBetterCredentials (mamaFtMemberImpl* impl, unsigned int weight, unsigned int incarnation, in_addr_t ipAddr, int pid) { if (weight > impl->myWeight) @@ -698,7 +695,7 @@ int betterCredentials(mamaFtMemberImpl* impl, unsigned int weight, } -void checkHeartbeat (mamaFtMemberImpl* impl, +void mamaCheckHeartbeat (mamaFtMemberImpl* impl, unsigned int hbWeight, unsigned int hbIncarnation, int hbPid, @@ -722,7 +719,7 @@ void checkHeartbeat (mamaFtMemberImpl* impl, } - if (betterCredentials(impl, hbWeight,hbIncarnation,hbIpAddr,hbPid) == 0) + if (mamaBetterCredentials(impl, hbWeight,hbIncarnation,hbIpAddr,hbPid) == 0) { mama_log (MAMA_LOG_LEVEL_FINER, "MAMA NATIVE FT: received heartbeat"); @@ -818,11 +815,9 @@ multicastFt_setup ( if(transport) { status = mamaTransport_getName(transport, &transportName); - if((MAMA_STATUS_OK != status) || (NULL == transportName) || ('\0' == - transportName[0])) + if((MAMA_STATUS_OK != status) || (NULL == transportName) || ('\0' == transportName[0])) { - mama_log (MAMA_LOG_LEVEL_ERROR, "MAMA multicast FT: the transport name " - "is invalid"); + mama_log (MAMA_LOG_LEVEL_ERROR, "MAMA multicast FT: the transport name is invalid"); return MAMA_STATUS_INVALID_ARG; } } @@ -1148,7 +1143,7 @@ int multicastFt_receiveHeartbeat(void* member) hbIpAddr = ntohl (hbIpAddr); - checkHeartbeat (impl, hbWeight, hbIncarnation, hbPid, hbIpAddr, + mamaCheckHeartbeat (impl, hbWeight, hbIncarnation, hbPid, hbIpAddr, hbPrimary, hbGroupName); return 0; @@ -1372,7 +1367,7 @@ ftSubMsgCb (mamaSubscription subscription, return; } - checkHeartbeat (impl, + mamaCheckHeartbeat (impl, hbWeight, hbIncarnation, hbPid, -- 1.7.7.6
|
|
[PATCH 35/50] [examples] Remove Properietary Property Entries
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
Signed-off-by: Mike Schonberg <mschonberg@...> --- mama/c_cpp/src/examples/mama.properties | 107 ++++++++++++------------------- 1 files changed, 41 insertions(+), 66 deletions(-)
diff --git a/mama/c_cpp/src/examples/mama.properties b/mama/c_cpp/src/examples/mama.properties index b1663e3..59ff173 100644 --- a/mama/c_cpp/src/examples/mama.properties +++ b/mama/c_cpp/src/examples/mama.properties @@ -1,66 +1,41 @@ -################################################################################ -# Global MAMA properties for all middle ware -################################################################################ - -# The path and filename of the V5 Wirecache templates. If no path is given -# then the WOMBAT_PATH environment varible will be used for the path. -mama.wirecache.templates = wcache_templates.xml - -################################################################################ -# Example MAMA properties for Wombat messaging middle ware -################################################################################ - -# Disable WMW signal handlers for application which do not require default SHM -# cleanup and correctly shutdown their application -mama.wmw.disable_signal_handlers=1 - -# The transport name is wmw_tport - -# The transport name is wmw_tport -mama.wmw.transport.pub.is_naming=0 -mama.wmw.transport.pub.publish_port=1456 - -mama.wmw.transport.sub.is_naming=0 -mama.wmw.transport.sub.subscribe_address_0=127.0.0.1 -mama.wmw.transport.sub.subscribe_port_0=1456 - -################################################################################ -# Example MAMA properties for Data Fabric middle ware -# These properties require Data Fabric 6.0 or later -################################################################################ - -# See the NYSE Technologies Data Fabric Configuration Reference Guide for -# detailed explanations of all configuration options on Data Fabric - -# Data Fabric subscriber transport. The subscriber only requires the details of -# the Naming Service Daemon (NSD) which connects publisher to subscribers based -# on topics and groups. This transport can be used to subscribe to any publisher -# type. -mama.wmw.transport.wmw_sub.nsd_0=127.0.0.1:5151 - -# Data Fabric TCP publisher transport. The type defaults to TCP and is therefore -# not required. -mama.wmw.transport.tcp_pub.nsd_0=127.0.0.1:5151 - -# Data Fabric Remote Direct Memory Access (RDMA) publisher transport. -mama.wmw.transport.vms_pub.nsd_0=127.0.0.1:5151 -mama.wmw.transport.vms_pub.type=vms -mama.wmw.transport.vms_pub.publish_address=ib0 - -# Data Fabric Multicast Verbs (MultiVerb) publisher transport. -mama.wmw.transport.ibv_pub.nsd_0=127.0.0.1:5151 -mama.wmw.transport.ibv_pub.type=ibv -mama.wmw.transport.ibv_pub.publish_address=ib0 - -# Data Fabric transports for communicating via a Data Fabric Daemon (DFD) -# The DFD allows bridging between transports and can also be used to segregate -# environments. DFD communication is based on groups to control which -# subscribers connect to the DFD publishing transport and which publishers the -# DFD subscribing transport connects to. -mama.wmw.transport.tcp_dfd_pub.nsd_0=127.0.0.1:5151 -mama.wmw.transport.tcp_dfd_pub.pub_group=feed -mama.wmw.transport.tcp_dfd_pub.sub_groups=rr - -mama.wmw.transport.wmw_dfd_sub.nsd_0=127.0.0.1:5151 -mama.wmw.transport.wmw_dfd_sub.pub_group=dfd_rr -mama.wmw.transport.wmw_dfd_sub.sub_groups=dfd +# $Id: mama.properties.opensource,v 1.1.2.1.4.1 2012/04/17 10:52:12 emmapollock Exp $ +# +# OpenMAMA: The open middleware agnostic messaging API +# Copyright (C) 2011 NYSE Inc. +# +# This library 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 2.1 of the License, or (at your option) any later version. +# +# This library 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 library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA +# +################################################################################ +# Global MAMA properties for all middle ware +################################################################################ + +# A comma delimited list of entitlements servers. Each server is specified as +# host[:port] +entitlement.servers=host1:8095,host2:8096,host3 + +# The lowest and highest TCP/IP port number +# on which a client will listen for requests +# from an entitlements server. +# Required for Concurrent Access Control +# and Dynamic Entitlement Updates functionality. +mama.entitlement.portlow=9500 +mama.entitlement.porthigh=9550 + +################################################################################ +# Example MAMA properties for AVIS messaging middle ware +################################################################################ +# URL for the avis router - default value is elvin://localhost +#mama.avis.transport.url=elvin://host1:5555 -- 1.7.7.6
|
|
[PATCH 34/50] [examples] Put C examples in .../examples/c
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
For consistency with the source tree and to keep the examples for different languages separate.
Signed-off-by: Mike Schonberg <mschonberg@...> --- mama/c_cpp/src/examples/c/Makefile.am | 2 +- mama/c_cpp/src/examples/c/Makefile.sample | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/mama/c_cpp/src/examples/c/Makefile.am b/mama/c_cpp/src/examples/c/Makefile.am index 9a71db8..ff9eb1c 100644 --- a/mama/c_cpp/src/examples/c/Makefile.am +++ b/mama/c_cpp/src/examples/c/Makefile.am @@ -62,7 +62,7 @@ dist_mamamultisubscriberc_SOURCES = mamamultisubscriberc.c dist_mamaftmemberc_SOURCES = mamaftmemberc.c # Additional installation directory for sample source code -exampledir = ${prefix}/examples/mama +exampledir = ${prefix}/examples/mama/c # Rule to install the example programs: example_DATA = \ diff --git a/mama/c_cpp/src/examples/c/Makefile.sample b/mama/c_cpp/src/examples/c/Makefile.sample index 718195e..513fcb0 100644 --- a/mama/c_cpp/src/examples/c/Makefile.sample +++ b/mama/c_cpp/src/examples/c/Makefile.sample @@ -13,7 +13,7 @@ # SOLARIS/Forte: The makefile will need modified to use the Solaris compiler. # See example below. #============================================================================= -API_HOME=../../ +API_HOME=../../../ ## Solaris/Forte compiler: #CXX = CC -- 1.7.7.6
|
|
[PATCH 33/50] [examples] Changes for Windows
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
Use correct calling convention for callbacks and a few other minor changes.
Signed-off-by: Mike Schonberg <mschonberg@...> --- mama/c_cpp/src/examples/c/mamaftmemberc.c | 4 ++-- mama/c_cpp/src/examples/c/mamainboxc.c | 4 ++++ mama/c_cpp/src/examples/c/mamalistenc.c | 1 - mama/c_cpp/src/examples/c/mamamultisubscriberc.c | 14 +++++++++++--- mama/c_cpp/src/examples/c/mamaproxyc.c | 4 ++++ mama/c_cpp/src/examples/c/mamapublisherc.c | 2 +- 6 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/mama/c_cpp/src/examples/c/mamaftmemberc.c b/mama/c_cpp/src/examples/c/mamaftmemberc.c index 8ba53c2..e2e3aa9 100644 --- a/mama/c_cpp/src/examples/c/mamaftmemberc.c +++ b/mama/c_cpp/src/examples/c/mamaftmemberc.c @@ -51,14 +51,14 @@ static void parseCommandLine (int argc, const char **argv); static void initializeMama (void); static void createFtMember (void); -static void onFtStateChangeCb (mamaFtMember ftMember, +static void MAMACALLTYPE onFtStateChangeCb (mamaFtMember ftMember, const char* groupName, mamaFtState state, void* closure); static void usage (int exitStatus); -static void onFtStateChangeCb (mamaFtMember ftMember, +static void MAMACALLTYPE onFtStateChangeCb (mamaFtMember ftMember, const char* groupName, mamaFtState state, void* closure) diff --git a/mama/c_cpp/src/examples/c/mamainboxc.c b/mama/c_cpp/src/examples/c/mamainboxc.c index 4e2b9b7..48d50a7 100644 --- a/mama/c_cpp/src/examples/c/mamainboxc.c +++ b/mama/c_cpp/src/examples/c/mamainboxc.c @@ -198,6 +198,10 @@ static void sendRequest (void) exit (status); } + mama_log (MAMA_LOG_LEVEL_ERROR, + "mamaPublisher_sendFromInboxWithThrottle(): " + " %s", + mamaMsg_toString(msg)); /*The message can be destroyed once the sendCompleteCb has been invoked.*/ status = mamaPublisher_sendFromInboxWithThrottle (gPublisher, gInbox, msg, sendCompleteCb, NULL); diff --git a/mama/c_cpp/src/examples/c/mamalistenc.c b/mama/c_cpp/src/examples/c/mamalistenc.c index 80ca789..be270d1 100644 --- a/mama/c_cpp/src/examples/c/mamalistenc.c +++ b/mama/c_cpp/src/examples/c/mamalistenc.c @@ -763,7 +763,6 @@ transportCb (mamaTransport tport, void initializeMama (void) { mama_status status = MAMA_STATUS_OK; - mamaPayloadBridge payBridge = NULL; /* mama_setApplicationName should be called before mama_open(). diff --git a/mama/c_cpp/src/examples/c/mamamultisubscriberc.c b/mama/c_cpp/src/examples/c/mamamultisubscriberc.c index 2364ffb..c017dc9 100644 --- a/mama/c_cpp/src/examples/c/mamamultisubscriberc.c +++ b/mama/c_cpp/src/examples/c/mamamultisubscriberc.c @@ -21,7 +21,6 @@ #include "mama/mama.h" #include "string.h" -#include <unistd.h> #define MAX_BRIDGES 10 static const char * gTopic = "MAMA_TOPIC"; @@ -52,21 +51,24 @@ NULL static void parseCommandLine (int argc, const char **argv); static void initialize (void); static void createSubscriber (mamaBridge bridge, mamaTransport transport); -static void startCB ( mama_status status ); +static void MAMACALLTYPE startCB ( mama_status status ); static void start (void); static void displayMsg (mamaMsg msg); static void usage (int exitStatus); static void +MAMACALLTYPE displayCb (const mamaMsg msg, const mamaMsgField field, void * closure); static void +MAMACALLTYPE createCb (mamaSubscription subscription, void * closure); static void +MAMACALLTYPE errorCb (mamaSubscription subscription, mama_status status, void* platformError, @@ -74,6 +76,7 @@ errorCb (mamaSubscription subscription, void* closure); static void +MAMACALLTYPE msgCb (mamaSubscription subscription, mamaMsg msg, void * closure, @@ -189,7 +192,8 @@ static void createSubscriber (mamaBridge bridge, mamaTransport transport) } } -void startCB ( mama_status status ) +void MAMACALLTYPE +startCB ( mama_status status ) {} void start () @@ -206,6 +210,7 @@ void start () } static void +MAMACALLTYPE createCb (mamaSubscription subscription, void *closure) { if (gQuietLevel < 2) @@ -215,6 +220,7 @@ createCb (mamaSubscription subscription, void *closure) } static void +MAMACALLTYPE errorCb (mamaSubscription subscription, mama_status status, void* platformError, @@ -227,6 +233,7 @@ errorCb (mamaSubscription subscription, } static void +MAMACALLTYPE msgCb (mamaSubscription subscription, mamaMsg msg, void* closure, @@ -240,6 +247,7 @@ msgCb (mamaSubscription subscription, } void +MAMACALLTYPE displayCb (const mamaMsg msg, const mamaMsgField field, void* closure) diff --git a/mama/c_cpp/src/examples/c/mamaproxyc.c b/mama/c_cpp/src/examples/c/mamaproxyc.c index dfb5aa0..e50fb84 100644 --- a/mama/c_cpp/src/examples/c/mamaproxyc.c +++ b/mama/c_cpp/src/examples/c/mamaproxyc.c @@ -182,6 +182,10 @@ static void createPublisher () "_MD", NULL); + // Turn off updateing of the messages as incoming messages + // from FH already have seqnum and senderid + mamaDQPublisherManager_setSeqNum(gDQPubManager, 0); + mamaDQPublisherManager_setSenderId(gDQPubManager, 0); if (gSendSync) { mamaTimer_create (&gSyncTimer, gPubDefaultQueue, syncCallback, 15, gDQPubManager); diff --git a/mama/c_cpp/src/examples/c/mamapublisherc.c b/mama/c_cpp/src/examples/c/mamapublisherc.c index e00ea9d..a5fce51 100644 --- a/mama/c_cpp/src/examples/c/mamapublisherc.c +++ b/mama/c_cpp/src/examples/c/mamapublisherc.c @@ -305,7 +305,7 @@ inboundMsgCb (mamaSubscription subscription, if (gQuietLevel < 2) { - printf ("Recieved inbound msg. Sending response\n"); + printf ("Recieved inbound msg. (%s) Sending response\n", mamaMsg_toString (msg)); } if (!mamaMsg_isFromInbox (msg)) -- 1.7.7.6
|
|
[PATCH 32/50] [avis-payload] Fixed compiler warnings
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
Primarily moved declarations to beginning of scope for non-C99 compliant compilers
Signed-off-by: Mike Schonberg <mschonberg@...> --- mama/c_cpp/src/c/payload/avismsg/avispayload.c | 103 +++++++++++++---------- mama/c_cpp/src/c/payload/avismsg/avispayload.h | 2 + mama/c_cpp/src/c/payload/avismsg/msgfield.c | 2 +- 3 files changed, 61 insertions(+), 46 deletions(-)
diff --git a/mama/c_cpp/src/c/payload/avismsg/avispayload.c b/mama/c_cpp/src/c/payload/avismsg/avispayload.c index 28cca7a..f3c044a 100755 --- a/mama/c_cpp/src/c/payload/avismsg/avispayload.c +++ b/mama/c_cpp/src/c/payload/avismsg/avispayload.c @@ -131,15 +131,17 @@ avismsgPayload_getType () mama_status avismsgPayload_create (msgPayload* msg) { - if (!msg) return MAMA_STATUS_NULL_ARG; Attributes* avisMsg = attributes_create(); + avisPayloadImpl* newPayload = NULL; + + if (!msg) return MAMA_STATUS_NULL_ARG; if (!avisMsg) { mama_log (MAMA_LOG_LEVEL_ERROR, "attributes_create() failed. Could not create Avis msg"); return MAMA_STATUS_PLATFORM; } - avisPayloadImpl* newPayload = (avisPayloadImpl*)calloc (1, sizeof(avisPayloadImpl)); + newPayload = (avisPayloadImpl*)calloc (1, sizeof(avisPayloadImpl)); newPayload->mAvisMsg=avisMsg; *msg = newPayload; @@ -194,8 +196,7 @@ mama_status avismsgPayload_destroy (msgPayload msg) { CHECK_PAYLOAD(msg); - attributes_free(avisPayload(msg)); - free(avisPayload(msg)); + attributes_destroy(avisPayload(msg)); avismsgPayloadIter_destroy(avisPayloadImpl(msg)->mIterator); free(avisPayloadImpl(msg)->mAvisField); @@ -205,7 +206,7 @@ avismsgPayload_destroy (msgPayload msg) } mama_status -avisPayload_setParent (msgPayload msg, +avismsgPayload_setParent (msgPayload msg, const mamaMsg parent) { avisPayloadImpl* impl = (avisPayloadImpl*) msg; @@ -236,15 +237,15 @@ avismsgPayload_unSerialize (const msgPayload msg, int64_t tempint64; real64_t tempreal64; + uint32_t currLen = 1; + uint16_t len =0; + uint8_t * buffPos = (void*)buffer; if (!impl->mAvisMsg) impl->mAvisMsg = attributes_create(); else attributes_clear(impl->mAvisMsg); - uint32_t currLen = 1; - uint16_t len =0; - void * buffPos = (void*)buffer; buffPos+=1; // Skip payload identifier while (currLen < bufferLength) { @@ -307,7 +308,12 @@ avismsgPayload_serialize (const msgPayload msg, mama_size_t* bufferLength) { avisPayloadImpl* impl = (avisPayloadImpl*) msg; - mama_status status = MAMA_STATUS_OK; + uint8_t * buffPos = NULL; + mama_status status = MAMA_STATUS_OK; + uint16_t len = 0; + uint32_t currLen = 0; + avisFieldPayload* currField = NULL; + if (!impl->mIterator) { status = avismsgPayloadIter_create((msgPayloadIter*) &impl->mIterator, msg); @@ -333,10 +339,8 @@ avismsgPayload_serialize (const msgPayload msg, impl->mBufferLen = 200; } - void * buffPos = impl->mBuffer; - uint16_t len =0; - uint32_t currLen = 0; - avisFieldPayload* currField = avismsgPayloadIter_begin(impl->mIterator, (msgFieldPayload) impl->mAvisField, msg); + buffPos = impl->mBuffer; + currField = avismsgPayloadIter_begin(impl->mIterator, (msgFieldPayload) impl->mAvisField, msg); *(int8_t *)(buffPos) = MAMA_PAYLOAD_AVIS; buffPos+=1; currLen+=1; @@ -346,12 +350,13 @@ avismsgPayload_serialize (const msgPayload msg, switch (currField->mValue->type) { case TYPE_INT32: - len=strlen(currField->mName); + len=(uint16_t)strlen(currField->mName); if (impl->mBufferLen < currLen+3+len+sizeof(int32_t)) { void*vp=realloc (impl->mBuffer, impl->mBufferLen+200); impl->mBuffer = vp; - buffPos=&impl->mBuffer[currLen]; + buffPos=(uint8_t *)impl->mBuffer; + buffPos+=currLen; impl->mBufferLen+=200; } *(int8_t *)(buffPos) = 1; buffPos+=1; currLen+=1; @@ -365,7 +370,8 @@ avismsgPayload_serialize (const msgPayload msg, { void*vp=realloc (impl->mBuffer, impl->mBufferLen+200); impl->mBuffer = vp; - buffPos=&impl->mBuffer[currLen]; + buffPos=&impl->mBuffer; + buffPos+=currLen; impl->mBufferLen+=200; } *(int8_t *)(buffPos) = 2; buffPos+=1; currLen+=1; @@ -379,7 +385,8 @@ avismsgPayload_serialize (const msgPayload msg, { void*vp=realloc (impl->mBuffer, impl->mBufferLen+200); impl->mBuffer = vp; - buffPos=&impl->mBuffer[currLen]; + buffPos=&impl->mBuffer; + buffPos+=currLen; impl->mBufferLen+=200; } *(int8_t *)(buffPos) = 3; buffPos+=1; currLen+=1; @@ -393,7 +400,8 @@ avismsgPayload_serialize (const msgPayload msg, { void*vp=realloc (impl->mBuffer, impl->mBufferLen+200); impl->mBuffer = vp; - buffPos=&impl->mBuffer[currLen]; + buffPos=&impl->mBuffer; + buffPos+=currLen; impl->mBufferLen+=200; } *(int8_t *)(buffPos) = 4; buffPos+=1; currLen+=1; @@ -420,8 +428,8 @@ avismsgPayload_getByteBuffer (const msgPayload msg, const void** buffer, mama_size_t* bufferLength) { - CHECK_PAYLOAD(msg); avisPayloadImpl* impl = (avisPayloadImpl*)msg; + CHECK_PAYLOAD(msg); *buffer = impl->mAvisMsg; @@ -435,8 +443,8 @@ avismsgPayload_setByteBuffer (const msgPayload msg, const void* buffer, mama_size_t bufferLength) { - CHECK_PAYLOAD(msg); avisPayloadImpl* impl = (avisPayloadImpl*)msg; + CHECK_PAYLOAD(msg); impl->mAvisMsg=(Attributes*) buffer; @@ -467,6 +475,10 @@ avismsgPayload_toString (const msgPayload msg) { avisPayloadImpl* impl = (avisPayloadImpl*)msg; mama_status status = MAMA_STATUS_OK; + char *strpos = NULL; + bool comma = false; + uint16_t curlen = 1; + avisFieldPayload* currField = NULL; if (!impl->mIterator) { status = avismsgPayloadIter_create((msgPayloadIter*) &impl->mIterator, msg); @@ -491,12 +503,12 @@ avismsgPayload_toString (const msgPayload msg) impl->mStringBufferLen = 200; } - char *strpos =impl->mStringBuffer; + strpos =impl->mStringBuffer; sprintf (strpos, "%s", "{");strpos++; - bool comma = false; - uint16_t curlen = 1; + comma = false; + curlen = 1; - avisFieldPayload* currField = avismsgPayloadIter_begin(impl->mIterator, (msgFieldPayload) impl->mAvisField, msg); + currField = avismsgPayloadIter_begin(impl->mIterator, (msgFieldPayload) impl->mAvisField, msg); while (currField != NULL) { char valueString[512]; avisValue_getFieldAsString(currField->mValue, NULL, 0, valueString, sizeof(valueString)); @@ -533,6 +545,7 @@ avismsgPayload_iterateFields (const msgPayload msg, { avisPayloadImpl* impl = (avisPayloadImpl*)msg; mama_status status = MAMA_STATUS_OK; + avisFieldPayload* currField = NULL; if (!impl->mIterator) { @@ -552,7 +565,7 @@ avismsgPayload_iterateFields (const msgPayload msg, return status; } - avisFieldPayload* currField = avismsgPayloadIter_begin(impl->mIterator, (msgFieldPayload) impl->mAvisField, msg); + currField = avismsgPayloadIter_begin(impl->mIterator, (msgFieldPayload) impl->mAvisField, msg); while (currField != NULL) { mamaMsgFieldImpl_setPayload (field, currField); (cb)(msg, field, closure); @@ -578,13 +591,12 @@ mama_status avismsgPayload_apply (msgPayload dest, const msgPayload src) { + avisPayloadImpl* implSrc = (avisPayloadImpl*)src; + mama_status status = MAMA_STATUS_OK; + avisFieldPayload* currField = NULL; CHECK_PAYLOAD(dest); CHECK_PAYLOAD(src); - avisPayloadImpl* implSrc = (avisPayloadImpl*)src; - - - mama_status status = MAMA_STATUS_OK; if (!implSrc->mIterator) { @@ -604,7 +616,7 @@ avismsgPayload_apply (msgPayload dest, return status; } - avisFieldPayload* currField = avismsgPayloadIter_begin(implSrc->mIterator, (msgFieldPayload) implSrc->mAvisField, src); + currField = avismsgPayloadIter_begin(implSrc->mIterator, (msgFieldPayload) implSrc->mAvisField, src); while (currField != NULL) { switch (currField->mValue->type) { @@ -1544,23 +1556,23 @@ avismsgPayload_getField (const msgPayload msg, mama_fid_t fid, msgFieldPayload* result) { + avisPayloadImpl* impl = (avisPayloadImpl*)msg; + char tempName[64]; + char* id = (char*) name; + Value* pValue = NULL; CHECK_PAYLOAD(msg); CHECK_NAME(name, fid); - avisPayloadImpl* impl = (avisPayloadImpl*)msg; - if ( (!impl->mAvisField) && (avismsgFieldPayload_create((msgFieldPayload*) &impl->mAvisField) != MAMA_STATUS_OK) ) { return MAMA_STATUS_PLATFORM; } - char tempName[64]; - char* id = (char*) name; if (fid!=0) { snprintf (tempName, 63, "%d", fid); id=tempName; } - Value* pValue = attributes_get(avisPayload(msg), id); + pValue = attributes_get(avisPayload(msg), id); if ((!pValue) &&(name)) { pValue = attributes_get(avisPayload(msg), name); @@ -1816,9 +1828,10 @@ avismsgPayloadIter_create (msgPayloadIter* iter, msgPayload msg) { mama_status status = MAMA_STATUS_OK; + avisIterator* impl = NULL; CHECK_PAYLOAD(msg); - avisIterator* impl = calloc (1, sizeof (avisIterator)); + impl = calloc (1, sizeof (avisIterator)); if (!impl) return (MAMA_STATUS_NOMEM); impl->mMsgIterator = (AttributesIter*) avis_emalloc(sizeof(AttributesIter)); @@ -1843,16 +1856,15 @@ avismsgPayloadIter_get (msgPayloadIter iter, msgFieldPayload field, msgPayload msg) { + avisIterator* impl = (avisIterator*) iter; if (!iter || !msg || !field) return NULL; - avisIterator* impl = (avisIterator*) iter; - - avisField(field)->mName = attributes_iter_name(impl->mMsgIterator); - avisField(field)->mValue = attributes_iter_value(impl->mMsgIterator); + avisField(field)->mName = attributes_iter_name(impl->mMsgIterator); + avisField(field)->mValue = attributes_iter_value(impl->mMsgIterator); - if ((strcmp(SUBJECT_FIELD_NAME, avisField(field)->mName) == 0) || - (strcmp(INBOX_FIELD_NAME, avisField(field)->mName)== 0)) - return (avismsgPayloadIter_next(iter,field,msg)); + if ((strcmp(SUBJECT_FIELD_NAME, avisField(field)->mName) == 0) || + (strcmp(INBOX_FIELD_NAME, avisField(field)->mName)== 0)) + return (avismsgPayloadIter_next(iter,field,msg)); return field; } @@ -1862,9 +1874,9 @@ avismsgPayloadIter_next (msgPayloadIter iter, msgFieldPayload field, msgPayload msg) { + avisIterator* impl = (avisIterator*) iter; if (!iter || !msg || !field) return NULL; - avisIterator* impl = (avisIterator*) iter; if (!attributes_iter_next(impl->mMsgIterator)) return NULL; @@ -1904,8 +1916,9 @@ mama_status avismsgPayloadIter_associate (msgPayloadIter iter, msgPayload msg) { - CHECK_PAYLOAD(msg); avisIterator* impl = (avisIterator*) iter; + CHECK_PAYLOAD(msg); + if (!impl) return MAMA_STATUS_NULL_ARG; attributes_iter_init(impl->mMsgIterator, avisPayload(msg)); diff --git a/mama/c_cpp/src/c/payload/avismsg/avispayload.h b/mama/c_cpp/src/c/payload/avismsg/avispayload.h index a2c1388..2e87888 100755 --- a/mama/c_cpp/src/c/payload/avismsg/avispayload.h +++ b/mama/c_cpp/src/c/payload/avismsg/avispayload.h @@ -30,9 +30,11 @@ extern "C" { #endif +MAMAExpDLL extern mama_status avismsgPayload_destroyImpl (mamaPayloadBridge mamaPayloadBridge); +MAMAExpDLL extern mama_status avismsgPayload_createImpl (mamaPayloadBridge* result, char* identifier); diff --git a/mama/c_cpp/src/c/payload/avismsg/msgfield.c b/mama/c_cpp/src/c/payload/avismsg/msgfield.c index eb0c081..474055b 100755 --- a/mama/c_cpp/src/c/payload/avismsg/msgfield.c +++ b/mama/c_cpp/src/c/payload/avismsg/msgfield.c @@ -86,9 +86,9 @@ mamaMsgField_getDescriptor( const mamaMsgField msgField, mamaFieldDescriptor* result) { + mama_status status = MAMA_STATUS_OK; CHECK_FIELD(msgField); - mama_status status = MAMA_STATUS_OK; /* The FD may have already been obtained for this field from * getName, getFid etc.*/ if (avisField->mFieldDesc) -- 1.7.7.6
|
|
[PATCH 31/50] [avis] Windows Changes
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
Callbacks must be declared with the correct calling convention for Windows.
Signed-off-by: Mike Schonberg <mschonberg@...> --- mama/c_cpp/src/c/bridge/avis/msg.c | 3 +-- mama/c_cpp/src/c/bridge/avis/queue.c | 2 +- mama/c_cpp/src/c/bridge/avis/sub.c | 4 ++-- mama/c_cpp/src/c/bridge/avis/subinitial.c | 8 ++++---- mama/c_cpp/src/c/bridge/avis/timer.c | 4 ++-- 5 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/mama/c_cpp/src/c/bridge/avis/msg.c b/mama/c_cpp/src/c/bridge/avis/msg.c index b422543..c0553af 100644 --- a/mama/c_cpp/src/c/bridge/avis/msg.c +++ b/mama/c_cpp/src/c/bridge/avis/msg.c @@ -84,8 +84,7 @@ mama_status avisBridgeMamaMsg_destroyMiddlewareMsg (msgBridge msg) { CHECK_MSG(msg); - attributes_free(avisMsg(msg)->mAvisMsg); - free(avisMsg(msg)->mAvisMsg); + attributes_destroy(avisMsg(msg)->mAvisMsg); avisMsg(msg)->mAvisMsg = NULL; return MAMA_STATUS_OK; diff --git a/mama/c_cpp/src/c/bridge/avis/queue.c b/mama/c_cpp/src/c/bridge/avis/queue.c index fd8c629..1e7263c 100644 --- a/mama/c_cpp/src/c/bridge/avis/queue.c +++ b/mama/c_cpp/src/c/bridge/avis/queue.c @@ -174,7 +174,7 @@ avisBridgeMamaQueue_dispatchEvent (queueBridge queue) return MAMA_STATUS_OK; } -static void queueCb (void *ignored, void* closure) +static void MAMACALLTYPE queueCb (void *ignored, void* closure) { avisQueueClosure* cl = (avisQueueClosure*)closure; if (NULL ==cl) return; diff --git a/mama/c_cpp/src/c/bridge/avis/sub.c b/mama/c_cpp/src/c/bridge/avis/sub.c index 08fc697..5d0752d 100644 --- a/mama/c_cpp/src/c/bridge/avis/sub.c +++ b/mama/c_cpp/src/c/bridge/avis/sub.c @@ -72,7 +72,7 @@ const char* makeAvisSubject(const char* subject) } -static void +static void MAMACALLTYPE destroy_callback(void* subscriber, void* closure) { // cant do anything without a subscriber @@ -92,7 +92,7 @@ destroy_callback(void* subscriber, void* closure) * @param data The Avis Attributes* clone (must be freed) * @param closure The subscriber */ -static void +static void MAMACALLTYPE avis_queue_callback (void* data, void* closure) { mama_status status; diff --git a/mama/c_cpp/src/c/bridge/avis/subinitial.c b/mama/c_cpp/src/c/bridge/avis/subinitial.c index 95c8ff3..7f58441 100644 --- a/mama/c_cpp/src/c/bridge/avis/subinitial.c +++ b/mama/c_cpp/src/c/bridge/avis/subinitial.c @@ -50,7 +50,7 @@ typedef struct avisInboxImpl } while(0) -static void +static void MAMACALLTYPE avisInbox_onMsg( mamaSubscription subscription, mamaMsg msg, @@ -63,14 +63,14 @@ avisInbox_onMsg( (avisInbox(closure)->mMsgCB)(msg, avisInbox(closure)->mClosure); } -static void +static void MAMACALLTYPE avisInbox_onCreate( mamaSubscription subscription, void* closure) { } -static void +static void MAMACALLTYPE avisInbox_onDestroy( mamaSubscription subscription, void* closure) @@ -81,7 +81,7 @@ avisInbox_onDestroy( (avisInbox(closure)->mOnInboxDestroyed)(avisInbox(closure)->mParent, avisInbox(closure)->mClosure); } -static void +static void MAMACALLTYPE avisInbox_onError( mamaSubscription subscription, mama_status status, diff --git a/mama/c_cpp/src/c/bridge/avis/timer.c b/mama/c_cpp/src/c/bridge/avis/timer.c index 18aad31..4489ac6 100755 --- a/mama/c_cpp/src/c/bridge/avis/timer.c +++ b/mama/c_cpp/src/c/bridge/avis/timer.c @@ -42,7 +42,7 @@ typedef struct avisTimerImpl_ /* TODO: add queue */ } avisTimerImpl; -static void +static void MAMACALLTYPE destroy_callback(void* timer, void* closure) { avisTimerImpl* impl = (avisTimerImpl*)timer; @@ -51,7 +51,7 @@ destroy_callback(void* timer, void* closure) free (impl); } -static void +static void MAMACALLTYPE timerQueueCb (void* data, void* closure) { avisTimerImpl* impl = (avisTimerImpl*)data; -- 1.7.7.6
|
|
[PATCH 30/50] [avis] Fixed Compiler Warnings
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
Moved variable declarations to the beginning of blocks as intermingling decarations and code is not allowed pre-C99. Also fixed a few other minor warnings.
Signed-off-by: Mike Schonberg <mschonberg@...> --- mama/c_cpp/src/c/bridge/avis/msg.c | 11 +++++------ mama/c_cpp/src/c/bridge/avis/publisher.c | 30 ++++++++++++++++++------------ mama/c_cpp/src/c/bridge/avis/queue.c | 18 ++++++++++-------- mama/c_cpp/src/c/bridge/avis/sub.c | 6 +++--- mama/c_cpp/src/c/bridge/avis/timer.c | 6 +++--- 5 files changed, 39 insertions(+), 32 deletions(-)
diff --git a/mama/c_cpp/src/c/bridge/avis/msg.c b/mama/c_cpp/src/c/bridge/avis/msg.c index 8cc97eb..b422543 100644 --- a/mama/c_cpp/src/c/bridge/avis/msg.c +++ b/mama/c_cpp/src/c/bridge/avis/msg.c @@ -53,10 +53,11 @@ typedef struct avisMsgImpl mama_status avisBridgeMamaMsg_create (msgBridge* msg, mamaMsg parent) { + avisMsgImpl* impl; if (avisMsg(msg) == NULL) return MAMA_STATUS_NULL_ARG; *msg = NULL; - avisMsgImpl* impl = (avisMsgImpl*) calloc(1, sizeof(avisMsgImpl)); + impl = (avisMsgImpl*) calloc(1, sizeof(avisMsgImpl)); if (!impl) return MAMA_STATUS_NOMEM; mamaMsg_getNativeMsg(parent, (void**)&impl->mAvisMsg); @@ -109,8 +110,8 @@ avisBridgeMamaMsg_getPlatformError (msgBridge msg, void** error) mama_status avisBridgeMamaMsgImpl_setReplyHandle (msgBridge msg, void* result) { - CHECK_MSG(msg); mama_status status = MAMA_STATUS_OK; + CHECK_MSG(msg); if (MAMA_STATUS_OK != (status = mamaMsg_updateString(avisMsg(msg)->mParent, INBOX_FIELD_NAME, 0, (const char*) result))) { return status; } @@ -137,10 +138,9 @@ avisBridgeMamaMsg_setSendSubject (msgBridge msg, const char* symbol, const char* subject) { + mama_status status = MAMA_STATUS_OK; CHECK_MSG(msg); - // TODO -- symbol? - mama_status status = MAMA_STATUS_OK; if (MAMA_STATUS_OK != (status = mamaMsg_updateString(avisMsg(msg)->mParent, SUBJECT_FIELD_NAME, 0, subject))) { return status; } @@ -164,10 +164,9 @@ avisBridgeMamaMsg_getNativeHandle (msgBridge msg, void** result) mama_status avisBridgeMamaMsg_duplicateReplyHandle (msgBridge msg, void** result) { - CHECK_MSG(msg); - const char* replyAddr; mama_status status = MAMA_STATUS_OK; + CHECK_MSG(msg); if (MAMA_STATUS_OK != (status = mamaMsg_getString(avisMsg(msg)->mParent, INBOX_FIELD_NAME, 0, &replyAddr))) { return status; } diff --git a/mama/c_cpp/src/c/bridge/avis/publisher.c b/mama/c_cpp/src/c/bridge/avis/publisher.c index bc416fa..faaceb7 100644 --- a/mama/c_cpp/src/c/bridge/avis/publisher.c +++ b/mama/c_cpp/src/c/bridge/avis/publisher.c @@ -67,12 +67,14 @@ avisBridgeMamaPublisher_createByIndex (publisherBridge* result, void* nativeQueueHandle, mamaPublisher parent) { - if (!result || !tport) return MAMA_STATUS_NULL_ARG; Elvin* avis = getAvis(tport); + avisPublisherBridge* publisher = NULL; + + if (!result || !tport) return MAMA_STATUS_NULL_ARG; CHECK_AVIS(avis); *result = NULL; - avisPublisherBridge* publisher = (avisPublisherBridge*) calloc (1, sizeof(avisPublisherBridge)); + publisher = (avisPublisherBridge*) calloc (1, sizeof(avisPublisherBridge)); if (publisher == NULL) return MAMA_STATUS_NOMEM; publisher->mTransport = tport; @@ -145,10 +147,11 @@ avisBridgeMamaPublisherImpl_buildSendSubject (avisPublisherBridge* impl) mama_status avisBridgeMamaPublisher_send (publisherBridge publisher, mamaMsg msg) { - CHECK_PUBLISHER(publisher); mama_size_t dataLen; mama_status status; - Attributes* attributes; + Attributes* attributes = NULL; + + CHECK_PUBLISHER(publisher); status = mamaMsgImpl_getPayloadBuffer (msg, (const void**)&attributes, &dataLen); if (attributes == NULL) @@ -173,18 +176,20 @@ avisBridgeMamaPublisher_sendReplyToInbox (publisherBridge publisher, mamaMsg request, mamaMsg reply) { - CHECK_PUBLISHER(publisher); Attributes* requestMsg = NULL; Attributes* replyMsg = NULL; + const char* replyAddr = NULL; mama_size_t dataLen; + mama_status status; + + CHECK_PUBLISHER(publisher); mamaMsg_getNativeHandle(request, (void**) &requestMsg); mamaMsgImpl_getPayloadBuffer (reply, (const void**)&replyMsg, &dataLen); if (!requestMsg || !replyMsg) return MAMA_STATUS_NULL_ARG; - const char* replyAddr = NULL; - mama_status status = mamaMsg_getString(request, INBOX_FIELD_NAME, 0, &replyAddr); + status = mamaMsg_getString(request, INBOX_FIELD_NAME, 0, &replyAddr); if ((status != MAMA_STATUS_OK) || (replyAddr == NULL) || (strlen(replyAddr) == 0)) { mama_log (MAMA_LOG_LEVEL_ERROR, "avisBridgeMamaPublisher_sendReplyToInbox(): " "No reply address in message."); @@ -223,6 +228,8 @@ avisBridgeMamaPublisher_sendFromInboxByIndex (publisherBridge publisher, mamaInbox inbox, mamaMsg msg) { + const char* replyAddr = NULL; + mama_status status; // CHECK_PUBLISHER(publisher); if (avisPublisher(publisher) == 0) return MAMA_STATUS_NULL_ARG; @@ -231,13 +238,11 @@ avisBridgeMamaPublisher_sendFromInboxByIndex (publisherBridge publisher, if (!elvin_is_open(avisPublisher(publisher)->mAvis)) return MAMA_STATUS_INVALID_ARG; - - // get reply address from inbox - const char* replyAddr = avisInboxImpl_getReplySubject(mamaInboxImpl_getInboxBridge(inbox)); + replyAddr = avisInboxImpl_getReplySubject(mamaInboxImpl_getInboxBridge(inbox)); // set reply address in msg - mama_status status = mamaMsg_updateString(msg, INBOX_FIELD_NAME, 0, replyAddr); + status = mamaMsg_updateString(msg, INBOX_FIELD_NAME, 0, replyAddr); if (status != MAMA_STATUS_OK) return status; @@ -258,9 +263,10 @@ avisBridgeMamaPublisher_sendReplyToInboxHandle (publisherBridge publisher, void * inbox, mamaMsg reply) { + mama_status status; CHECK_PUBLISHER(publisher); - mama_status status = mamaMsg_updateString(reply, SUBJECT_FIELD_NAME, 0, (const char*) inbox); + status = mamaMsg_updateString(reply, SUBJECT_FIELD_NAME, 0, (const char*) inbox); if (status != MAMA_STATUS_OK) return status; diff --git a/mama/c_cpp/src/c/bridge/avis/queue.c b/mama/c_cpp/src/c/bridge/avis/queue.c index 24ee8d1..fd8c629 100644 --- a/mama/c_cpp/src/c/bridge/avis/queue.c +++ b/mama/c_cpp/src/c/bridge/avis/queue.c @@ -51,11 +51,12 @@ mama_status avisBridgeMamaQueue_create (queueBridge* queue, mamaQueue parent) { + avisQueueBridge* avisQueue = NULL; if (queue == NULL) return MAMA_STATUS_NULL_ARG; *queue = NULL; - avisQueueBridge* avisQueue = (avisQueueBridge*)calloc (1, sizeof (avisQueueBridge)); + avisQueue = (avisQueueBridge*)calloc (1, sizeof (avisQueueBridge)); if (avisQueue == NULL) return MAMA_STATUS_NOMEM; @@ -74,11 +75,12 @@ avisBridgeMamaQueue_create_usingNative (queueBridge* queue, mamaQueue parent, void* nativeQueue) { + avisQueueBridge* avisQueue = NULL; if (queue == NULL) return MAMA_STATUS_NULL_ARG; *queue = NULL; - avisQueueBridge* avisQueue = (avisQueueBridge*)calloc (1, sizeof (avisQueueBridge)); + avisQueue = (avisQueueBridge*)calloc (1, sizeof (avisQueueBridge)); if (avisQueue == NULL) return MAMA_STATUS_NOMEM; @@ -104,9 +106,9 @@ avisBridgeMamaQueue_destroy (queueBridge queue) mama_status avisBridgeMamaQueue_dispatch (queueBridge queue) { - CHECK_QUEUE(queue); wombatQueueStatus status; + CHECK_QUEUE(queue); do { /* 500 is .5 seconds */ @@ -132,8 +134,8 @@ avisBridgeMamaQueue_dispatch (queueBridge queue) mama_status avisBridgeMamaQueue_timedDispatch (queueBridge queue, uint64_t timeout) { - CHECK_QUEUE(queue); wombatQueueStatus status; + CHECK_QUEUE(queue); status = wombatQueue_timedDispatch (avisQueue(queue)->mQueue, NULL, NULL, timeout); @@ -154,8 +156,8 @@ avisBridgeMamaQueue_timedDispatch (queueBridge queue, uint64_t timeout) mama_status avisBridgeMamaQueue_dispatchEvent (queueBridge queue) { - CHECK_QUEUE(queue); wombatQueueStatus status; + CHECK_QUEUE(queue); status = wombatQueue_dispatch (avisQueue(queue)->mQueue, NULL, NULL); @@ -186,10 +188,10 @@ avisBridgeMamaQueue_enqueueEvent (queueBridge queue, void* closure) { wombatQueueStatus status; + avisQueueClosure* cl = NULL; CHECK_QUEUE(queue); - avisQueueClosure* cl = - (avisQueueClosure*)calloc(1, sizeof(avisQueueClosure)); + cl = (avisQueueClosure*)calloc(1, sizeof(avisQueueClosure)); if (NULL == cl) return MAMA_STATUS_NOMEM; cl->mImpl = avisQueue(queue); @@ -208,8 +210,8 @@ avisBridgeMamaQueue_enqueueEvent (queueBridge queue, mama_status avisBridgeMamaQueue_stopDispatch (queueBridge queue) { - CHECK_QUEUE(queue); wombatQueueStatus status; + CHECK_QUEUE(queue); if (queue == NULL) return MAMA_STATUS_NULL_ARG; diff --git a/mama/c_cpp/src/c/bridge/avis/sub.c b/mama/c_cpp/src/c/bridge/avis/sub.c index edc026b..08fc697 100644 --- a/mama/c_cpp/src/c/bridge/avis/sub.c +++ b/mama/c_cpp/src/c/bridge/avis/sub.c @@ -153,7 +153,6 @@ avis_queue_callback (void* data, void* closure) attributes_free ((Attributes*)data); free ((Attributes*)data); - } static void @@ -199,10 +198,11 @@ avisBridgeMamaSubscription_create (subscriptionBridge* subscriber, mamaSubscription subscription, void* closure) { + avisSubscription* impl = NULL; if (!subscriber || !subscription || !transport ) return MAMA_STATUS_NULL_ARG; - avisSubscription* impl = (avisSubscription*)calloc (1, sizeof(avisSubscription)); + impl = (avisSubscription*)calloc (1, sizeof(avisSubscription)); if (impl == NULL) return MAMA_STATUS_NOMEM; @@ -269,9 +269,9 @@ avisBridgeMamaSubscription_createWildCard ( mama_status avisBridgeMamaSubscription_destroy (subscriptionBridge subscriber) { - CHECK_SUBSCRIBER(subscriber); mama_status status = MAMA_STATUS_OK; wombatQueue queue = NULL; + CHECK_SUBSCRIBER(subscriber); elvin_subscription_remove_listener(avisSub(subscriber)->mAvisSubscription, avis_callback); diff --git a/mama/c_cpp/src/c/bridge/avis/timer.c b/mama/c_cpp/src/c/bridge/avis/timer.c index 7a69051..18aad31 100755 --- a/mama/c_cpp/src/c/bridge/avis/timer.c +++ b/mama/c_cpp/src/c/bridge/avis/timer.c @@ -72,7 +72,7 @@ timerCb (timerElement timer, /* Mama timers are repeating */ timeout.tv_sec = (time_t)impl->mInterval; - timeout.tv_usec = (suseconds_t)((impl->mInterval- timeout.tv_sec) * 1000000.0); + timeout.tv_usec = ((impl->mInterval- timeout.tv_sec) * 1000000.0); if (0 != createTimer (&impl->mTimerElement, gTimerHeap, timerCb, @@ -122,7 +122,7 @@ avisBridgeMamaTimer_create (timerBridge* result, *result = (timerBridge)impl; timeout.tv_sec = (time_t)interval; - timeout.tv_usec = (suseconds_t)((interval-timeout.tv_sec) * 1000000.0); + timeout.tv_usec = ((interval-timeout.tv_sec) * 1000000.0); if (0 != createTimer (&impl->mTimerElement, gTimerHeap, timerCb, @@ -180,7 +180,7 @@ avisBridgeMamaTimer_reset (timerBridge timer) impl = (avisTimerImpl*)timer; timeout.tv_sec = (time_t)impl->mInterval; - timeout.tv_usec = (suseconds_t)((impl->mInterval-timeout.tv_sec) * 1000000.0); + timeout.tv_usec = ((impl->mInterval-timeout.tv_sec) * 1000000.0); if (timer == NULL) return MAMA_STATUS_NULL_ARG; -- 1.7.7.6
|
|
[PATCH 29/50] [avis] Use Platform Independent UUID from Common
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
Windows does not support libuuid (DCE Compatible Universally Unique Identifier Library). The OpenMAMA common library provides a compatibility layer.
Signed-off-by: Mike Schonberg <mschonberg@...> --- mama/c_cpp/src/c/bridge/avis/Makefile.am | 2 +- mama/c_cpp/src/c/bridge/avis/subinitial.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/mama/c_cpp/src/c/bridge/avis/Makefile.am b/mama/c_cpp/src/c/bridge/avis/Makefile.am index 8cc5913..4385ff0 100644 --- a/mama/c_cpp/src/c/bridge/avis/Makefile.am +++ b/mama/c_cpp/src/c/bridge/avis/Makefile.am @@ -40,7 +40,7 @@ CFLAGS += -Wimplicit -Wno-long-long -Wmissing-prototypes -Wstrict-prototypes -Wa CPPFLAGS += -Wno-long-long -Wimplicit -Wno-long-long -Wmissing-prototypes -Wstrict-prototypes -Wall endif -LIBS = -lavis -luuid -lmama -lm -lwombatcommon +LIBS = -lavis -lmama -lm -lwombatcommon -luuid libmamaavisimpl_la_SOURCES = \ bridge.c \ diff --git a/mama/c_cpp/src/c/bridge/avis/subinitial.c b/mama/c_cpp/src/c/bridge/avis/subinitial.c index 7567732..95c8ff3 100644 --- a/mama/c_cpp/src/c/bridge/avis/subinitial.c +++ b/mama/c_cpp/src/c/bridge/avis/subinitial.c @@ -19,7 +19,7 @@ * 02110-1301 USA */ -#include <uuid/uuid.h> +#include <wombat/wUuid.h> #include <mama/mama.h> #include <bridge.h> @@ -107,27 +107,27 @@ avisBridgeMamaInbox_createByIndex (inboxBridge* bridge, void* closure, mamaInbox parent) { + wUuid t_uuid; + char t_str[37]; + mamaMsgCallbacks cb; + avisInboxImpl* impl = NULL; + mama_status status = MAMA_STATUS_OK; if (!bridge || !transport || !queue || !msgCB) return MAMA_STATUS_NULL_ARG; - avisInboxImpl* impl = (avisInboxImpl*)calloc(1, sizeof(avisInboxImpl)); + impl = (avisInboxImpl*)calloc(1, sizeof(avisInboxImpl)); if (!impl) return MAMA_STATUS_NOMEM; - mama_status status = MAMA_STATUS_OK; if (MAMA_STATUS_OK != (status = mamaSubscription_allocate(&impl->mSubscription))) { mama_log (MAMA_LOG_LEVEL_ERROR, "avisBridgeMamaInbox_createByIndex(): Failed to allocate subscription "); free(impl); return status; } - uuid_t t_uuid; // NOTE: uuid_generate is very expensive, so we use cheaper uuid_generate_time - //uuid_generate(uuid); - uuid_generate_time(t_uuid); - char t_str[uuidStringLen+1]; - uuid_unparse(t_uuid, t_str); + wUuid_generate_time(t_uuid); + wUuid_unparse(t_uuid, t_str); snprintf(impl->mInbox, sizeof(impl->mInbox) -1, "_INBOX.%s", t_str); - mamaMsgCallbacks cb; cb.onCreate = &avisInbox_onCreate; cb.onError = &avisInbox_onError; cb.onMsg = &avisInbox_onMsg; -- 1.7.7.6
|
|
[PATCH 28/50] [mama] Minor Header Adjustments
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
Moved #includes outside of #extern "C" in types.h to avoid issues on Windows where standard headers may contain C++ templates.
Include port.h from middleware.c.
Signed-off-by: Mike Schonberg <mschonberg@...> --- mama/c_cpp/src/c/mama/types.h | 9 +++++---- mama/c_cpp/src/c/middleware.c | 1 + 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/mama/c_cpp/src/c/mama/types.h b/mama/c_cpp/src/c/mama/types.h index d26c206..e0227ff 100644 --- a/mama/c_cpp/src/c/mama/types.h +++ b/mama/c_cpp/src/c/mama/types.h @@ -22,15 +22,14 @@ #ifndef MamaTypesH__ #define MamaTypesH__ -#if defined(__cplusplus) -extern "C" { -#endif #include "wombat/port.h" #include <stdlib.h> #include <string.h> -#define MAMA_QUANTITY_EPSILON ((mama_f64_t)0.00000000001) +#if defined(__cplusplus) +extern "C" { +#endif typedef int8_t mama_i8_t; typedef uint8_t mama_u8_t; @@ -48,6 +47,8 @@ typedef uint16_t mama_fid_t; typedef size_t mama_size_t; typedef uint32_t mama_seqnum_t; +#define MAMA_QUANTITY_EPSILON ((mama_f64_t)0.00000000001) + /** * Macro to determine if a quantity is zero */ diff --git a/mama/c_cpp/src/c/middleware.c b/mama/c_cpp/src/c/middleware.c index ce80c4f..ad288ad 100644 --- a/mama/c_cpp/src/c/middleware.c +++ b/mama/c_cpp/src/c/middleware.c @@ -19,6 +19,7 @@ * 02110-1301 USA */ +#include "wombat/port.h" #include <mama/middleware.h> #include <string.h> -- 1.7.7.6
|
|
[PATCH 27/50] [mama] Log Messages with MAMA_MSG_STATUS_UNKNOWN
Michael Schonberg <mschonberg@...>
From: Mike Schonberg <mschonberg@...>
On receiving a message with a status of MAMA_MSG_STATUS_UNKNOWN, log the message if at FINEST and track it update the statistics for the transport, queue and application.
Also tidied up the file a little: converted tabs to space, reformatted long lines, etc.
Signed-off-by: Mike Schonberg <mschonberg@...> --- mama/c_cpp/src/c/listenermsgcallback.c | 122 +++++++++++++++++--------------- 1 files changed, 64 insertions(+), 58 deletions(-)
diff --git a/mama/c_cpp/src/c/listenermsgcallback.c b/mama/c_cpp/src/c/listenermsgcallback.c index cbe1c90..532a433 100644 --- a/mama/c_cpp/src/c/listenermsgcallback.c +++ b/mama/c_cpp/src/c/listenermsgcallback.c @@ -45,33 +45,12 @@ extern int gGenerateTransportStats; extern int gGenerateGlobalStats; extern int gGenerateQueueStats; -/* *************************************************** */ -/* Private Function Prototypes. */ -/* *************************************************** */ - -/** - * This function will invoke the subscription's onError callback passing in a particular error code. - * - * @param[in] callback The impl. - * @param[in] ctx The subscription context. - * @param[in] mamaStatus The status that will be passed to the error callback. - * @param[in] subscription The subscription. - * @param[in] userSymbol The symbol. - */ -static void -listenerMsgCallbackImpl_invokeErrorCallback(listenerMsgCallback callback, +/* Function prototypes. */ +void listenerMsgCallback_invokeErrorCallback(listenerMsgCallback callback, SubjectContext *ctx, mama_status mamaStatus, mamaSubscription subscription, const char *userSymbol); -/** - * This function will write a log message if an unknown message status is detected. - * - * @param[in] ctx The subscription context. - * @param[in] status The message status. - * @param[in] subscription The subscription. - */ -static void -listenerMsgCallbackImpl_logUnknownStatus(SubjectContext *ctx, int status, +void listenerMsgCallbackImpl_logUnknownStatus(SubjectContext *ctx, int status, mamaSubscription subscription); /** @@ -195,7 +174,8 @@ static void processPointToPointMessage (msgCallback* callback, /* Mark the subscription as inactive if we are not expecting * any more updates. */ - if (!mamaSubscription_isExpectingUpdates (self->mSubscription)) + if (!mamaSubscription_isExpectingUpdates (self->mSubscription) && + !mamaSubscription_getAcceptMultipleInitials (self->mSubscription)) { mamaSubscription_deactivate (self->mSubscription); } @@ -223,6 +203,33 @@ static void processPointToPointMessage (msgCallback* callback, * may have been destroyed in the callback! */ } +/* Description : This function will invoke the subscription's onError callback + * passing in a particular error code. + */ +void listenerMsgCallback_invokeErrorCallback(listenerMsgCallback callback, + SubjectContext *ctx, mama_status mamaStatus, mamaSubscription + subscription, const char *userSymbol) +{ + /* Local variables. */ + void *closure = NULL; + + /* Get the callback object from the subscription. */ + mamaMsgCallbacks *cbs = mamaSubscription_getUserCallbacks (subscription); + + /* Wait for a response. */ + mamaSubscription_stopWaitForResponse(subscription, ctx); + + /* Get the closure from the subscription. */ + mamaSubscription_getClosure (subscription, &closure); + + mama_setLastError (MAMA_ERROR_DEFAULT); + cbs->onError (subscription, + mamaStatus, + NULL, + userSymbol, + closure); +} + static int isInitialMessageOrRecap (msgCallback *callback, int msgType) { return msgType == MAMA_MSG_TYPE_INITIAL || @@ -247,7 +254,7 @@ listenerMsgCallback_processMsg( listenerMsgCallback callback, mamaMsg msg, mamaTransport transport; mamaStatsCollector* queueStatsCollector = NULL; mamaStatsCollector* tportStatsCollector = NULL; - const char* userSymbol = NULL; + const char* userSymbol = NULL; if (!ctx) { @@ -283,22 +290,25 @@ listenerMsgCallback_processMsg( listenerMsgCallback callback, mamaMsg msg, MamaStatNumMessages.mFid); /* Get the user symbol from the subscription. */ - mamaSubscription_getSymbol(subscription, &userSymbol); + mamaSubscription_getSymbol(subscription, &userSymbol); if (status != MAMA_MSG_STATUS_OK) { switch (status) { case MAMA_MSG_STATUS_NOT_PERMISSIONED: - listenerMsgCallbackImpl_invokeErrorCallback(callback, ctx, MAMA_STATUS_NOT_PERMISSIONED, subscription, userSymbol); + listenerMsgCallback_invokeErrorCallback(callback, ctx, + MAMA_STATUS_NOT_PERMISSIONED, subscription, userSymbol); return; case MAMA_MSG_STATUS_BAD_SYMBOL: - listenerMsgCallbackImpl_invokeErrorCallback(callback, ctx, MAMA_STATUS_BAD_SYMBOL, subscription, userSymbol); + listenerMsgCallback_invokeErrorCallback(callback, ctx, + MAMA_STATUS_BAD_SYMBOL, subscription, userSymbol); return; case MAMA_MSG_STATUS_NOT_FOUND: - listenerMsgCallbackImpl_invokeErrorCallback(callback, ctx, MAMA_STATUS_NOT_FOUND, subscription, userSymbol); + listenerMsgCallback_invokeErrorCallback(callback, ctx, + MAMA_STATUS_NOT_FOUND, subscription, userSymbol); return; case MAMA_MSG_STATUS_NO_SUBSCRIBERS: @@ -338,6 +348,30 @@ listenerMsgCallback_processMsg( listenerMsgCallback callback, mamaMsg msg, listenerMsgCallbackImpl_logUnknownStatus(ctx, status, subscription); break; } + case MAMA_MSG_STATUS_UNKNOWN: + { + listenerMsgCallbackImpl_logUnknownStatus(ctx, status, subscription); + mamaSubscription_setPossiblyStale(subscription); + + if (queueStatsCollector) + { + mamaStatsCollector_incrementStat (*queueStatsCollector, + MamaStatUnknownMsgs.mFid); + } + if (tportStatsCollector) + { + mamaStatsCollector_incrementStat (*tportStatsCollector, + MamaStatUnknownMsgs.mFid); + } + if (mamaInternal_getGlobalStatsCollector()) + { + mamaStatsCollector_incrementStat + (*(mamaInternal_getGlobalStatsCollector()), + MamaStatUnknownMsgs.mFid); + } + return; //throw away msg + break; + } default: { /* Log the fact we have received an unknown message. */ @@ -587,34 +621,6 @@ checkEntitlement( msgCallback *callback, mamaMsg msg, SubjectContext* ctx ) #endif /* WITH_ENTITLEMENTS */ } -/* *************************************************** */ -/* Private Functions. */ -/* *************************************************** */ - -/* Description: This function will invoke the subscription's onError callback passing in a particular error code. - */ -void listenerMsgCallbackImpl_invokeErrorCallback(listenerMsgCallback callback, SubjectContext *ctx, mama_status mamaStatus, mamaSubscription subscription, const char *userSymbol) -{ - /* Local variables. */ - void *closure = NULL; - - /* Get the callback object from the subscription. */ - mamaMsgCallbacks *cbs = mamaSubscription_getUserCallbacks (subscription); - - /* Wait for a response. */ - mamaSubscription_stopWaitForResponse(subscription, ctx); - - /* Get the closure from the subscription. */ - mamaSubscription_getClosure (subscription, &closure); - - mama_setLastError (MAMA_ERROR_DEFAULT); - cbs->onError (subscription, - mamaStatus, - NULL, - userSymbol, - closure); -} - void listenerMsgCallbackImpl_logUnknownStatus(SubjectContext *ctx, int status, mamaSubscription subscription) { -- 1.7.7.6
|
|