20 uint16_t v = htole16(v_);
26 uint32_t v = htole32(v_);
32 uint64_t v = htole64(v_);
45 else if (vlen < 0x10000) {
62 size_t slen = strnlen(s_in, maxlen);
70 if (!s_in || !s_in->
len) {
81 unsigned int vec_len = vec ? vec->
len : 0;
86 for (i = 0; i < vec_len; i++) {
108 memcpy(po, buf->
p, len);
161 }
else if (c == 254) {
166 }
else if (c == 255) {
185 uint32_t skip_len = 0;
187 skip_len = len - maxlen;
250 for (i = 0; i < vlen; i++) {
251 uint8_t* n = malloc(32);
vector * vector_new(size_t res, void(*free_f)(void *))
void ser_u256_vector(cstring *s, vector *vec)
btc_bool deser_str(char *so, struct const_buffer *buf, size_t maxlen)
btc_bool deser_skip(struct const_buffer *buf, size_t len)
void ser_u32(cstring *s, uint32_t v_)
static void ser_u256(cstring *s, const unsigned char *v_)
cstring * cstr_new_sz(size_t sz)
void ser_u64(cstring *s, uint64_t v_)
void ser_bytes(cstring *s, const void *p, size_t len)
void ser_varlen(cstring *s, uint32_t vlen)
void ser_varstr(cstring *s, cstring *s_in)
btc_bool deser_u32(uint32_t *vo, struct const_buffer *buf)
btc_bool deser_varlen(uint32_t *lo, struct const_buffer *buf)
void ser_str(cstring *s, const char *s_in, size_t maxlen)
void ser_u16(cstring *s, uint16_t v_)
btc_bool deser_bytes(void *po, struct const_buffer *buf, size_t len)
btc_bool vector_add(vector *vec, void *data)
btc_bool deser_u16(uint16_t *vo, struct const_buffer *buf)
#define vector_idx(vec, idx)
btc_bool deser_varstr(cstring **so, struct const_buffer *buf)
btc_bool deser_u64(uint64_t *vo, struct const_buffer *buf)
void vector_free(vector *vec, btc_bool free_array)
btc_bool deser_u256_vector(vector **vo, struct const_buffer *buf)
void cstr_free(cstring *s, btc_bool free_buf)
btc_bool cstr_append_buf(cstring *s, const void *buf, size_t sz)
static btc_bool deser_u256(uint8_t *vo, struct const_buffer *buf)