BitVecReplaceAll
- Function
- August 22, 2025
Table of Contents
BitVecReplaceAll
BitVecReplaceAll
Description
Replace all occurrences of old pattern with new pattern.
Parameters
Name | Direction | Description |
---|---|---|
bv | in | Bitvector to modify |
old_pattern | in | Pattern to find and replace |
new_pattern | in | Pattern to replace with |
Usage example (from documentation)
u64 count = BitVecReplaceAll(&flags, &old_pat, &new_pat);
Usage example (Cross-references)
- In
BitVec.c:1500
:
}
u64 BitVecReplaceAll(BitVec *bv, BitVec *old_pattern, BitVec *new_pattern) {
ValidateBitVec(bv);
ValidateBitVec(old_pattern);
// BitVecReplaceAll tests
bool test_bitvec_replace_all_basic(void) {
printf("Testing BitVecReplaceAll basic functionality\n");
BitVec source = BitVecInit();
BitVecPush(&new_pattern, true);
u64 replacements = BitVecReplaceAll(&source, &old_pattern, &new_pattern);
result = result && (replacements == 3);
// BitVecReplaceAll tests
bool test_bitvec_replace_all_basic(void) {
printf("Testing BitVecReplaceAll basic functionality\n");
BitVec source = BitVecInit();
BitVecPush(&new_pattern, true);
u64 replacements = BitVecReplaceAll(&source, &old_pattern, &new_pattern);
result = result && (replacements == 3);