XBinder  Version 2.9.x
rtxBitString.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003-2022 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  *****************************************************************************/
29 #ifndef _RTXBITSTRING_H_
30 #define _RTXBITSTRING_H_
31 
32 #include "rtxsrc/rtxContext.h"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
48 #define OSRTBYTEARRAYSIZE(numbits) ((numbits+7)/8)
49 
57 EXTERNRT OSUINT32 rtxGetBitCount (OSUINT32 value);
58 
72 EXTERNRT int rtxSetBit (OSOCTET* pBits, OSSIZE numbits, OSSIZE bitIndex);
73 
85 EXTERNRT OSUINT32 rtxSetBitFlags
86 (OSUINT32 flags, OSUINT32 mask, OSBOOL action);
87 
101 EXTERNRT int rtxClearBit
102 (OSOCTET* pBits, OSSIZE numbits, OSSIZE bitIndex);
103 
114 EXTERNRT OSBOOL rtxTestBit
115 (const OSOCTET* pBits, OSSIZE numbits, OSSIZE bitIndex);
116 
127 EXTERNRT OSSIZE rtxLastBitSet (const OSOCTET *pBits, OSSIZE numbits);
128 
146 EXTERNRT int rtxCheckBitBounds(OSCTXT* pctxt, OSOCTET** ppBits,
147  OSSIZE* pNumocts, OSSIZE minRequiredBits, OSSIZE preferredLimitBits);
148 
157 EXTERNRT int rtxZeroUnusedBits (OSOCTET* pBits, OSSIZE numbits);
158 
169 EXTERNRT int rtxCheckUnusedBitsZero (const OSOCTET* pBits, OSSIZE numbits);
170 
174 #ifdef __cplusplus
175 }
176 #endif
177 
178 #endif
EXTERNRT int rtxSetBit(OSOCTET *pBits, OSSIZE numbits, OSSIZE bitIndex)
This function sets the specified zero-counted bit in the bit string.
EXTERNRT int rtxCheckBitBounds(OSCTXT *pctxt, OSOCTET **ppBits, OSSIZE *pNumocts, OSSIZE minRequiredBits, OSSIZE preferredLimitBits)
Check whether the given bit string is large enough, and expand it if necessary.
EXTERNRT int rtxCheckUnusedBitsZero(const OSOCTET *pBits, OSSIZE numbits)
This function checks to see if unused bits at the end of the given bit string are zero...
EXTERNRT int rtxZeroUnusedBits(OSOCTET *pBits, OSSIZE numbits)
This function zeros unused bits at the end of the given bit string.
EXTERNRT int rtxClearBit(OSOCTET *pBits, OSSIZE numbits, OSSIZE bitIndex)
This function clears the specified zero-counted bit in the bit string.
Common run-time context definitions.
EXTERNRT OSBOOL rtxTestBit(const OSOCTET *pBits, OSSIZE numbits, OSSIZE bitIndex)
This function tests the specified zero-counted bit in the bit string.
EXTERNRT OSSIZE rtxLastBitSet(const OSOCTET *pBits, OSSIZE numbits)
This function returns the zero-counted index of the last bit set in a bit string. ...
Run-time context structure.
Definition: rtxContext.h:198
EXTERNRT OSUINT32 rtxGetBitCount(OSUINT32 value)
This function returns the minimum size of the bit field required to hold the given integer value...
EXTERNRT OSUINT32 rtxSetBitFlags(OSUINT32 flags, OSUINT32 mask, OSBOOL action)
This function sets one or more bits to TRUE or FALSE in a 32-bit unsigned bit flag set...