saAis.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. * Copyright (c) 2002-2003 MontaVista Software, Inc.
  3. * Copyright (c) 2006 Sun Microsystems, Inc.
  4. *
  5. * All rights reserved.
  6. *
  7. * Author: Steven Dake (sdake@mvista.com)
  8. *
  9. * This software licensed under BSD license, the text of which follows:
  10. *
  11. * Redistribution and use in source and binary forms, with or without
  12. * modification, are permitted provided that the following conditions are met:
  13. *
  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.
  22. *
  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.
  34. */
  35. #ifndef AIS_TYPES_H_DEFINED
  36. #define AIS_TYPES_H_DEFINED
  37. /**
  38. * @defgroup saf Service Availability Forum Application Interface Specification
  39. */
  40. typedef enum {
  41. SA_FALSE = 0,
  42. SA_TRUE = 1
  43. } SaBoolT;
  44. #ifndef OPENAIS_SOLARIS
  45. #include <stdint.h>
  46. #else
  47. #include <sys/types.h>
  48. #endif
  49. typedef int8_t SaInt8T;
  50. typedef int16_t SaInt16T;
  51. typedef int32_t SaInt32T;
  52. typedef int64_t SaInt64T;
  53. typedef uint8_t SaUint8T;
  54. typedef uint16_t SaUint16T;
  55. typedef uint32_t SaUint32T;
  56. typedef uint64_t SaUint64T;
  57. typedef float SaFloatT;
  58. typedef double SaDoubleT;
  59. typedef char * SaStringT;
  60. typedef SaInt64T SaTimeT;
  61. #define SA_TIME_END ((SaTimeT)0x7fffffffffffffffull)
  62. #define SA_TIME_BEGIN 0x0ULL
  63. #define SA_TIME_UNKNOWN 0x8000000000000000ULL
  64. #define SA_TIME_ONE_MICROSECOND 1000ULL
  65. #define SA_TIME_ONE_MILLISECOND 1000000ULL
  66. #define SA_TIME_ONE_SECOND 1000000000ULL
  67. #define SA_TIME_ONE_MINUTE 60000000000ULL
  68. #define SA_TIME_ONE_HOUR 3600000000000ULL
  69. #define SA_TIME_ONE_DAY 86400000000000ULL
  70. #define SA_TIME_MAX SA_TIME_END
  71. #define SA_MAX_NAME_LENGTH 256
  72. typedef struct {
  73. SaUint16T length;
  74. SaUint8T value[SA_MAX_NAME_LENGTH];
  75. } SaNameT;
  76. typedef struct {
  77. char releaseCode;
  78. unsigned char majorVersion;
  79. unsigned char minorVersion;
  80. } SaVersionT;
  81. typedef SaUint64T SaNtfIdentifierT;
  82. #define SA_TRACK_CURRENT 0x01
  83. #define SA_TRACK_CHANGES 0x02
  84. #define SA_TRACK_CHANGES_ONLY 0x04
  85. typedef enum {
  86. SA_DISPATCH_ONE = 1,
  87. SA_DISPATCH_ALL = 2,
  88. SA_DISPATCH_BLOCKING = 3
  89. } SaDispatchFlagsT;
  90. typedef enum {
  91. SA_AIS_OK = 1,
  92. SA_AIS_ERR_LIBRARY = 2,
  93. SA_AIS_ERR_VERSION = 3,
  94. SA_AIS_ERR_INIT = 4,
  95. SA_AIS_ERR_TIMEOUT = 5,
  96. SA_AIS_ERR_TRY_AGAIN = 6,
  97. SA_AIS_ERR_INVALID_PARAM = 7,
  98. SA_AIS_ERR_NO_MEMORY = 8,
  99. SA_AIS_ERR_BAD_HANDLE = 9,
  100. SA_AIS_ERR_BUSY = 10,
  101. SA_AIS_ERR_ACCESS = 11,
  102. SA_AIS_ERR_NOT_EXIST = 12,
  103. SA_AIS_ERR_NAME_TOO_LONG = 13,
  104. SA_AIS_ERR_EXIST = 14,
  105. SA_AIS_ERR_NO_SPACE = 15,
  106. SA_AIS_ERR_INTERRUPT = 16,
  107. SA_AIS_ERR_NAME_NOT_FOUND = 17,
  108. SA_AIS_ERR_NO_RESOURCES = 18,
  109. SA_AIS_ERR_NOT_SUPPORTED = 19,
  110. SA_AIS_ERR_BAD_OPERATION = 20,
  111. SA_AIS_ERR_FAILED_OPERATION = 21,
  112. SA_AIS_ERR_MESSAGE_ERROR = 22,
  113. SA_AIS_ERR_QUEUE_FULL = 23,
  114. SA_AIS_ERR_QUEUE_NOT_AVAILABLE = 24,
  115. SA_AIS_ERR_BAD_FLAGS = 25,
  116. SA_AIS_ERR_TOO_BIG = 26,
  117. SA_AIS_ERR_NO_SECTIONS = 27
  118. } SaAisErrorT;
  119. typedef SaUint64T SaSelectionObjectT;
  120. typedef SaUint64T SaInvocationT;
  121. typedef SaUint64T SaSizeT;
  122. #define SA_HANDLE_INVALID 0x0ull
  123. #endif /* AIS_TYPES_H_DEFINED */