Skip to content
BitVecToStrAlloc

BitVecToStrAlloc

Description

Convert a bitvector to a string using an explicit allocator.

Parameters

Name Direction Description
bv in Bitvector to convert.
alloc in Allocator to bind to the returned string.

Success

Returns a string containing bit characters.

Failure

Returns an empty string if allocation fails.

Usage example (Cross-references)

Usage examples (Cross-references)
    }
    
    Str BitVecToStrAlloc(BitVec *bv, Allocator alloc) {
        Str result;
    #define BITVEC_TO_STR_HAS_ARGS(...)                     BITVEC_TO_STR_HAS_ARGS_IMPL(__VA_ARGS__, 2, 1, 0)
    #define BitVecToStr(...)                                CONCAT(BitVecToStr_, BITVEC_TO_STR_HAS_ARGS(__VA_ARGS__))(__VA_ARGS__)
    #define BitVecToStr_1(bv)                               BitVecToStrAlloc((bv), BitVecGetAllocator((bv)))
    #define BitVecToStr_2(bv, alloc)                        BitVecToStrAlloc((bv), (alloc))
    #define BitVecToStr(...)                                CONCAT(BitVecToStr_, BITVEC_TO_STR_HAS_ARGS(__VA_ARGS__))(__VA_ARGS__)
    #define BitVecToStr_1(bv)                               BitVecToStrAlloc((bv), BitVecGetAllocator((bv)))
    #define BitVecToStr_2(bv, alloc)                        BitVecToStrAlloc((bv), (alloc))
    
    ///
Last updated on