Patch to add new api to logsys to get priority names from subsystem names.
[openais.git] / include / saAis.h
blob85afe922f76b3298cf6afcf2fa01d6e625c4f93a
1 /*
2 * Copyright (c) 2002-2003 MontaVista Software, Inc.
3 * Copyright (c) 2006 Sun Microsystems, Inc.
5 * All rights reserved.
7 * Author: Steven Dake (sdake@mvista.com)
9 * This software licensed under BSD license, the text of which follows:
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions are met:
14 * - Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
16 * - Redistributions in binary form must reproduce the above copyright notice,
17 * this list of conditions and the following disclaimer in the documentation
18 * and/or other materials provided with the distribution.
19 * - Neither the name of the MontaVista Software, Inc. nor the names of its
20 * contributors may be used to endorse or promote products derived from this
21 * software without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
33 * THE POSSIBILITY OF SUCH DAMAGE.
36 #ifndef AIS_TYPES_H_DEFINED
37 #define AIS_TYPES_H_DEFINED
39 /**
40 * @defgroup saf Service Availability Forum Application Interface Specification
43 typedef enum {
44 SA_FALSE = 0,
45 SA_TRUE = 1
46 } SaBoolT;
48 #ifndef OPENAIS_SOLARIS
49 #include <stdint.h>
50 #else
51 #include <sys/types.h>
52 #endif
54 typedef int8_t SaInt8T;
55 typedef int16_t SaInt16T;
56 typedef int32_t SaInt32T;
57 typedef int64_t SaInt64T;
59 typedef uint8_t SaUint8T;
60 typedef uint16_t SaUint16T;
61 typedef uint32_t SaUint32T;
62 typedef uint64_t SaUint64T;
64 typedef float SaFloatT;
65 typedef double SaDoubleT;
66 typedef char * SaStringT;
67 typedef SaInt64T SaTimeT;
69 #define SA_TIME_END ((SaTimeT)0x7fffffffffffffffull)
70 #define SA_TIME_BEGIN 0x0ULL
71 #define SA_TIME_UNKNOWN 0x8000000000000000ULL
73 #define SA_TIME_ONE_MICROSECOND 1000ULL
74 #define SA_TIME_ONE_MILLISECOND 1000000ULL
75 #define SA_TIME_ONE_SECOND 1000000000ULL
76 #define SA_TIME_ONE_MINUTE 60000000000ULL
77 #define SA_TIME_ONE_HOUR 3600000000000ULL
78 #define SA_TIME_ONE_DAY 86400000000000ULL
79 #define SA_TIME_MAX SA_TIME_END
81 #define SA_MAX_NAME_LENGTH 256
82 typedef struct {
83 SaUint16T length;
84 SaUint8T value[SA_MAX_NAME_LENGTH];
85 } SaNameT;
87 typedef struct {
88 char releaseCode;
89 unsigned char majorVersion;
90 unsigned char minorVersion;
91 } SaVersionT;
93 typedef SaUint64T SaNtfIdentifierT;
95 #define SA_TRACK_CURRENT 0x01
96 #define SA_TRACK_CHANGES 0x02
97 #define SA_TRACK_CHANGES_ONLY 0x04
99 typedef enum {
100 SA_DISPATCH_ONE = 1,
101 SA_DISPATCH_ALL = 2,
102 SA_DISPATCH_BLOCKING = 3
103 } SaDispatchFlagsT;
105 typedef enum {
106 SA_AIS_OK = 1,
107 SA_AIS_ERR_LIBRARY = 2,
108 SA_AIS_ERR_VERSION = 3,
109 SA_AIS_ERR_INIT = 4,
110 SA_AIS_ERR_TIMEOUT = 5,
111 SA_AIS_ERR_TRY_AGAIN = 6,
112 SA_AIS_ERR_INVALID_PARAM = 7,
113 SA_AIS_ERR_NO_MEMORY = 8,
114 SA_AIS_ERR_BAD_HANDLE = 9,
115 SA_AIS_ERR_BUSY = 10,
116 SA_AIS_ERR_ACCESS = 11,
117 SA_AIS_ERR_NOT_EXIST = 12,
118 SA_AIS_ERR_NAME_TOO_LONG = 13,
119 SA_AIS_ERR_EXIST = 14,
120 SA_AIS_ERR_NO_SPACE = 15,
121 SA_AIS_ERR_INTERRUPT = 16,
122 SA_AIS_ERR_NAME_NOT_FOUND = 17,
123 SA_AIS_ERR_NO_RESOURCES = 18,
124 SA_AIS_ERR_NOT_SUPPORTED = 19,
125 SA_AIS_ERR_BAD_OPERATION = 20,
126 SA_AIS_ERR_FAILED_OPERATION = 21,
127 SA_AIS_ERR_MESSAGE_ERROR = 22,
128 SA_AIS_ERR_QUEUE_FULL = 23,
129 SA_AIS_ERR_QUEUE_NOT_AVAILABLE = 24,
130 SA_AIS_ERR_BAD_FLAGS = 25,
131 SA_AIS_ERR_TOO_BIG = 26,
132 SA_AIS_ERR_NO_SECTIONS = 27
133 } SaAisErrorT;
135 typedef SaUint64T SaSelectionObjectT;
137 typedef SaUint64T SaInvocationT;
139 typedef SaUint64T SaSizeT;
141 #define SA_HANDLE_INVALID 0x0ull
143 #endif /* AIS_TYPES_H_DEFINED */