OpenMAMA
status.h
Go to the documentation of this file.
1 /* $Id$
2  *
3  * OpenMAMA: The open middleware agnostic messaging API
4  * Copyright (C) 2011 NYSE Technologies, Inc.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301 USA
20  */
21 
22 #ifndef MamaStatusH__
23 #define MamaStatusH__
24 
25 #define MAMA_STATUS_BASE 9000
26 #define MAMA_STATUS_MAX 1000
27 
28 #ifdef WITH_ENTITLEMENTS
29 #include <OeaStatus.h>
30 #endif
31 
32 
33 #if defined(__cplusplus)
34 extern "C" {
35 #endif
36 
37 typedef enum
38 {
39  /* Status OK */
41  /* Out of memory */
43  /* Messaging platform specific error */
45  /* General system error */
47  /* Invalid argument */
49  /* Null argument */
51  /* Not found */
53  /* Timer failure */
55  /* IP address not found */
57  /* Timeout e.g. when subscribing to a symbol */
59  /* Not entitled to the symbol being subscribed to */
61  /* Property too long */
63  /* MD Not opened */
65  /* Publish/subscribe not opened */
67  /* Entitlements not enabled */
69  /* Bad transport type */
71  /* Using unsupported I/O type */
73  /* Too many dispatchers */
75  /* Not implemented */
77  /* Wrong field type */
79  /* Invalid symbol */
81  /* I/O error */
83  /* Not installed */
85  /* Conflation error */
87  /* Event dispatch queue full */
89  /* End of event queue reached */
91  /* No bridge */
93  /* Invalid queue */
95  /* Not modifiable */
97  /* Message Type DELETE */
99  /* Not permissioned for the subject */
101  /* Subscription is in an invalid state. */
103  /* Queue has open objects. */
105  /* The function isn't supported for this type of subscription. */
107  /* The underlying transport saw a gap. */
109 
110  /* A resource has not been initialised. */
112 
113  /* The transport line is reported to be down. */
115 
116  /* The symbol has expired. */
118 
119  /* The application's bandwidth limit has been exceeded. */
121 
122 #ifdef WITH_ENTITLEMENTS
123  /* Out of memory */
124  ,MAMA_ENTITLE_STATUS_NOMEM = MAMA_STATUS_BASE + OEA_STATUS_NOMEM, /* 9001 */
125  /* Invalid parameter */
126  MAMA_ENTITLE_STATUS_BAD_PARAM = MAMA_STATUS_BASE + OEA_STATUS_BAD_PARAM, /* 9002 */
127  /* The XML returned from entitlement server was invalid */
128  MAMA_ENTITLE_STATUS_BAD_DATA = MAMA_STATUS_BASE + OEA_STATUS_BAD_DATA, /* 9003 */
129  /* Invalid URL */
130  MAMA_ENTITLE_STATUS_URL_ERROR = MAMA_STATUS_BASE + OEA_STATUS_HTTP_URL_ERROR, /* 9004 */
131  /* Unable to determine OS ID of account process is running under.*/
132  MAMA_ENTITLE_STATUS_OS_LOGIN_ID_UNAVAILABLE = MAMA_STATUS_BASE + OEA_STATUS_OS_LOGIN_ID_UNAVAILABLE, /* 9005 */
133  /* When an attempt is made to get entitlements after a successful attempt
134  * has already been made */
135  MAMA_ENTITLE_STATUS_ALREADY_ENTITLED = MAMA_STATUS_BASE + OEA_STATUS_ALREADY_ENTITLED, /* 9006 */
136  /* A user has exceeded concurrent access limit */
137  MAMA_ENTITLE_STATUS_CAC_LIMIT_EXCEEDED = MAMA_STATUS_BASE + OEA_STATUS_CAC_LIMIT_EXCEEDED, /* 9007 */
138  /* Failed to create OEP listener that processes inbound messages from
139  * site server. Required for concurrent access control and/or
140  * dynamic entitlements update. */
141  MAMA_ENTITLE_STATUS_OEP_LISTENER_CREATION_FAILURE = MAMA_STATUS_BASE + OEA_STATUS_OEP_LISTENER_CREATION_FAILURE, /* 9008 */
142  /* No such host */
143  MAMA_ENTITLE_HTTP_ERRHOST = MAMA_STATUS_BASE + OEA_HTTP_ERRHOST, /* 9010 */
144  /* Can't create socket */
145  MAMA_ENTITLE_HTTP_ERRSOCK = MAMA_STATUS_BASE + OEA_HTTP_ERRSOCK, /* 9011 */
146  /* Can't connect to host */
147  MAMA_ENTITLE_HTTP_ERRCONN = MAMA_STATUS_BASE + OEA_HTTP_ERRCONN, /* 9012 */
148  /* Write error on socket while writing header */
149  MAMA_ENTITLE_HTTP_ERRWRHD = MAMA_STATUS_BASE + OEA_HTTP_ERRWRHD, /* 9013 */
150  /* Write error on socket while writing data */
151  MAMA_ENTITLE_HTTP_ERRWRDT = MAMA_STATUS_BASE + OEA_HTTP_ERRWRDT, /* 9014 */
152  /* Read error on socket while reading result */
153  MAMA_ENTITLE_HTTP_ERRRDHD = MAMA_STATUS_BASE + OEA_HTTP_ERRRDHD, /* 9015 */
154  /* Invalid answer from data server */
155  MAMA_ENTITLE_HTTP_ERRPAHD = MAMA_STATUS_BASE + OEA_HTTP_ERRPAHD, /* 9016 */
156  /* Null data pointer */
157  MAMA_ENTITLE_HTTP_ERRNULL = MAMA_STATUS_BASE + OEA_HTTP_ERRNULL, /* 9017 */
158  /* No/Bad length in header */
159  MAMA_ENTITLE_HTTP_ERRNOLG = MAMA_STATUS_BASE + OEA_HTTP_ERRNOLG, /* 9018 */
160  /* Can't allocate memory */
161  MAMA_ENTITLE_HTTP_ERRMEM = MAMA_STATUS_BASE + OEA_HTTP_ERRMEM, /* 9019 */
162  /* Read error while reading data */
163  MAMA_ENTITLE_HTTP_ERRRDDT = MAMA_STATUS_BASE + OEA_HTTP_ERRRDDT, /* 9020 */
164  /* Invalid url - must start with 'http://' */
165  MAMA_ENTITLE_HTTP_ERRURLH = MAMA_STATUS_BASE + OEA_HTTP_ERRURLH, /* 9021 */
166  /* Invalid port in url */
167  MAMA_ENTITLE_HTTP_ERRURLP = MAMA_STATUS_BASE + OEA_HTTP_ERRURLP, /* 9022 */
168  /* Invalid QUERY HTTP RESULT 400 */
169  MAMA_ENTITLE_HTTP_BAD_QUERY = MAMA_STATUS_BASE + OEA_HTTP_BAD_QUERY, /* 9023 */
170  /* FORBIDDEN HTTP RESULT 403 */
171  MAMA_ENTITLE_HTTP_FORBIDDEN = MAMA_STATUS_BASE + OEA_HTTP_FORBIDDEN, /* 9024 */
172  /* Request Timeout HTTP RESULT 403 */
173  MAMA_ENTITLE_HTTP_TIMEOUT = MAMA_STATUS_BASE + OEA_HTTP_TIMEOUT, /* 9025 */
174  /* Server Error HTTP RESULT 500 */
175  MAMA_ENTITLE_HTTP_SERVER_ERR = MAMA_STATUS_BASE + OEA_HTTP_SERVER_ERR, /* 9026 */
176  /* Not Implemented HTTP RESULT 501 */
177  MAMA_ENTITLE_HTTP_NO_IMPL = MAMA_STATUS_BASE + OEA_HTTP_NO_IMPL, /* 9027 */
178  /* Overloaded HTTP RESULT 503 */
179  MAMA_ENTITLE_HTTP_OVERLOAD = MAMA_STATUS_BASE + OEA_HTTP_OVERLOAD, /* 9028 */
180  /* No servers specified */
181  MAMA_ENTITLE_NO_USER = MAMA_ENTITLE_HTTP_OVERLOAD + 1, /* 9029 */
182  MAMA_ENTITLE_NO_SERVERS_SPECIFIED = MAMA_ENTITLE_NO_USER + 1, /* 9030 */
183  MAMA_ENTITLE_SITE_NOT_FOUND = MAMA_STATUS_BASE + OEA_STATUS_SITE_NOT_FOUND /* 9032 */
184 #endif
185 } mama_status;
186 
187 MAMAExpDLL
188 extern const char*
189 mamaStatus_stringForStatus (mama_status status);
190 
191 #if defined(NDEBUG) && !defined(WITH_UNITTESTS)
192 
193 #define NULLARG_STATUS_CHECK
194 #define NULLARG_STATUS_CHECK_STR
195 
196 #else
197 
198 #define NULLARG_STATUS_CHECK(x) \
199  do { \
200  if (!(x)) return MAMA_STATUS_NULL_ARG; \
201  } while(0);
202 
203 #define NULLARG_STATUS_CHECK_STR(x) \
204  do { \
205  if (!(x) || (strlen((x))==0) ) return MAMA_STATUS_NULL_ARG; \
206  } while(0);
207 
208 #endif
209 
210 #define NOMEM_STATUS_CHECK(x) \
211  do { \
212  if ((x==NULL)) \
213  { \
214  mama_log (MAMA_LOG_LEVEL_SEVERE, "Could not allocate memory"); \
215  return MAMA_STATUS_NOMEM; \
216  } \
217  } while(0);
218 
219 #if defined(__cplusplus)
220 } /*extern "C" { */
221 #endif
222 #endif /* MamaStatusH__*/
223 
Definition: status.h:66
Definition: status.h:60
Definition: status.h:64
Definition: status.h:62
Definition: status.h:78
Definition: status.h:56
Definition: status.h:90
Definition: status.h:48
Definition: status.h:50
Definition: status.h:82
Definition: status.h:42
Definition: status.h:52
Definition: status.h:86
#define MAMA_STATUS_BASE
Definition: status.h:25
Definition: status.h:44
Definition: status.h:94
MAMAExpDLL const char * mamaStatus_stringForStatus(mama_status status)
Definition: status.h:40
Definition: status.h:92
Definition: status.h:96
Definition: status.h:104
Definition: status.h:54
Definition: status.h:74
Definition: status.h:58
Definition: status.h:72
Definition: status.h:80
Definition: status.h:70
Definition: status.h:76
Definition: status.h:46
Definition: status.h:114
Definition: status.h:84
Definition: status.h:108
mama_status
Definition: status.h:37
Definition: status.h:111
Definition: status.h:98
Definition: status.h:117
Definition: status.h:88
Definition: status.h:120
Definition: status.h:100


© 2012 Linux Foundation