XBinder  Version 2.6.x
rtxBitDecode.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007-2018 Objective Systems, Inc.
3  *
4  * This software is furnished under a license and may be used and copied
5  * only in accordance with the terms of such license and with the
6  * inclusion of the above copyright notice. This software or any other
7  * copies thereof may not be provided or otherwise made available to any
8  * other person. No title to and ownership of the software is hereby
9  * transferred.
10  *
11  * The information in this software is subject to change without notice
12  * and should not be construed as a commitment by Objective Systems, Inc.
13  *
14  * PROPRIETARY NOTICE
15  *
16  * This software is an unpublished work subject to a confidentiality agreement
17  * and is protected by copyright and trade secret law. Unauthorized copying,
18  * redistribution or other use of this work is prohibited.
19  *
20  * The above notice of copyright on this source code product does not indicate
21  * any actual or intended publication of such source code.
22  *
23  *****************************************************************************/
28 #ifndef _RTXBITDECODE_H_
29 #define _RTXBITDECODE_H_
30 
31 #include "rtxsrc/rtxContext.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 #define DEC_BIT(pctxt,pvalue) \
38 (((pctxt)->buffer.byteIndex >= (pctxt)->buffer.size) ? \
39  rtxDecBit (pctxt, pvalue) \
40  : \
41  (*(pvalue) = (pctxt)->buffer.data[(pctxt)->buffer.byteIndex], \
42  --(pctxt)->buffer.bitOffset == 0 ? \
43  ((pctxt)->buffer.bitOffset = 8, (pctxt)->buffer.byteIndex++) \
44  : \
45  (*(pvalue) >>= (pctxt)->buffer.bitOffset), \
46  *(pvalue) &= 1, \
47  0))
48 
49 EXTERNRT int rtxMoveBitCursor (OSCTXT* pctxt, int bitOffset);
50 
66 EXTERNRT int rtxDecBit (OSCTXT* pctxt, OSBOOL* pvalue);
67 
80 EXTERNRT int rtxDecBits (OSCTXT* pctxt, OSUINT32* pvalue, OSSIZE nbits);
81 
94 EXTERNRT int rtxDecBitsToSize (OSCTXT* pctxt, OSSIZE* pvalue, OSSIZE nbits);
95 
111 EXTERNRT int rtxDecBitsToByte
112 (OSCTXT* pctxt, OSUINT8* pvalue, OSUINT8 nbits);
113 
129 EXTERNRT int rtxDecBitsToUInt16
130 (OSCTXT* pctxt, OSUINT16* pvalue, OSUINT8 nbits);
131 
144 EXTERNRT int rtxDecBitsToByteArray
145 (OSCTXT* pctxt, OSOCTET* pbuffer, OSSIZE bufsiz, OSSIZE nbits);
146 
162 EXTERNRT int rtxPeekBit (OSCTXT* pctxt, OSBOOL* pvalue);
163 
174 EXTERNRT int rtxSkipBits (OSCTXT* pctxt, OSSIZE nbits);
175 
176 #ifdef __cplusplus
177 }
178 #endif
179 
180 #endif
EXTERNRT int rtxDecBitsToSize(OSCTXT *pctxt, OSSIZE *pvalue, OSSIZE nbits)
This function decodes up to sizeof(size_t) bits and returns the result in a size-typed value...
EXTERNRT int rtxDecBitsToByte(OSCTXT *pctxt, OSUINT8 *pvalue, OSUINT8 nbits)
This function decodes bits and returns the result in a byte (octet) value.
Common run-time context definitions.
EXTERNRT int rtxSkipBits(OSCTXT *pctxt, OSSIZE nbits)
This function skips the given number of bits.
EXTERNRT int rtxDecBitsToByteArray(OSCTXT *pctxt, OSOCTET *pbuffer, OSSIZE bufsiz, OSSIZE nbits)
This function decodes bits and returns the result in an octet array.
EXTERNRT int rtxPeekBit(OSCTXT *pctxt, OSBOOL *pvalue)
This function decodes the bit at the current position and the resets the bit cursor back to the origi...
EXTERNRT int rtxDecBit(OSCTXT *pctxt, OSBOOL *pvalue)
This function will decode a single bit and return the result in an OSBOOL value.
EXTERNRT int rtxDecBitsToUInt16(OSCTXT *pctxt, OSUINT16 *pvalue, OSUINT8 nbits)
This function decodes bits and returns the result in an unsigned 16-bit (short) value.
EXTERNRT int rtxDecBits(OSCTXT *pctxt, OSUINT32 *pvalue, OSSIZE nbits)
This function decodes up to sizeof(unsigned) bits and returns the result in an unsigned integer value...
Run-time context structure.
Definition: rtxContext.h:185