Lines Matching refs:sz

26 static void *adjust_pointer(const void *p, void *old_base, size_t sz, void *new_base) {  in adjust_pointer()  argument
37 if ((uint8_t*) p >= (uint8_t*) old_base + sz) in adjust_pointer()
150 static void *message_extend_fields(sd_bus_message *m, size_t align, size_t sz, bool add_offset) { in message_extend_fields() argument
161 new_size = start + sz; in message_extend_fields()
541 size_t sz; in bus_message_from_malloc() local
555 sz = length - sizeof(struct bus_header) - ALIGN8(m->fields_size); in bus_message_from_malloc()
556 if (sz > 0) { in bus_message_from_malloc()
559 m->body.size = sz; in bus_message_from_malloc()
1226 static void part_zero(struct bus_body_part *part, size_t sz) { in part_zero() argument
1228 assert(sz > 0); in part_zero()
1229 assert(sz < 8); in part_zero()
1235 part->size = sz; in part_zero()
1243 size_t sz, in part_make_space() argument
1255 if (part->allocated == 0 || sz > part->allocated) { in part_make_space()
1258 new_allocated = sz > 0 ? 2 * sz : 64; in part_make_space()
1273 part->size = sz; in part_make_space()
1316 size_t sz, in message_extend_body() argument
1332 end_body = start_body + sz; in message_extend_body()
1335 added = padding + sz; in message_extend_body()
1368 r = part_make_space(m, part, sz, &p); in message_extend_body()
1380 end_part = start_part + sz; in message_extend_body()
1448 ssize_t align, sz; in message_append_basic() local
1493 sz = strlen(p) + 1; in message_append_basic()
1501 align = sz = 1; in message_append_basic()
1516 align = sz = 4; in message_append_basic()
1521 sz = bus_gvariant_get_size(CHAR_TO_STR(type)); in message_append_basic()
1526 assert(sz > 0); in message_append_basic()
1528 a = message_extend_body(m, align, sz, true, false); in message_append_basic()
1532 memcpy(a, p, sz); in message_append_basic()
1554 sz = 4 + strlen(p) + 1; in message_append_basic()
1562 sz = 1 + strlen(p) + 1; in message_append_basic()
1570 align = sz = 4; in message_append_basic()
1585 align = sz = 4; in message_append_basic()
1590 sz = bus_type_get_size(type); in message_append_basic()
1595 assert(sz > 0); in message_append_basic()
1597 a = message_extend_body(m, align, sz, false, false); in message_append_basic()
1602 *(uint32_t*) a = sz - 5; in message_append_basic()
1603 memcpy((uint8_t*) a + 4, p, sz - 4); in message_append_basic()
1609 *(uint8_t*) a = sz - 2; in message_append_basic()
1610 memcpy((uint8_t*) a + 1, p, sz - 1); in message_append_basic()
1615 memcpy(a, p, sz); in message_append_basic()
2086 size_t payload, sz, i; in bus_message_close_array() local
2092 sz = bus_gvariant_determine_word_size(payload, c->n_offsets); in bus_message_close_array()
2094 a = message_extend_body(m, 1, sz * c->n_offsets, true, false); in bus_message_close_array()
2099 bus_gvariant_write_word_le(a + sz*i, sz, c->offsets[i] - c->begin); in bus_message_close_array()
2209 size_t sz; in bus_message_close_struct() local
2214 sz = bus_gvariant_determine_word_size(m->body_size - c->begin, n_variable); in bus_message_close_struct()
2216 a = message_extend_body(m, 1, sz * n_variable, add_offset, false); in bus_message_close_struct()
2245 bus_gvariant_write_word_le(a + k * sz, sz, c->offsets[i] - c->begin); in bus_message_close_struct()
2546 ssize_t align, sz; in sd_bus_message_append_array_space() local
2559 sz = bus_type_get_size(type); in sd_bus_message_append_array_space()
2562 assert_se(sz > 0); in sd_bus_message_append_array_space()
2564 if (size % sz != 0) in sd_bus_message_append_array_space()
2651 ssize_t align, sz; in sd_bus_message_append_array_memfd() local
2681 sz = bus_type_get_size(type); in sd_bus_message_append_array_memfd()
2684 assert_se(sz > 0); in sd_bus_message_append_array_memfd()
2689 if (size % sz != 0) in sd_bus_message_append_array_memfd()
2849 size_t sz, l; in bus_message_close_header() local
2859 sz = bus_gvariant_determine_word_size(m->fields_size, m->n_header_offsets); in bus_message_close_header()
2860 a = message_extend_fields(m, 1, sz * m->n_header_offsets, false); in bus_message_close_header()
2865 bus_gvariant_write_word_le(a + sz*i, sz, m->header_offsets[i]); in bus_message_close_header()
2875sz = bus_gvariant_determine_word_size(sizeof(struct bus_header) + ALIGN8(m->fields_size) + m->body… in bus_message_close_header()
2876 d = message_extend_body(m, 1, 1 + l + 2 + sz, false, true); in bus_message_close_header()
2885 …bus_gvariant_write_word_le((uint8_t*) d + 1 + l + 2, sz, sizeof(struct bus_header) + m->fields_siz… in bus_message_close_header()
2888 m->footer_accessible = 1 + l + 2 + sz; in bus_message_close_header()
2972 uint64_t sz; in sd_bus_message_seal() local
2980 sz = part->size; in sd_bus_message_seal()
2981 r = memfd_set_size(part->memfd, sz); in sd_bus_message_seal()
3064 static int buffer_peek(const void *p, uint32_t sz, size_t *rindex, size_t align, size_t nbytes, voi… in buffer_peek() argument
3073 if (end > sz) in buffer_peek()
3131 static struct bus_body_part* find_part(sd_bus_message *m, size_t index, size_t sz, void **p) { in find_part() argument
3150 if (index + sz <= begin + part->size) { in find_part()
3184 int sz; in container_next_item() local
3186 sz = bus_gvariant_get_size(c->signature); in container_next_item()
3187 if (sz == 0) in container_next_item()
3189 if (sz < 0) { in container_next_item()
3205 if (c->offset_index+1 >= (c->end-c->begin)/sz) in container_next_item()
3209 *rindex = c->begin + (c->offset_index+1) * sz; in container_next_item()
3210 c->item_size = sz; in container_next_item()
3403 int sz, align; in sd_bus_message_read_basic() local
3405 sz = bus_gvariant_get_size(CHAR_TO_STR(type)); in sd_bus_message_read_basic()
3406 assert(sz > 0); in sd_bus_message_read_basic()
3407 if ((size_t) sz != c->item_size) in sd_bus_message_read_basic()
3521 ssize_t sz, align; in sd_bus_message_read_basic() local
3526 sz = bus_type_get_size(type); in sd_bus_message_read_basic()
3527 assert(sz > 0); in sd_bus_message_read_basic()
3529 r = message_peek_body(m, &rindex, align, sz, &q); in sd_bus_message_read_basic()
3661 size_t where, previous = 0, framing, sz; in bus_message_enter_array() local
3666 sz = bus_gvariant_determine_word_size(c->item_size, 0); in bus_message_enter_array()
3668 where = rindex + c->item_size - sz; in bus_message_enter_array()
3669 r = message_peek_body(m, &where, 1, sz, &q); in bus_message_enter_array()
3673 framing = bus_gvariant_read_word_le(q, sz); in bus_message_enter_array()
3674 if (framing > c->item_size - sz) in bus_message_enter_array()
3676 if ((c->item_size - framing) % sz != 0) in bus_message_enter_array()
3679 *n_offsets = (c->item_size - framing) / sz; in bus_message_enter_array()
3682 r = message_peek_body(m, &where, 1, *n_offsets * sz, &q); in bus_message_enter_array()
3698 x = bus_gvariant_read_word_le((uint8_t*) q + i * sz, sz); in bus_message_enter_array()
3699 if (x > c->item_size - sz) in bus_message_enter_array()
3809 size_t sz; in build_struct_offsets() local
3833 sz = bus_gvariant_determine_word_size(size, 0); in build_struct_offsets()
3834 if (sz <= 0) in build_struct_offsets()
3868 if (size < n_variable * sz) in build_struct_offsets()
3871 where = m->rindex + size - (n_variable * sz); in build_struct_offsets()
3872 r = message_peek_body(m, &where, 1, n_variable * sz, &q); in build_struct_offsets()
3914 x = bus_gvariant_read_word_le((uint8_t*) q + v*sz, sz); in build_struct_offsets()
3920 x = size - (n_variable * sz); in build_struct_offsets()
4783 size_t sz; in sd_bus_message_read_array() local
4810 sz = c->end - c->begin; in sd_bus_message_read_array()
4816 sz = BUS_MESSAGE_BSWAP32(m, *c->array_size); in sd_bus_message_read_array()
4819 if (sz == 0) in sd_bus_message_read_array()
4824 r = message_peek_body(m, &m->rindex, align, sz, &p); in sd_bus_message_read_array()
4834 *size = sz; in sd_bus_message_read_array()
5157 size_t sz = 0; in bus_message_parse_fields() local
5166 sz = bus_gvariant_determine_word_size(BUS_MESSAGE_SIZE(m), 0); in bus_message_parse_fields()
5167 if (m->footer_accessible < 1 + sz) in bus_message_parse_fields()
5170 p = (char*) m->footer + m->footer_accessible - (1 + sz); in bus_message_parse_fields()
5184 l = (char*) m->footer + m->footer_accessible - p - (1 + sz); in bus_message_parse_fields()
5211 sz = bus_gvariant_determine_word_size(m->fields_size, 0); in bus_message_parse_fields()
5212 if (sz > 0) { in bus_message_parse_fields()
5216 if (m->fields_size < sz) in bus_message_parse_fields()
5219 ri = m->fields_size - sz; in bus_message_parse_fields()
5220 r = message_peek_fields(m, &ri, 1, sz, &q); in bus_message_parse_fields()
5224 framing = bus_gvariant_read_word_le(q, sz); in bus_message_parse_fields()
5225 if (framing >= m->fields_size - sz) in bus_message_parse_fields()
5227 if ((m->fields_size - framing) % sz != 0) in bus_message_parse_fields()
5235 n_offsets = (m->fields_size - framing) / sz; in bus_message_parse_fields()
5257 … ri = ALIGN_TO(bus_gvariant_read_word_le((uint8_t*) offsets + (i-1)*sz, sz), 8); in bus_message_parse_fields()
5279 end = bus_gvariant_read_word_le((uint8_t*) offsets + i*sz, sz); in bus_message_parse_fields()
5557 int bus_message_get_blob(sd_bus_message *m, void **buffer, size_t *sz) { in bus_message_get_blob() argument
5565 assert(sz); in bus_message_get_blob()
5580 *sz = total; in bus_message_get_blob()