saAis.h 4.1 KB

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