BitVecTryToStrAlloc
Description
Convert a bitvector to a string using an explicit allocator.
Parameters
| Name | Direction | Description |
|---|---|---|
out |
out | Destination string. |
bv |
in | Bitvector to convert. |
alloc |
in | Allocator to bind to the destination string. |
Success
Returns true and initializes out.
Failure
Returns false if allocation fails.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Io.c:2926:
Str bit_str;
if (!BitVecTryToStrAlloc(&bit_str, bv, o->allocator)) {
return false;
}- In
BitVec.c:796:
}
bool BitVecTryToStrAlloc(Str *out, BitVec *bv, Allocator alloc) {
ValidateBitVec(bv);
if (!out) {- In
BitVec.c:828:
Str result;
if (!BitVecTryToStrAlloc(&result, bv, alloc)) {
result = StrInit(alloc);
}- In
Convert.h:198:
#define BITVEC_TRY_TO_STR_HAS_ARGS(...) BITVEC_TRY_TO_STR_HAS_ARGS_IMPL(__VA_ARGS__, 3, 2, 1, 0)
#define BitVecTryToStr(...) CONCAT(BitVecTryToStr_, BITVEC_TRY_TO_STR_HAS_ARGS(__VA_ARGS__))(__VA_ARGS__)
#define BitVecTryToStr_2(out, bv) BitVecTryToStrAlloc((out), (bv), BitVecGetAllocator((bv)))
#define BitVecTryToStr_3(out, bv, alloc) BitVecTryToStrAlloc((out), (bv), (alloc))- In
Convert.h:199:
#define BitVecTryToStr(...) CONCAT(BitVecTryToStr_, BITVEC_TRY_TO_STR_HAS_ARGS(__VA_ARGS__))(__VA_ARGS__)
#define BitVecTryToStr_2(out, bv) BitVecTryToStrAlloc((out), (bv), BitVecGetAllocator((bv)))
#define BitVecTryToStr_3(out, bv, alloc) BitVecTryToStrAlloc((out), (bv), (alloc))
///
Last updated on