DecoderChannel.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /*
  2. * Copyright (C) 2007-2011 Siemens AG
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Lesser General Public License as published
  6. * by the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU Lesser General Public License for more details.
  13. * GNU Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /*******************************************************************
  19. *
  20. * @author Daniel.Peintner.EXT@siemens.com
  21. * @version 2011-12-02
  22. * @contact Joerg.Heuer@siemens.com
  23. *
  24. * <p>Code generated by EXIdizer</p>
  25. ********************************************************************/
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. #include "EXITypes.h"
  30. #include "CoderChannel.h"
  31. #ifndef DECODER_CHANNEL_H
  32. #define DECODER_CHANNEL_H
  33. /**
  34. * Decode a byte value.
  35. */
  36. int decode(bitstream_t* stream, uint8_t* b);
  37. /**
  38. * Decode a single boolean value. The value false is represented by the bit
  39. * 0, and the value true is represented by the bit 1.
  40. */
  41. int decodeBoolean(bitstream_t* stream, int* b);
  42. /**
  43. * Decodes and returns an n-bit unsigned integer.
  44. */
  45. int decodeNBitUnsignedInteger(bitstream_t* stream, uint16_t nbits, uint32_t* uint32);
  46. /**
  47. * Decode an arbitrary precision non negative integer using a sequence of
  48. * octets. The most significant bit of the last octet is set to zero to
  49. * indicate sequence termination. Only seven bits per octet are used to
  50. * store the integer's value.
  51. */
  52. int decodeUnsignedInteger(bitstream_t* stream, integer_t* iv);
  53. /**
  54. * Decode an arbitrary precision non negative integer using a sequence of
  55. * octets. The most significant bit of the last octet is set to zero to
  56. * indicate sequence termination. Only seven bits per octet are used to
  57. * store the integer's value.
  58. */
  59. int decodeUnsignedInteger16(bitstream_t* stream, uint16_t* uint16);
  60. /**
  61. * Decode an arbitrary precision non negative integer using a sequence of
  62. * octets. The most significant bit of the last octet is set to zero to
  63. * indicate sequence termination. Only seven bits per octet are used to
  64. * store the integer's value.
  65. */
  66. int decodeUnsignedInteger32(bitstream_t* stream, uint32_t* uint32);
  67. /**
  68. * Decode an arbitrary precision non negative integer using a sequence of
  69. * octets. The most significant bit of the last octet is set to zero to
  70. * indicate sequence termination. Only seven bits per octet are used to
  71. * store the integer's value.
  72. */
  73. int decodeUnsignedInteger64(bitstream_t* stream, uint64_t* uint64);
  74. /**
  75. * Decode an arbitrary precision integer using a sign bit followed by a
  76. * sequence of octets. The most significant bit of the last octet is set to
  77. * zero to indicate sequence termination. Only seven bits per octet are used
  78. * to store the integer's value.
  79. */
  80. int decodeInteger(bitstream_t* stream, integer_t* iv);
  81. /**
  82. * Decode an arbitrary precision integer using a sign bit followed by a
  83. * sequence of octets. The most significant bit of the last octet is set to
  84. * zero to indicate sequence termination. Only seven bits per octet are used
  85. * to store the integer's value.
  86. */
  87. int decodeInteger32(bitstream_t* stream, int32_t* int32);
  88. /**
  89. * Decode an arbitrary precision integer using a sign bit followed by a
  90. * sequence of octets. The most significant bit of the last octet is set to
  91. * zero to indicate sequence termination. Only seven bits per octet are used
  92. * to store the integer's value.
  93. */
  94. int decodeInteger64(bitstream_t* stream, int64_t* int64);
  95. /**
  96. * Decode a Float datatype as two consecutive Integers.
  97. * The first Integer represents the mantissa of the floating point
  98. * number and the second Integer represents the base-10 exponent
  99. * of the floating point number.
  100. */
  101. int decodeFloat(bitstream_t* stream, float_me_t* f);
  102. /**
  103. * Decode a decimal represented as a Boolean sign followed by two Unsigned
  104. * Integers. A sign value of zero (0) is used to represent positive Decimal
  105. * values and a sign value of one (1) is used to represent negative Decimal
  106. * values The first Integer represents the integral portion of the Decimal
  107. * value. The second positive integer represents the fractional portion of
  108. * the decimal with the digits in reverse order to preserve leading zeros.
  109. */
  110. int decodeDecimal(bitstream_t* stream, decimal_t* d);
  111. /**
  112. * Decode a sequence of characters for a given length.
  113. */
  114. int decodeStringOnly(bitstream_t* stream, uint16_t len, string_ucs_t* s);
  115. /**
  116. * Decode a length prefixed sequence of characters.
  117. */
  118. int decodeString(bitstream_t* stream, string_ucs_t* s);
  119. int decodeStringASCII(bitstream_t* stream, string_ascii_t* s);
  120. /**
  121. * Decode a length prefixed sequence of characters in the sense of string tables.
  122. * length == 0, local value partition hit
  123. * length == 1, global value partition hit
  124. * --> string literal is encoded as a String with the length incremented by two
  125. */
  126. int decodeStringValue(bitstream_t* stream, string_ucs_t* s);
  127. /**
  128. * Restricted character set
  129. */
  130. int decodeRCSStringValue(bitstream_t* stream, rcs_t* rcs, string_ucs_t* s);
  131. /**
  132. * Decode a sequence of characters according to a given length.
  133. */
  134. int decodeCharacters(bitstream_t* stream, uint16_t len, uint32_t* chars);
  135. int decodeCharactersASCII(bitstream_t* stream, uint16_t len, char* chars);
  136. /**
  137. * Decode a binary value as a length-prefixed sequence of octets.
  138. */
  139. int decodeBinary(bitstream_t* stream, bytes_t* bytes);
  140. /**
  141. * Decode Date-Time as sequence of values representing the individual
  142. * components of the Date-Time.
  143. */
  144. int decodeDateTime(bitstream_t* stream, exi_datetime_type_t type, datetime_t* datetime);
  145. #endif
  146. #ifdef __cplusplus
  147. }
  148. #endif