From acfa06338337d108cef6362a090ad1b6ac4e6047 Mon Sep 17 00:00:00 2001 From: Mark Haverkamp Date: Fri, 4 Feb 2005 21:19:20 +0000 Subject: [PATCH] Update to B spec API (Logical change 1.130) git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@472 fd59a12c-fef9-0310-b244-a6a79926bd2f --- test/evtbench.c | 36 ++--- test/publish.c | 36 ++--- test/sa_error.c | 60 ++++---- test/subscription.c | 83 ++++++----- test/testevt.c | 340 ++++++++++++++++++++++---------------------- 5 files changed, 283 insertions(+), 272 deletions(-) diff --git a/test/evtbench.c b/test/evtbench.c index 81e5aba1..ed701fa2 100644 --- a/test/evtbench.c +++ b/test/evtbench.c @@ -12,11 +12,11 @@ #include #include #include "ais_types.h" -#include "ais_evt.h" +#include "saEvt.h" // #define EVENT_SUBSCRIBE -SaVersionT version = { 'A', 0x01, 0x01 }; +SaVersionT version = { 'B', 0x01, 0x01 }; void event_callback( SaEvtSubscriptionIdT subscriptionId, const SaEvtEventHandleT eventHandle, @@ -143,13 +143,13 @@ test_pub() result = saEvtInitialize (&handle, &callbacks, &version); - if (result != SA_OK) { + if (result != SA_AIS_OK) { printf("Event Initialize result: %d\n", result); exit(1); } result = saEvtChannelOpen(handle, &channel_name, flags, 0, &channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { printf("channel open result: %d\n", result); goto evt_fin; } @@ -164,19 +164,19 @@ test_pub() &subscribe_filters, subscription_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { printf("event subscribe result: %d\n", result); result = saEvtChannelClose(channel_handle); - if (result != SA_OK) + if (result != SA_AIS_OK) printf("Channel close result: %d\n", result); result = saEvtFinalize(handle); - if (result != SA_OK) + if (result != SA_AIS_OK) printf("Finalize result: %d\n", result); return; } #endif result = saEvtEventAllocate(channel_handle, &event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { printf("event Allocate result: %d\n", result); goto evt_free; } @@ -189,7 +189,7 @@ test_pub() TEST_PRIORITY, test_retention, &test_pub_name); - if (result != SA_OK) { + if (result != SA_AIS_OK) { printf("event set attr result(2): %d\n", result); goto evt_free; } @@ -198,7 +198,7 @@ test_pub() for (i = 0; i < write_count; i++) { result = saEvtEventPublish(event_handle, user_data, write_size, &event_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { printf("event Publish result(2): %d\n", result); goto evt_close; } @@ -223,7 +223,7 @@ exit (1); * See if we got the event */ result = saEvtSelectionObjectGet(handle, &fd); - if (result != SA_OK) { + if (result != SA_AIS_OK) { printf("saEvtSelectionObject get %d\n", result); /* error */ return; @@ -242,7 +242,7 @@ exit (1); printf("Got poll event\n"); result = saEvtDispatch(handle, SA_DISPATCH_ONE); - if (result != SA_OK) { + if (result != SA_AIS_OK) { printf("saEvtDispatch %d\n", result); goto evt_fin; } @@ -254,20 +254,20 @@ exit (1); */ evt_free: result = saEvtEventFree(event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { printf("event free result: %d\n", result); } evt_close: result = saEvtChannelClose(channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { printf("channel close result: %d\n", result); } evt_fin: result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { printf("Event Finalize result: %d\n", result); } printf("Done\n"); @@ -279,7 +279,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id, const SaEvtEventHandleT event_handle, const SaSizeT event_data_size) { - SaErrorT result; + SaAisErrorT result; SaUint8T priority; SaTimeT retention_time; SaNameT publisher_name = {0, {0}}; @@ -289,7 +289,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id, printf("event_callback called\n"); printf("sub ID: %x\n", subscription_id); - printf("event_handle %x\n", event_handle); + printf("event_handle %llx\n", event_handle); printf("event data size %d\n", event_data_size); evt_pat_get_array.patternsNumber = 4; @@ -301,7 +301,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id, &publish_time, /* publish time */ &event_id /* event_id */ ); - if (result != SA_OK) { + if (result != SA_AIS_OK) { printf("event get attr result(2): %d\n", result); goto evt_free; } diff --git a/test/publish.c b/test/publish.c index 0cf3d6c4..cdf1219c 100644 --- a/test/publish.c +++ b/test/publish.c @@ -12,18 +12,18 @@ #include #include #include "ais_types.h" -#include "ais_evt.h" +#include "saEvt.h" // #define EVENT_SUBSCRIBE -extern int get_sa_error(SaErrorT, char *, int); +extern int get_sa_error(SaAisErrorT, char *, int); char result_buf[256]; int result_buf_len = sizeof(result_buf); static int pub_count = 1; static int wait_time = -1; -SaVersionT version = { 'A', 0x01, 0x01 }; +SaVersionT version = { 'B', 0x01, 0x01 }; void event_callback( SaEvtSubscriptionIdT subscriptionId, const SaEvtEventHandleT eventHandle, @@ -134,7 +134,7 @@ test_pub() - SaErrorT result; + SaAisErrorT result; flags = SA_EVT_CHANNEL_PUBLISHER | #ifdef EVENT_SUBSCRIBE @@ -146,14 +146,14 @@ test_pub() result = saEvtInitialize (&handle, &callbacks, &version); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("Event Initialize result: %s\n", result_buf); exit(result); } result = saEvtChannelOpen(handle, &channel_name, flags, 0, &channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("channel open result: %s\n", result_buf); exit(result); @@ -169,14 +169,14 @@ test_pub() &subscribe_filters, subscription_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("event subscribe result: %s\n", result_buf); exit(result); } #endif result = saEvtEventAllocate(channel_handle, &event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("event Allocate result: %s\n", result_buf); exit(result); @@ -190,7 +190,7 @@ test_pub() TEST_PRIORITY, test_retention, &test_pub_name); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("event set attr result(2): %s\n", result_buf); exit(result); @@ -199,7 +199,7 @@ test_pub() for (i = 0; i < pub_count; i++) { result = saEvtEventPublish(event_handle, user_data, user_data_size, &event_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("event Publish result(2): %s\n", result_buf); exit(result); @@ -212,7 +212,7 @@ test_pub() * See if we got the event */ result = saEvtSelectionObjectGet(handle, &fd); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("saEvtSelectionObject get %s\n", result_buf); /* error */ @@ -234,7 +234,7 @@ test_pub() printf("Got poll event\n"); result = saEvtDispatch(handle, SA_DISPATCH_ONE); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("saEvtDispatch %s\n", result_buf); exit(result); @@ -247,7 +247,7 @@ test_pub() * Test cleanup */ result = saEvtEventFree(event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("event free result: %s\n", result_buf); exit(result); @@ -255,14 +255,14 @@ test_pub() result = saEvtChannelClose(channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("channel close result: %s\n", result_buf); exit(result); } result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("Event Finalize result: %s\n", result_buf); exit(result); @@ -277,7 +277,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id, const SaEvtEventHandleT event_handle, const SaSizeT event_data_size) { - SaErrorT result; + SaAisErrorT result; SaUint8T priority; SaTimeT retention_time; SaNameT publisher_name = {0, {0}}; @@ -287,7 +287,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id, printf("event_callback called\n"); printf("sub ID: %x\n", subscription_id); - printf("event_handle %x\n", event_handle); + printf("event_handle %llx\n", event_handle); printf("event data size %d\n", event_data_size); evt_pat_get_array.patternsNumber = 4; @@ -299,7 +299,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id, &publish_time, /* publish time */ &event_id /* event_id */ ); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("event get attr result(2): %s\n", result_buf); goto evt_free; diff --git a/test/sa_error.c b/test/sa_error.c index 75414133..7b26489f 100644 --- a/test/sa_error.c +++ b/test/sa_error.c @@ -4,41 +4,39 @@ const char *sa_error_list[] = { "OUT_OF_RANGE", - "SA_OK", - "SA_ERR_LIBRARY", - "SA_ERR_VERSION", - "SA_ERR_INIT", - "SA_ERR_TIMEOUT", - "SA_ERR_TRY_AGAIN", - "SA_ERR_INVALID_PARAM", - "SA_ERR_NO_MEMORY", - "SA_ERR_BAD_HANDLE", - "SA_ERR_BUSY", - "SA_ERR_ACCESS", - "SA_ERR_NOT_EXIST", - "SA_ERR_NAME_TOO_LONG", - "SA_ERR_EXIST", - "SA_ERR_NO_SPACE", - "SA_ERR_INTERRUPT", - "SA_ERR_SYSTEM", - "SA_ERR_NAME_NOT_FOUND", - "SA_ERR_NO_RESOURCES", - "SA_ERR_NOT_SUPPORTED", - "SA_ERR_BAD_OPERATION", - "SA_ERR_FAILED_OPERATION", - "SA_ERR_MESSAGE_ERROR", - "SA_ERR_NO_MESSAGE", - "SA_ERR_QUEUE_FULL", - "SA_ERR_QUEUE_NOT_AVAILABLE", - "SA_ERR_BAD_CHECKPOINT", - "SA_ERR_BAD_FLAGS", - "SA_ERR_SECURITY", + "SA_AIS_OK", + "SA_AIS_ERR_LIBRARY", + "SA_AIS_ERR_VERSION", + "SA_AIS_ERR_INIT", + "SA_AIS_ERR_TIMEOUT", + "SA_AIS_ERR_TRY_AGAIN", + "SA_AIS_ERR_INVALID_PARAM", + "SA_AIS_ERR_NO_MEMORY", + "SA_AIS_ERR_BAD_HANDLE", + "SA_AIS_ERR_BUSY", + "SA_AIS_ERR_ACCESS", + "SA_AIS_ERR_NOT_EXIST", + "SA_AIS_ERR_NAME_TOO_LONG", + "SA_AIS_ERR_EXIST", + "SA_AIS_ERR_NO_SPACE", + "SA_AIS_ERR_INTERRUPT", + "SA_AIS_ERR_NAME_NOT_FOUND", + "SA_AIS_ERR_NO_RESOURCES", + "SA_AIS_ERR_NOT_SUPPORTED", + "SA_AIS_ERR_BAD_OPERATION", + "SA_AIS_ERR_FAILED_OPERATION", + "SA_AIS_ERR_MESSAGE_ERROR", + "SA_AIS_ERR_QUEUE_FULL", + "SA_AIS_ERR_QUEUE_NOT_AVAILABLE", + "SA_AIS_ERR_BAD_CHECKPOINT", + "SA_AIS_ERR_BAD_FLAGS", + "SA_AIS_ERR_NO_SECTIONS", }; int get_sa_error(SaErrorT error, char *str, int len) { - if (error < SA_OK || - error > SA_ERR_SECURITY || + if (error < SA_AIS_OK || + error > SA_AIS_ERR_NO_SECTIONS || len < strlen(sa_error_list[error])) { errno = EINVAL; return -1; diff --git a/test/subscription.c b/test/subscription.c index 654fc630..7fb02a53 100644 --- a/test/subscription.c +++ b/test/subscription.c @@ -12,19 +12,19 @@ #include #include #include "ais_types.h" -#include "ais_evt.h" +#include "saEvt.h" #define TEST_EVENT_ORDER 1 #define EVT_FREQ 1000 uint32_t evt_count = 0; -extern int get_sa_error(SaErrorT, char *, int); +extern int get_sa_error(SaAisErrorT, char *, int); char result_buf[256]; int result_buf_len = sizeof(result_buf); int quiet = 0; -SaVersionT version = { 'A', 0x01, 0x01 }; +SaVersionT version = { 'B', 0x01, 0x01 }; void event_callback( SaEvtSubscriptionIdT subscriptionId, const SaEvtEventHandleT eventHandle, @@ -108,14 +108,14 @@ test_subscription() printf("Test subscription:\n"); result = saEvtInitialize (&handle, &callbacks, &version); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("Event Initialize result: %s\n", result_buf); return; } result = saEvtChannelOpen(handle, &channel_name, flags, 0, &channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("channel open result: %s\n", result_buf); goto init_fin; @@ -129,7 +129,7 @@ test_subscription() &subscribe_filters[i], subscription_id[i]); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("event subscribe result: %s\n", result_buf); goto chan_fin; @@ -140,7 +140,7 @@ test_subscription() * See if we got the event */ result = saEvtSelectionObjectGet(handle, &fd); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("saEvtSelectionObject get %s\n", result_buf); goto sub_fin; @@ -164,7 +164,7 @@ test_subscription() return; } result = saEvtDispatch(handle, SA_DISPATCH_ONE); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("saEvtDispatch %s\n", result_buf); goto sub_fin; @@ -176,17 +176,17 @@ test_subscription() sub_fin: #if 0 result = saEvtEventUnsubscribe(channel_handle, subscription_id); - if (result != SA_OK) + if (result != SA_AIS_OK) printf("Channel unsubscribe result: %d\n", result); #endif chan_fin: result = saEvtChannelClose(channel_handle); - if (result != SA_OK) + if (result != SA_AIS_OK) get_sa_error(result, result_buf, result_buf_len); printf("Channel close result: %s\n", result_buf); init_fin: result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("Finalize result: %s\n", result_buf); } @@ -203,12 +203,22 @@ char *ais_time_str(SaTimeT time) return time_buf; } +#define dprintf(format, ...) \ + { \ + if (did_dot) { \ + printf("\n"); \ + } \ + printf(format, ## __VA_ARGS__); \ + did_dot = 0; \ + } + void event_callback( SaEvtSubscriptionIdT subscription_id, const SaEvtEventHandleT event_handle, const SaSizeT event_data_size) { - SaErrorT result; + static int did_dot = 0; + SaAisErrorT result; SaUint8T priority; SaTimeT retention_time; SaNameT publisher_name = {0, {0}}; @@ -221,13 +231,13 @@ event_callback( SaEvtSubscriptionIdT subscription_id, #endif if (!quiet) - printf("event_callback called\n"); + dprintf("event_callback called\n"); if (!quiet) - printf("sub ID: %x\n", subscription_id); + dprintf("sub ID: %x\n", subscription_id); if (!quiet) - printf("event_handle %x\n", event_handle); + dprintf("event_handle %llx\n", event_handle); if (!quiet) - printf("event data size %d\n", event_data_size); + dprintf("event data size %d\n", event_data_size); evt_pat_get_array.patterns[0].patternSize = PAT_SIZE; evt_pat_get_array.patterns[1].patternSize = PAT_SIZE; @@ -242,35 +252,38 @@ event_callback( SaEvtSubscriptionIdT subscription_id, &publish_time, /* publish time */ &event_id /* event_id */ ); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); - printf("event get attr result(2): %s\n", result_buf); + dprintf("event get attr result(2): %s\n", result_buf); goto evt_free; } if (!quiet) { - printf("pattern array count: %d\n", + dprintf("pattern array count: %d\n", evt_pat_get_array.patternsNumber); for (i = 0; i < evt_pat_get_array.patternsNumber; i++) { - printf( "pattern %d =\"%s\"\n", i, + dprintf( "pattern %d =\"%s\"\n", i, evt_pat_get_array.patterns[i].pattern); } - printf("priority: 0x%x\n", priority); - printf("retention: 0x%llx\n", retention_time); - printf("publisher name content: \"%s\"\n", + dprintf("priority: 0x%x\n", priority); + dprintf("retention: 0x%llx\n", retention_time); + dprintf("publisher name content: \"%s\"\n", publisher_name.value); } if (evt_pat_get_array.patternsNumber > 0) { if (strcmp(evt_pat_get_array.patterns[0].pattern, SA_EVT_LOST_EVENT) == 0) { - printf("*** Events have been dropped at %s", + dprintf("*** Events have been dropped at %s", ais_time_str(publish_time)); } } if (quiet < 2) { - printf("event id: 0x%016llx\n", event_id); + dprintf("event id: 0x%016llx\n", event_id); } if (quiet == 2) { - if ((++evt_count % EVT_FREQ) == 0) fprintf(stderr, "."); + if ((++evt_count % EVT_FREQ) == 0) { + fprintf(stderr, "."); + did_dot = 1; + } } #ifdef TEST_EVENT_ORDER @@ -282,7 +295,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id, if ((last_event_id[idx] >> 32) == (event_id >> 32)) { last_event_id[idx]++; if (last_event_id[idx] != event_id) { - printf("*** expected %016llx got %016llx event_id\n", + dprintf("*** expected %016llx got %016llx event_id\n", last_event_id[idx], event_id); last_event_id[idx] = event_id; @@ -292,13 +305,13 @@ event_callback( SaEvtSubscriptionIdT subscription_id, } } if (idx == MAX_NODES) { - printf("*** Too many nodes in cluster\n"); + dprintf("*** Too many nodes in cluster\n"); exit(1); } #endif if (event_data_size != user_data_size) { - printf("unexpected data size: e=%d, a=%d\n", + dprintf("unexpected data size: e=%d, a=%d\n", user_data_size, event_data_size); goto evt_free; } @@ -306,23 +319,23 @@ event_callback( SaEvtSubscriptionIdT subscription_id, received_size = user_data_size; result = saEvtEventDataGet(event_handle, event_data, &received_size); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); - printf("event get data result: %s\n", result_buf); + dprintf("event get data result: %s\n", result_buf); goto evt_free; } if (received_size != event_data_size) { - printf("event data mismatch e=%d, a=%d\n", + dprintf("event data mismatch e=%d, a=%d\n", event_data_size, received_size); goto evt_free; } if (memcmp(user_data, event_data, user_data_size) != 0 ) { - printf("event data doesn't match specified file data\n"); + dprintf("event data doesn't match specified file data\n"); goto evt_free; } if (!quiet) { - printf("Received %d bytes of data OK\n", + dprintf("Received %d bytes of data OK\n", user_data_size); } @@ -330,7 +343,7 @@ evt_free: result = saEvtEventFree(event_handle); if (!quiet) { get_sa_error(result, result_buf, result_buf_len); - printf("event free result: %s\n", result_buf); + dprintf("event free result: %s\n", result_buf); } } diff --git a/test/testevt.c b/test/testevt.c index 3ed549ea..e93ff7b7 100644 --- a/test/testevt.c +++ b/test/testevt.c @@ -60,14 +60,14 @@ #include #include #include "ais_types.h" -#include "ais_evt.h" +#include "saEvt.h" -extern int get_sa_error(SaErrorT, char *, int); +extern int get_sa_error(SaAisErrorT, char *, int); char result_buf[256]; int result_buf_len = sizeof(result_buf); -void testresult (SaErrorT result, SaErrorT expected, int test_no) +void testresult (SaAisErrorT result, SaAisErrorT expected, int test_no) { if (result == expected) { printf ("Test %d passed\n", test_no); @@ -78,27 +78,27 @@ void testresult (SaErrorT result, SaErrorT expected, int test_no) } } -SaVersionT version1 = { 'A', 0x01, 0x01 }; -SaVersionT version2 = { 'a', 0x01, 0x01 }; -SaVersionT version3 = { 'b', 0x01, 0x01 }; -SaVersionT version4 = { 'a', 0x02, 0x01 }; -SaVersionT version5 = { 'a', 0xff, 0x01 }; -SaVersionT version6 = { 'a', 0x01, 0xff }; -SaVersionT version7 = { 'A', 0xff, 0xff }; -SaVersionT version8 = { 'B', 0xff, 0xff }; +SaVersionT version1 = { 'B', 0x01, 0x01 }; +SaVersionT version2 = { 'b', 0x01, 0x01 }; +SaVersionT version3 = { 'c', 0x01, 0x01 }; +SaVersionT version4 = { 'b', 0x02, 0x01 }; +SaVersionT version5 = { 'b', 0xff, 0x01 }; +SaVersionT version6 = { 'b', 0x01, 0xff }; +SaVersionT version7 = { 'B', 0xff, 0xff }; +SaVersionT version8 = { 'C', 0xff, 0xff }; struct version_test { SaVersionT *version; - SaErrorT result; + SaAisErrorT result; }; struct version_test versions[] = { - { &version1, SA_OK }, - { &version2, SA_OK }, - { &version3, SA_ERR_VERSION }, - { &version4, SA_ERR_VERSION}, - { &version8, SA_ERR_VERSION}, - { 0, SA_ERR_VERSION} + { &version1, SA_AIS_OK }, + { &version2, SA_AIS_OK }, + { &version3, SA_AIS_ERR_VERSION }, + { &version4, SA_AIS_ERR_VERSION}, + { &version8, SA_AIS_ERR_VERSION}, + { 0, SA_AIS_ERR_VERSION} }; int version_size = sizeof(versions) / sizeof(struct version_test); @@ -141,7 +141,7 @@ void test_initialize (void) { for (i=0; i < version_size; i++) { result = saEvtInitialize (&handle, 0, versions[i].version); testresult (result, versions[i].result, i); - if (result == SA_OK) { + if (result == SA_AIS_OK) { saEvtFinalize(handle); } } @@ -208,7 +208,7 @@ test_channel() printf(" Channel open:\n"); result = saEvtInitialize (&handle, &callbacks, versions[0].version); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Event Initialize result: %s\n", result_buf); return; @@ -218,11 +218,11 @@ test_channel() &channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: channel open result: %s\n", result_buf); result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Event Finalize result: %s\n", result_buf); } @@ -232,7 +232,7 @@ test_channel() printf(" Channel close:\n"); result = saEvtChannelClose(channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: channel close result: %s\n", result_buf); return; @@ -240,7 +240,7 @@ test_channel() result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Event Finalize result: %s\n", result_buf); return; @@ -251,18 +251,18 @@ test_channel() */ printf(" Channel subscribe:\n"); result = saEvtInitialize (&handle, &callbacks, versions[0].version); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Event Initialize result: %s\n", result_buf); return; } result = saEvtChannelOpen(handle, &channel_name, flags, 0, &channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: channel open result: %s\n", result_buf); result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Finalize result: %s\n", result_buf); } @@ -273,16 +273,16 @@ test_channel() &subscribe_filters, subscription_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event subscribe result: %s\n", result_buf); result = saEvtChannelClose(channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Channel close result: %s\n", result_buf); } result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Finalize result: %s\n", result_buf); } @@ -293,28 +293,28 @@ test_channel() printf(" Channel unsubscribe:\n"); result = saEvtEventUnsubscribe(channel_handle, subscription_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event unsubscribe result: %s\n", result_buf); result = saEvtChannelClose(channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Channel close result: %s\n", result_buf); } result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Finalize result: %s\n", result_buf); } return; } result = saEvtChannelClose(channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Channel close result: %s\n", result_buf); } result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Finalize result: %s\n", result_buf); } @@ -324,14 +324,14 @@ test_channel() */ printf(" Channel subscribe with no close at end:\n"); result = saEvtInitialize (&handle, &callbacks, versions[0].version); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Event Initialize result: %s\n", result_buf); return; } result = saEvtChannelOpen(handle, &channel_name, flags, 0, &channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: channel open result: %s\n", result_buf); result = saEvtFinalize(handle); @@ -342,14 +342,14 @@ test_channel() &subscribe_filters, subscription_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event subscribe result: %s\n", result_buf); result = saEvtChannelClose(channel_handle); } result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Finalize failed\n"); return; @@ -360,18 +360,18 @@ test_channel() */ printf(" Multiple subscriptions\n"); result = saEvtInitialize (&handle, &callbacks, versions[0].version); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Event Initialize result: %s\n", result_buf); return; } result = saEvtChannelOpen(handle, &channel_name, flags, 0, &channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: channel open result: %s\n", result_buf); result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Finalize result: %s\n", result_buf); } @@ -382,16 +382,16 @@ test_channel() &subscribe_filters, subscription_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: First event subscribe result: %s\n", result_buf); result = saEvtChannelClose(channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Channel close result: %s\n", result_buf); } result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Finalize result: %s\n", result_buf); } @@ -402,16 +402,16 @@ test_channel() &subscribe_filters, subscription_id+1); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: second event subscribe result: %s\n", result_buf); result = saEvtChannelClose(channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Channel close result: %s\n", result_buf); } result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Finalize result: %s\n", result_buf); } @@ -427,7 +427,7 @@ test_channel() &subscribe_filters, subscription_id); - if (result != SA_ERR_EXIST) { + if (result != SA_AIS_ERR_EXIST) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: First event subscribe result: %s\n", result_buf); result = saEvtChannelClose(channel_handle); @@ -441,16 +441,16 @@ test_channel() printf(" Unsubscribe non-existent sub_id\n"); result = saEvtEventUnsubscribe(channel_handle, subscription_id+2); - if (result != SA_ERR_INVALID_PARAM) { + if (result != SA_AIS_ERR_INVALID_PARAM) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event unsubscribe result: %s\n", result_buf); result = saEvtChannelClose(channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Channel close result: %s\n", result_buf); } result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Finalize result: %s\n", result_buf); } @@ -458,22 +458,22 @@ test_channel() } result = saEvtEventUnsubscribe(channel_handle, subscription_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: first event unsubscribe result: %s\n", result_buf); } result = saEvtEventUnsubscribe(channel_handle, subscription_id+1); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: second event unsubscribe result: %s\n", result_buf); } result = saEvtChannelClose(channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Channel close result: %s\n", result_buf); } result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Finalize result: %s\n", result_buf); } @@ -539,7 +539,7 @@ event_callback(SaEvtSubscriptionIdT my_subscription_id, const SaEvtEventHandleT event_handle, const SaSizeT my_event_data_size) { - SaErrorT result; + SaAisErrorT result; SaUint8T my_priority; SaTimeT my_retention_time; SaNameT my_publisher_name = {0, {0}}; @@ -551,7 +551,7 @@ event_callback(SaEvtSubscriptionIdT my_subscription_id, printf(" event_callback called\n"); if (my_subscription_id != subscription_id) { - printf("ERROR: sub ID: e=%lx, a=%lx\n", + printf("ERROR: sub ID: e=%x, a=%x\n", subscription_id, my_subscription_id); } if (my_event_data_size != event_data_size) { @@ -569,7 +569,7 @@ event_callback(SaEvtSubscriptionIdT my_subscription_id, &my_publish_time, /* publish time */ &my_event_id /* event_id */ ); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event get attr result(2): %s\n", result_buf); goto evt_free; @@ -633,7 +633,7 @@ event_callback(SaEvtSubscriptionIdT my_subscription_id, memset(act_data, 0, my_event_data_size); data_size = my_event_data_size; result = saEvtEventDataGet(event_handle, act_data, &data_size); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event data get result: %s\n", result_buf); goto dat_free; @@ -654,7 +654,7 @@ dat_free: free(act_data); evt_free: result = saEvtEventFree(event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event free result: %s\n", result_buf); } @@ -688,14 +688,14 @@ test_event() printf("Test Event operations:\n"); result = saEvtInitialize (&handle, &callbacks, versions[0].version); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Event Initialize result: %s\n", result_buf); return; } result = saEvtChannelOpen(handle, &channel_name, flags, 0, &channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: channel open result: %s\n", result_buf); goto evt_fin; @@ -706,7 +706,7 @@ test_event() */ printf(" Event allocation\n"); result = saEvtEventAllocate(channel_handle, &event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event Allocate result: %s\n", result_buf); goto evt_close; @@ -721,7 +721,7 @@ test_event() 0, /* publish time */ 0 /* event_id */ ); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event get attr result(1): %s\n", result_buf); goto evt_free; @@ -741,7 +741,7 @@ test_event() &publish_time, /* publish time */ &event_id /* event_id */ ); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event get attr result(2): %s\n", result_buf); goto evt_free; @@ -773,7 +773,7 @@ test_event() TEST_PRIORITY, test_ret_time, &test_pub_name); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event set attr result(1): %s\n", result_buf); goto evt_free; @@ -788,7 +788,7 @@ test_event() &publish_time, /* publish time */ &event_id /* event_id */ ); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event get attr result(2): %s\n", result_buf); goto evt_free; @@ -851,41 +851,41 @@ test_event() */ printf(" Get event data(1)\n"); result = saEvtEventDataGet(event_handle, 0, 0); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Get event data(1) result: %s\n", result_buf); } printf(" Get event data(2)\n"); result = saEvtEventDataGet(event_handle, event_data, 0); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Get event data(2) result: %s\n", result_buf); } printf(" Get event data(3)\n"); event_data_size = EVENT_DATA_SIZE; result = saEvtEventDataGet(event_handle, 0, &event_data_size); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Get event data(3) result: %s\n", result_buf); } printf(" Get event data(4)\n"); event_data_size = EVENT_DATA_SIZE; result = saEvtEventDataGet(event_handle, event_data, &event_data_size); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Get event data(4) result: %s\n", result_buf); } printf(" Get event data(5)\n"); event_data_size = 1; result = saEvtEventDataGet(event_handle, event_data, &event_data_size); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Get event data(5) result: %s\n", result_buf); } printf(" Free event(1)\n"); result = saEvtEventFree(event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event free result: %s\n", result_buf); } @@ -897,14 +897,14 @@ test_event() printf(" Publish with no patterns set\n"); result = saEvtEventAllocate(channel_handle, &event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event Allocate result: %s\n", result_buf); goto evt_close; } result = saEvtEventPublish(event_handle, 0, 0, &event_id); - if (result != SA_ERR_INVALID_PARAM) { + if (result != SA_AIS_ERR_INVALID_PARAM) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event Publish result(1): %s\n", result_buf); goto evt_close; @@ -919,16 +919,16 @@ test_event() &subscribe_filters, subscription_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event subscribe result: %s\n", result_buf); result = saEvtChannelClose(channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Channel close result: %s\n", result_buf); } result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Finalize result: %s\n", result_buf); } @@ -941,7 +941,7 @@ test_event() TEST_PRIORITY, retention_time, &test_pub_name); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event set attr result(2): %s\n", result_buf); goto evt_free; @@ -961,7 +961,7 @@ test_event() */ result = saEvtEventPublish(event_handle, exp_data, DATA_SIZE, &event_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event Publish result(2): %s\n", result_buf); goto evt_close; @@ -971,7 +971,7 @@ test_event() * See if we got the event */ result = saEvtSelectionObjectGet(handle, &fd); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: saEvtSelectionObject get %s\n", result_buf); /* error */ @@ -990,7 +990,7 @@ test_event() } result = saEvtDispatch(handle, SA_DISPATCH_ONE); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: saEvtDispatch %s\n", result_buf); /* error */ @@ -1004,7 +1004,7 @@ test_event() */ evt_free: result = saEvtEventFree(event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event free result: %s\n", result_buf); } @@ -1012,14 +1012,14 @@ evt_free: evt_close: result = saEvtChannelClose(channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: channel close result: %s\n", result_buf); } evt_fin: result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Event Finalize result: %s\n", result_buf); } @@ -1044,7 +1044,7 @@ multi_test_callback1(SaEvtSubscriptionIdT my_subscription_id, const SaEvtEventHandleT event_handle, const SaSizeT my_event_data_size) { - SaErrorT result; + SaAisErrorT result; SaUint8T my_priority; SaTimeT my_retention_time; SaNameT my_publisher_name = {0, {0}}; @@ -1063,7 +1063,7 @@ multi_test_callback1(SaEvtSubscriptionIdT my_subscription_id, &my_publish_time, /* publish time */ &my_event_id /* event_id */ ); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event get attr result: %s\n", result_buf); goto evt_free; @@ -1094,7 +1094,7 @@ multi_test_callback1(SaEvtSubscriptionIdT my_subscription_id, evt_free: result = saEvtEventFree(event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event free result: %s\n", result_buf); } @@ -1158,14 +1158,14 @@ test_multi_channel1() printf("Test multiple operations:\n"); result = saEvtInitialize (&handle, &multi_callbacks, versions[0].version); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Event Initialize result: %s\n", result_buf); return; } result = saEvtChannelOpen(handle, &channel_name, flags, 0, &channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: channel open result: %s\n", result_buf); goto evt_fin; @@ -1175,7 +1175,7 @@ test_multi_channel1() * Allocate an event */ result = saEvtEventAllocate(channel_handle, &event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event Allocate result: %s\n", result_buf); goto evt_close; @@ -1196,7 +1196,7 @@ test_multi_channel1() result = saEvtEventSubscribe(channel_handle, &sub_filt, sub1); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event subscribe(1) result: %s\n", result_buf); goto evt_free; @@ -1206,7 +1206,7 @@ test_multi_channel1() result = saEvtEventSubscribe(channel_handle, &sub_filt, sub2); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event subscribe(2) result: %s\n", result_buf); goto evt_free; @@ -1221,7 +1221,7 @@ test_multi_channel1() TEST_PRIORITY, retention_time, &test_pub_name); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event set attr result(1): %s\n", result_buf); goto evt_free; @@ -1229,7 +1229,7 @@ test_multi_channel1() result = saEvtEventPublish(event_handle, exp_data, DATA_SIZE, &event_id1); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event Publish result:(1) %s\n", result_buf); goto evt_close; @@ -1241,7 +1241,7 @@ test_multi_channel1() TEST_PRIORITY, retention_time, &test_pub_name); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event set attr result(2): %s\n", result_buf); goto evt_free; @@ -1249,7 +1249,7 @@ test_multi_channel1() result = saEvtEventPublish(event_handle, exp_data, DATA_SIZE, &event_id2); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event Publish result:(2) %s\n", result_buf); goto evt_close; @@ -1261,7 +1261,7 @@ test_multi_channel1() TEST_PRIORITY, retention_time, &test_pub_name); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event set attr result(3): %s\n", result_buf); goto evt_free; @@ -1269,7 +1269,7 @@ test_multi_channel1() result = saEvtEventPublish(event_handle, exp_data, DATA_SIZE, &event_id3); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event Publish result:(3) %s\n", result_buf); goto evt_close; @@ -1279,7 +1279,7 @@ test_multi_channel1() * See if we got the event */ result = saEvtSelectionObjectGet(handle, &fd); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: saEvtSelectionObject get %s\n", result_buf); /* error */ @@ -1299,7 +1299,7 @@ test_multi_channel1() result = saEvtDispatch(handle, SA_DISPATCH_ALL); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: saEvtDispatch %s\n", result_buf); /* error */ @@ -1318,7 +1318,7 @@ test_multi_channel1() */ evt_free: result = saEvtEventFree(event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event free result: %s\n", result_buf); } @@ -1326,14 +1326,14 @@ evt_free: evt_close: result = saEvtChannelClose(channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: channel close result: %s\n", result_buf); } evt_fin: result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Event Finalize result: %s\n", result_buf); } @@ -1352,7 +1352,7 @@ multi_test_callback2(SaEvtSubscriptionIdT my_subscription_id, const SaEvtEventHandleT event_handle, const SaSizeT my_event_data_size) { - SaErrorT result; + SaAisErrorT result; SaUint8T my_priority; SaTimeT my_retention_time; SaNameT my_publisher_name = {0, {0}}; @@ -1371,7 +1371,7 @@ multi_test_callback2(SaEvtSubscriptionIdT my_subscription_id, &my_publish_time, /* publish time */ &my_event_id /* event_id */ ); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event get attr result: %s\n", result_buf); goto evt_free; @@ -1408,7 +1408,7 @@ multi_test_callback2(SaEvtSubscriptionIdT my_subscription_id, evt_free: result = saEvtEventFree(event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event free result: %s\n", result_buf); } @@ -1467,7 +1467,7 @@ test_multi_channel2() printf("Test multiple opens/subscribes:\n"); result = saEvtInitialize (&handle, &multi_callbacks, versions[0].version); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Event Initialize result: %s\n", result_buf); return; @@ -1475,7 +1475,7 @@ test_multi_channel2() result = saEvtChannelOpen(handle, &channel_name, flags, 0, &channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: channel open(0) result: %s\n", result_buf); goto evt_fin; @@ -1483,14 +1483,14 @@ test_multi_channel2() result = saEvtChannelOpen(handle, &channel_name, flags, 0, &channel_handle1); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: channel open(1) result: %s\n", result_buf); goto evt_fin; } result = saEvtEventAllocate(channel_handle, &event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event Allocate result: %s\n", result_buf); goto evt_close; @@ -1499,7 +1499,7 @@ test_multi_channel2() result = saEvtEventSubscribe(channel_handle, &sub_filt, sub1); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event subscribe(0) result: %s\n", result_buf); goto evt_free; @@ -1508,7 +1508,7 @@ test_multi_channel2() result = saEvtEventSubscribe(channel_handle1, &sub_filt, sub2); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event subscribe(1) result: %s\n", result_buf); goto evt_free; @@ -1521,7 +1521,7 @@ test_multi_channel2() TEST_PRIORITY, retention_time, &test_pub_name); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event set attr result: %s\n", result_buf); goto evt_free; @@ -1529,7 +1529,7 @@ test_multi_channel2() result = saEvtEventPublish(event_handle, exp_data, DATA_SIZE, &event_id1); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event Publish result: %s\n", result_buf); goto evt_close; @@ -1538,7 +1538,7 @@ test_multi_channel2() * See if we got the event */ result = saEvtSelectionObjectGet(handle, &fd); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: saEvtSelectionObject get %s\n", result_buf); /* error */ @@ -1560,7 +1560,7 @@ test_multi_channel2() result = saEvtDispatch(handle, SA_DISPATCH_ALL); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: saEvtDispatch %s\n", result_buf); /* error */ @@ -1579,7 +1579,7 @@ test_multi_channel2() */ evt_free: result = saEvtEventFree(event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event free result: %s\n", result_buf); } @@ -1587,20 +1587,20 @@ evt_free: evt_close: result = saEvtChannelClose(channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: channel close result(0): %s\n", result_buf); } result = saEvtChannelClose(channel_handle1); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: channel close result(1): %s\n", result_buf); } evt_fin: result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Event Finalize result: %s\n", result_buf); } @@ -1619,7 +1619,7 @@ multi_test_callback3(SaEvtSubscriptionIdT my_subscription_id, const SaEvtEventHandleT event_handle, const SaSizeT my_event_data_size) { - SaErrorT result; + SaAisErrorT result; SaUint8T my_priority; SaTimeT my_retention_time; SaNameT my_publisher_name = {0, {0}}; @@ -1637,16 +1637,16 @@ multi_test_callback3(SaEvtSubscriptionIdT my_subscription_id, &my_publish_time, /* publish time */ &my_event_id /* event_id */ ); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event get attr result: %s\n", result_buf); goto evt_free; } if ((my_subscription_id != sub1) && (my_subscription_id != sub2)) { - printf("ERROR: Received wrong subscription ID %lx\n", + printf("ERROR: Received wrong subscription ID %x\n", my_subscription_id); - printf(" sub1 %lx, sub2 %lx\n", sub1, sub2); + printf(" sub1 %x, sub2 %x\n", sub1, sub2); goto evt_free; } @@ -1672,7 +1672,7 @@ multi_test_callback3(SaEvtSubscriptionIdT my_subscription_id, evt_free: result = saEvtEventFree(event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event free result: %s\n", result_buf); } @@ -1740,7 +1740,7 @@ test_multi_channel3() printf("Test multiple different channels/subscribes:\n"); result = saEvtInitialize (&handle, &multi_callbacks, versions[0].version); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Event Initialize result: %s\n", result_buf); return; @@ -1748,7 +1748,7 @@ test_multi_channel3() result = saEvtChannelOpen(handle, &channel_name, flags, 0, &channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: channel open(0) result: %s\n", result_buf); goto evt_fin; @@ -1756,20 +1756,20 @@ test_multi_channel3() result = saEvtChannelOpen(handle, &channel_name1, flags, 0, &channel_handle1); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: channel open(1) result: %s\n", result_buf); goto evt_fin; } result = saEvtEventAllocate(channel_handle, &event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event Allocate(0) result: %s\n", result_buf); goto evt_close; } result = saEvtEventAllocate(channel_handle1, &event_handle1); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event Allocate(1) result: %s\n", result_buf); goto evt_close; @@ -1779,7 +1779,7 @@ test_multi_channel3() result = saEvtEventSubscribe(channel_handle, &sub_filt, sub1); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event subscribe(0) result: %s\n", result_buf); goto evt_free; @@ -1788,7 +1788,7 @@ test_multi_channel3() result = saEvtEventSubscribe(channel_handle1, &sub_filt, sub2); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event subscribe(1) result: %s\n", result_buf); goto evt_free; @@ -1801,7 +1801,7 @@ test_multi_channel3() TEST_PRIORITY, retention_time, &test_pub_name); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event set attr(0) result: %s\n", result_buf); goto evt_free; @@ -1813,7 +1813,7 @@ test_multi_channel3() TEST_PRIORITY, retention_time, &test_pub_name); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event set attr(1) result: %s\n", result_buf); goto evt_free; @@ -1821,14 +1821,14 @@ test_multi_channel3() result = saEvtEventPublish(event_handle, exp_data, DATA_SIZE, &event_id1); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event Publish result: %s\n", result_buf); goto evt_close; } result = saEvtEventPublish(event_handle1, exp_data, DATA_SIZE, &event_id2); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event Publish result: %s\n", result_buf); goto evt_close; @@ -1837,7 +1837,7 @@ test_multi_channel3() * See if we got the events */ result = saEvtSelectionObjectGet(handle, &fd); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: saEvtSelectionObject get %s\n", result_buf); /* error */ @@ -1859,7 +1859,7 @@ test_multi_channel3() result = saEvtDispatch(handle, SA_DISPATCH_ALL); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: saEvtDispatch %s\n", result_buf); /* error */ @@ -1878,12 +1878,12 @@ test_multi_channel3() */ evt_free: result = saEvtEventFree(event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event free result: %s\n", result_buf); } result = saEvtEventFree(event_handle1); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event free result: %s\n", result_buf); } @@ -1891,20 +1891,20 @@ evt_free: evt_close: result = saEvtChannelClose(channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: channel close result(0): %s\n", result_buf); } result = saEvtChannelClose(channel_handle1); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: channel close result(1): %s\n", result_buf); } evt_fin: result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Event Finalize result: %s\n", result_buf); } @@ -1937,7 +1937,7 @@ event_callback_retained(SaEvtSubscriptionIdT my_subscription_id, const SaEvtEventHandleT event_handle, const SaSizeT my_event_data_size) { - SaErrorT result; + SaAisErrorT result; //printf("event_callback_retained called\n"); result = saEvtEventAttributesGet(event_handle, 0, /* patterns */ @@ -1947,7 +1947,7 @@ event_callback_retained(SaEvtSubscriptionIdT my_subscription_id, 0, /* publish time */ &retained_id /* event_id */ ); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: callback attr get result: %s\n", result_buf); return; @@ -1972,7 +1972,7 @@ test_retention() int nfd; int fd; int timeout = (EXPIRE_TIME + 5); - SaErrorT result; + SaAisErrorT result; flags = SA_EVT_CHANNEL_PUBLISHER | SA_EVT_CHANNEL_SUBSCRIBER | @@ -1984,14 +1984,14 @@ test_retention() result = saEvtInitialize (&handle, &callbacks_retain, versions[0].version); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Event Initialize result: %s\n", result_buf); return; } result = saEvtSelectionObjectGet(handle, &fd); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: saEvtSelectionObject get %s\n", result_buf); /* error */ @@ -2000,7 +2000,7 @@ test_retention() result = saEvtChannelOpen(handle, &channel_name, flags, 0, &channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: channel open result: %s\n", result_buf); goto evt_fin; @@ -2010,7 +2010,7 @@ test_retention() * Allocate an event */ result = saEvtEventAllocate(channel_handle, &event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event Allocate result: %s\n", result_buf); goto evt_close; @@ -2023,7 +2023,7 @@ test_retention() TEST_PRIORITY, retention_time, &test_pub_name); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event set attr result: %s\n", result_buf); goto evt_free; @@ -2037,7 +2037,7 @@ test_retention() got_event=0; retained_id=0; result = saEvtEventPublish(event_handle, exp_data, 0, &event_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event Publish result(1): %s\n", result_buf); goto evt_close; @@ -2048,7 +2048,7 @@ test_retention() &subscribe_filters, subscription_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event subscribe result: %s\n", result_buf); goto evt_free; @@ -2067,7 +2067,7 @@ test_retention() } result = saEvtDispatch(handle, SA_DISPATCH_ONE); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: saEvtDispatch %s\n", result_buf); /* error */ @@ -2085,7 +2085,7 @@ test_retention() } result = saEvtEventUnsubscribe(channel_handle, subscription_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: unsubscribe result: %s\n", result_buf); goto evt_free; @@ -2099,14 +2099,14 @@ test_retention() got_event=0; retained_id=0; result = saEvtEventPublish(event_handle, exp_data, 0, &event_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event Publish result(1): %s\n", result_buf); goto evt_close; } result = saEvtSelectionObjectGet(handle, &fd); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: saEvtSelectionObject get %s\n", result_buf); /* error */ @@ -2123,7 +2123,7 @@ test_retention() &subscribe_filters, subscription_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event subscribe result: %s\n", result_buf); result = saEvtChannelClose(channel_handle); @@ -2143,7 +2143,7 @@ test_retention() } result = saEvtEventUnsubscribe(channel_handle, subscription_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: unsubscribe result: %s\n", result_buf); goto evt_free; @@ -2162,7 +2162,7 @@ test_retention() got_event=0; retained_id=0; result = saEvtEventPublish(event_handle, exp_data, 0, &event_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event Publish result(2): %s\n", result_buf); goto evt_free; @@ -2171,7 +2171,7 @@ test_retention() result = saEvtEventSubscribe(channel_handle, &subscribe_filters, subscription_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event subscribe result: %s\n", result_buf); goto evt_free; @@ -2190,7 +2190,7 @@ test_retention() } result = saEvtDispatch(handle, SA_DISPATCH_ONE); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: saEvtDispatch %s\n", result_buf); /* error */ @@ -2208,14 +2208,14 @@ test_retention() } result = saEvtEventUnsubscribe(channel_handle, subscription_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: unsubscribe result: %s\n", result_buf); goto evt_free; } result = saEvtEventRetentionTimeClear(channel_handle, event_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: clear retention time result: %s\n", result_buf); goto evt_free; @@ -2224,7 +2224,7 @@ test_retention() result = saEvtEventSubscribe(channel_handle, &subscribe_filters, subscription_id); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event subscribe result: %s\n", result_buf); goto evt_free; @@ -2247,7 +2247,7 @@ test_retention() */ evt_free: result = saEvtEventFree(event_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: event free result: %s\n", result_buf); } @@ -2255,14 +2255,14 @@ evt_free: evt_close: result = saEvtChannelClose(channel_handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: channel close result: %s\n", result_buf); } evt_fin: result = saEvtFinalize(handle); - if (result != SA_OK) { + if (result != SA_AIS_OK) { get_sa_error(result, result_buf, result_buf_len); printf("ERROR: Event Finalize result: %s\n", result_buf); }