XBinder  Version 2.6.x
rtxBitEncode.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 _RTXBITENCODE_H_
29 #define _RTXBITENCODE_H_
30 
31 #include "rtxsrc/rtxContext.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
44 #define rtxEncByteAlignPattern(pctxt, pattern) \
45 if ((pctxt)->buffer.bitOffset != 8) { \
46  rtxEncBits(pctxt, pattern, (pctxt)->buffer.bitOffset); }
47 
63 EXTERNRT int rtxEncBitsPattern(OSCTXT* pctxt, OSUINT8 pattern, size_t nbits);
64 
74 EXTERNRT int rtxEncBit (OSCTXT* pctxt, OSBOOL value);
75 
88 EXTERNRT int rtxEncBits (OSCTXT* pctxt, OSUINT32 value, size_t nbits);
89 
101 EXTERNRT int rtxEncBitsFromByteArray
102 (OSCTXT* pctxt, const OSOCTET* pvalue, size_t nbits);
103 
117 EXTERNRT int rtxCopyBits
118 (OSCTXT* pctxt, const OSOCTET* pvalue, size_t nbits, OSUINT32 bitOffset);
119 
132 EXTERNRT int rtxMergeBits (OSCTXT* pctxt, OSUINT32 value, OSSIZE nbits);
133 
134 #ifdef __cplusplus
135 }
136 #endif
137 
138 #endif
EXTERNRT int rtxEncBits(OSCTXT *pctxt, OSUINT32 value, size_t nbits)
This function encodes a number of the least significant bits (up to 32) of an unsigned integer value...
EXTERNRT int rtxMergeBits(OSCTXT *pctxt, OSUINT32 value, OSSIZE nbits)
This function will merge a series of bits (up to 32) from an unsigned integer value into an existing ...
Common run-time context definitions.
EXTERNRT int rtxEncBitsPattern(OSCTXT *pctxt, OSUINT8 pattern, size_t nbits)
This function encodes the given number of bits using a repeating bit pattern.
EXTERNRT int rtxCopyBits(OSCTXT *pctxt, const OSOCTET *pvalue, size_t nbits, OSUINT32 bitOffset)
This function will encode a series of bits from an octet array.
EXTERNRT int rtxEncBitsFromByteArray(OSCTXT *pctxt, const OSOCTET *pvalue, size_t nbits)
This function will encode a series of bits from an octet array.
Run-time context structure.
Definition: rtxContext.h:185
EXTERNRT int rtxEncBit(OSCTXT *pctxt, OSBOOL value)
This function will set the bit at the current encode bit cursor position to 1 or 0 and advance the cu...