CBOR-Free

 view release on metacpan or  search on metacpan

cbor_free_decode.c  view on Meta::CPAN


#define _RETURN_IF_SET_INCOMPLETE(decstate, toreturn) \
    if (decstate->incomplete_by) return toreturn;

#define SHOULD_VALIDATE_UTF8(decstate, major_type) \
    major_type == CBOR_TYPE_UTF8 \
    || decstate->string_decode_mode == CBF_STRING_DECODE_ALWAYS

//----------------------------------------------------------------------

// Basically ntohll(), but it accepts a pointer.
static inline UV _buffer_u64_to_uv( unsigned char *buffer ) {
#ifdef CBF_64BIT_INET
    return ntohll( *( (uint64_t*) buffer ) );
#else

    return (
#if IS_64_BIT
        ( ((UV) ntohl( *( (uint32_t*) buffer ) )) << 32 ) +
#endif
        ntohl( *( (uint32_t*) buffer + 1 ) )
    );
#endif
}



( run in 2.854 seconds using v1.01-cache-2.11-cpan-800906f7e73 )