XBinder  Version 2.6.x
rtxDynBitSet.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2018 by 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 _RTXDYNBITSET_H_
29 #define _RTXDYNBITSET_H_
30 
31 #include "rtxsrc/rtxBitString.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 #define OSRTBITSETSEGSIZE 16 /* Segment size in bytes */
38 
39 typedef struct {
40  OSUINT16 nbytes; /* Number of bytes in allocated array */
41  OSUINT16 maxbit; /* Maximum bit number currently set */
42  OSUINT16 segsize; /* Segment size for expansions */
43  OSUINT16 spare; /* 32-bit word boundary padding */
44  OSOCTET* data; /* Dynamic array to hold bits */
45 } OSRTDynBitSet;
46 
58 EXTERNRT int rtxDynBitSetInit
59 (OSCTXT* pctxt, OSRTDynBitSet* pbitset, OSUINT16 segNBytes);
60 
67 EXTERNRT void rtxDynBitSetFree (OSCTXT* pctxt, OSRTDynBitSet* pbitset);
68 
78 EXTERNRT int rtxDynBitSetCopy
79 (OSCTXT* pctxt, const OSRTDynBitSet* pSrcBitSet, OSRTDynBitSet* pDestBitSet);
80 
91 EXTERNRT int rtxDynBitSetSetBit
92 (OSCTXT* pctxt, OSRTDynBitSet* pbitset, OSUINT32 idx);
93 
105 EXTERNRT int rtxDynBitSetClearBit (OSRTDynBitSet* pbitset, OSUINT32 idx);
106 
117 EXTERNRT OSBOOL rtxDynBitSetTestBit
118 (const OSRTDynBitSet* pbitset, OSUINT32 idx);
119 
132 EXTERNRT int rtxDynBitSetSetBitToValue
133 (OSCTXT* pctxt, OSRTDynBitSet* pbitset, OSUINT32 idx, OSBOOL value);
134 
148 EXTERNRT int rtxDynBitSetInsertBit
149 (OSCTXT* pctxt, OSRTDynBitSet* pbitset, OSUINT32 idx, OSBOOL value);
150 
151 #ifdef _TRACE
152 
158 EXTERNRT void rtxDynBitSetPrint
159 (const OSRTDynBitSet* pbitset, const char* varname);
160 
161 #endif
162 
163 #ifdef __cplusplus
164 }
165 #endif
166 
167 #endif
EXTERNRT int rtxDynBitSetSetBit(OSCTXT *pctxt, OSRTDynBitSet *pbitset, OSUINT32 idx)
This function sets the bit at the given index.
EXTERNRT OSBOOL rtxDynBitSetTestBit(const OSRTDynBitSet *pbitset, OSUINT32 idx)
This function tests the bit at the given index.
EXTERNRT int rtxDynBitSetClearBit(OSRTDynBitSet *pbitset, OSUINT32 idx)
This function clears the bit at the given index.
EXTERNRT int rtxDynBitSetInit(OSCTXT *pctxt, OSRTDynBitSet *pbitset, OSUINT16 segNBytes)
This function initializes a dynamic bit set structure.
EXTERNRT int rtxDynBitSetSetBitToValue(OSCTXT *pctxt, OSRTDynBitSet *pbitset, OSUINT32 idx, OSBOOL value)
This function sets the bit at the given index to the give value.
EXTERNRT void rtxDynBitSetFree(OSCTXT *pctxt, OSRTDynBitSet *pbitset)
This function frees dynamic memory held by the bit set.
Contains utility functions for setting, clearing, and testing bits at any position in an arbitrarily ...
EXTERNRT int rtxDynBitSetInsertBit(OSCTXT *pctxt, OSRTDynBitSet *pbitset, OSUINT32 idx, OSBOOL value)
This function inserts a bit with the given value at the given index.
Run-time context structure.
Definition: rtxContext.h:185
EXTERNRT int rtxDynBitSetCopy(OSCTXT *pctxt, const OSRTDynBitSet *pSrcBitSet, OSRTDynBitSet *pDestBitSet)
This function creates a deep copy of the given bit set.