35typedef enum as_bytes_type_e {
250typedef struct as_bytes_s {
303#define as_bytes_inita(__bytes, __capacity)\
304 as_bytes_init(__bytes, 0);\
305 (__bytes)->type = AS_BYTES_BLOB;\
306 (__bytes)->free = false;\
307 (__bytes)->capacity = (__capacity);\
308 (__bytes)->size = 0;\
309 (__bytes)->value = (uint8_t*) alloca(sizeof(uint8_t) * (__capacity));
421 if ( !bytes )
return 0;
436 if ( !bytes )
return 0;
465 if ( !bytes )
return;
487 return bytes ? bytes->
value : fallback;
698 return as_bytes_set(bytes, index, (uint8_t *) &value, 1);
714 return as_bytes_set(bytes, index, (uint8_t *) &value, 2);
730 return as_bytes_set(bytes, index, (uint8_t *) &value, 4);
746 return as_bytes_set(bytes, index, (uint8_t *) &value, 8);
762 return as_bytes_set(bytes, index, (uint8_t *) &value, 8);
949 if ( !bytes )
return NULL;
AS_EXTERN uint32_t as_bytes_val_hashcode(const as_val *v)
static uint8_t * as_bytes_getorelse(const as_bytes *bytes, uint8_t *fallback)
AS_EXTERN char * as_bytes_val_tostring(const as_val *v)
AS_EXTERN void as_bytes_val_destroy(as_val *v)
AS_EXTERN bool as_bytes_to_string_with_prefix(const uint8_t *bytes, uint32_t bytes_size, char *str, uint32_t str_size)
AS_EXTERN uint32_t as_bytes_copy(const as_bytes *bytes, uint32_t index, uint8_t *value, uint32_t size)
AS_EXTERN bool as_bytes_set(as_bytes *bytes, uint32_t index, const uint8_t *value, uint32_t size)
AS_EXTERN bool as_bytes_append(as_bytes *bytes, const uint8_t *value, uint32_t size)
AS_EXTERN bool as_bytes_to_string(const uint8_t *bytes, uint32_t bytes_size, char *str, uint32_t str_size)
AS_EXTERN int as_bytes_from_string(uint8_t *bytes, uint32_t bytes_size, const char *str)
#define as_util_fromval(object, type_id, type)
#define as_val_destroy(__v)
static bool as_bytes_append_int32(as_bytes *bytes, int32_t value)
static uint8_t * as_bytes_getorelse(const as_bytes *bytes, uint8_t *fallback)
static bool as_bytes_set_int16(as_bytes *bytes, uint32_t index, int16_t value)
static bool as_bytes_set_double(as_bytes *bytes, uint32_t index, double value)
static bool as_bytes_set_int32(as_bytes *bytes, uint32_t index, int32_t value)
AS_EXTERN bool as_bytes_truncate(as_bytes *bytes, uint32_t n)
AS_EXTERN uint32_t as_bytes_get_var_int(const as_bytes *bytes, uint32_t index, uint32_t *value)
static bool as_bytes_append_double(as_bytes *bytes, double value)
AS_EXTERN bool as_bytes_ensure(as_bytes *bytes, uint32_t capacity, bool resize)
static bool as_bytes_append_byte(as_bytes *bytes, uint8_t value)
static uint32_t as_bytes_get_int16(const as_bytes *bytes, uint32_t index, int16_t *value)
AS_EXTERN as_bytes * as_bytes_new(uint32_t capacity)
static uint32_t as_bytes_get_double(const as_bytes *bytes, uint32_t index, double *value)
static uint32_t as_bytes_capacity(const as_bytes *bytes)
static bool as_bytes_append_int64(as_bytes *bytes, int64_t value)
static bool as_bytes_append_int16(as_bytes *bytes, int16_t value)
AS_EXTERN uint32_t as_bytes_copy(const as_bytes *bytes, uint32_t index, uint8_t *value, uint32_t size)
static uint32_t as_bytes_get_byte(const as_bytes *bytes, uint32_t index, uint8_t *value)
AS_EXTERN as_bytes * as_bytes_init_wrap(as_bytes *bytes, uint8_t *value, uint32_t size, bool free)
AS_EXTERN bool as_bytes_set(as_bytes *bytes, uint32_t index, const uint8_t *value, uint32_t size)
AS_EXTERN bool as_bytes_append(as_bytes *bytes, const uint8_t *value, uint32_t size)
static uint8_t * as_bytes_get(const as_bytes *bytes)
AS_EXTERN as_bytes * as_bytes_init(as_bytes *bytes, uint32_t capacity)
static uint32_t as_bytes_get_int32(const as_bytes *bytes, uint32_t index, int32_t *value)
static as_val * as_bytes_toval(const as_bytes *b)
static void as_bytes_destroy(as_bytes *bytes)
static as_bytes * as_bytes_fromval(const as_val *v)
static uint8_t * as_bytes_tobytes(const as_bytes *bytes, uint32_t *size)
static uint32_t as_bytes_get_int64(const as_bytes *bytes, uint32_t index, int64_t *value)
static void as_bytes_set_type(as_bytes *bytes, as_bytes_type type)
static as_bytes_type as_bytes_get_type(const as_bytes *bytes)
static bool as_bytes_set_byte(as_bytes *bytes, uint32_t index, uint8_t value)
static bool as_bytes_set_int64(as_bytes *bytes, uint32_t index, int64_t value)
AS_EXTERN as_bytes * as_bytes_new_wrap(uint8_t *value, uint32_t size, bool free)
AS_EXTERN uint32_t as_bytes_set_var_int(const as_bytes *bytes, uint32_t index, uint32_t value)
static uint32_t as_bytes_size(const as_bytes *bytes)