Lines Matching refs:sz

44 static void *adjust_pointer(const void *p, void *old_base, size_t sz, void *new_base) {
55 if ((uint8_t*) p >= (uint8_t*) old_base + sz)
159 static void *message_extend_fields(sd_bus_message *m, size_t align, size_t sz, bool add_offset) {
170 new_size = start + sz;
551 size_t sz;
565 sz = length - sizeof(struct bus_header) - ALIGN8(m->fields_size);
566 if (sz > 0) {
569 m->body.size = sz;
1206 static void part_zero(struct bus_body_part *part, size_t sz) {
1208 assert(sz > 0);
1209 assert(sz < 8);
1215 part->size = sz;
1223 size_t sz,
1243 if (part->allocated == 0 || sz > part->allocated) {
1246 new_allocated = PAGE_ALIGN(sz > 0 ? 2 * sz : 1);
1256 if (!part->data || sz > part->mapped) {
1259 psz = PAGE_ALIGN(sz > 0 ? sz : 1);
1277 if (part->allocated == 0 || sz > part->allocated) {
1280 new_allocated = sz > 0 ? 2 * sz : 64;
1296 part->size = sz;
1340 size_t sz,
1356 end_body = start_body + sz;
1359 added = padding + sz;
1391 r = part_make_space(m, part, sz, &p);
1404 end_part = start_part + sz;
1471 ssize_t align, sz;
1516 sz = strlen(p) + 1;
1524 align = sz = 1;
1539 align = sz = 4;
1544 sz = bus_gvariant_get_size(CHAR_TO_STR(type));
1549 assert(sz > 0);
1551 a = message_extend_body(m, align, sz, true, false);
1555 memcpy(a, p, sz);
1577 sz = 4 + strlen(p) + 1;
1585 sz = 1 + strlen(p) + 1;
1593 align = sz = 4;
1608 align = sz = 4;
1613 sz = bus_type_get_size(type);
1618 assert(sz > 0);
1620 a = message_extend_body(m, align, sz, false, false);
1625 *(uint32_t*) a = sz - 5;
1626 memcpy((uint8_t*) a + 4, p, sz - 4);
1632 *(uint8_t*) a = sz - 2;
1633 memcpy((uint8_t*) a + 1, p, sz - 1);
1638 memcpy(a, p, sz);
2114 size_t payload, sz, i;
2120 sz = bus_gvariant_determine_word_size(payload, c->n_offsets);
2122 a = message_extend_body(m, 1, sz * c->n_offsets, true, false);
2127 bus_gvariant_write_word_le(a + sz*i, sz, c->offsets[i] - c->begin);
2237 size_t sz;
2242 sz = bus_gvariant_determine_word_size(m->body_size - c->begin, n_variable);
2244 a = message_extend_body(m, 1, sz * n_variable, add_offset, false);
2273 bus_gvariant_write_word_le(a + k * sz, sz, c->offsets[i] - c->begin);
2579 ssize_t align, sz;
2592 sz = bus_type_get_size(type);
2595 assert_se(sz > 0);
2597 if (size % sz != 0)
2685 ssize_t align, sz;
2715 sz = bus_type_get_size(type);
2718 assert_se(sz > 0);
2723 if (size % sz != 0)
2884 size_t sz, l;
2894 sz = bus_gvariant_determine_word_size(m->fields_size, m->n_header_offsets);
2895 a = message_extend_fields(m, 1, sz * m->n_header_offsets, false);
2900 bus_gvariant_write_word_le(a + sz*i, sz, m->header_offsets[i]);
2910 sz = bus_gvariant_determine_word_size(sizeof(struct bus_header) + ALIGN8(m->fields_size) + m->body_size + 1 + l + 2, 1);
2911 d = message_extend_body(m, 1, 1 + l + 2 + sz, false, true);
2920 bus_gvariant_write_word_le((uint8_t*) d + 1 + l + 2, sz, sizeof(struct bus_header) + m->fields_size);
2923 m->footer_accessible = 1 + l + 2 + sz;
3007 uint64_t sz;
3015 sz = part->size;
3016 r = memfd_set_size(part->memfd, sz);
3099 static int buffer_peek(const void *p, uint32_t sz, size_t *rindex, size_t align, size_t nbytes, void **r) {
3108 if (end > sz)
3166 static struct bus_body_part* find_part(sd_bus_message *m, size_t index, size_t sz, void **p) {
3185 if (index + sz <= begin + part->size) {
3218 int sz;
3220 sz = bus_gvariant_get_size(c->signature);
3221 if (sz < 0) {
3236 if (c->offset_index+1 >= (c->end-c->begin)/sz)
3240 *rindex = c->begin + (c->offset_index+1) * sz;
3241 c->item_size = sz;
3430 int sz, align;
3432 sz = bus_gvariant_get_size(CHAR_TO_STR(type));
3433 assert(sz > 0);
3434 if ((size_t) sz != c->item_size)
3540 ssize_t sz, align;
3545 sz = bus_type_get_size(type);
3546 assert(sz > 0);
3548 r = message_peek_body(m, &rindex, align, sz, &q);
3679 size_t where, p = 0, framing, sz;
3683 sz = bus_gvariant_determine_word_size(c->item_size, 0);
3685 where = rindex + c->item_size - sz;
3686 r = message_peek_body(m, &where, 1, sz, &q);
3690 framing = bus_gvariant_read_word_le(q, sz);
3691 if (framing > c->item_size - sz)
3693 if ((c->item_size - framing) % sz != 0)
3696 *n_offsets = (c->item_size - framing) / sz;
3699 r = message_peek_body(m, &where, 1, *n_offsets * sz, &q);
3710 x = bus_gvariant_read_word_le((uint8_t*) q + i * sz, sz);
3711 if (x > c->item_size - sz)
3817 size_t sz;
3841 sz = bus_gvariant_determine_word_size(size, 0);
3842 if (sz <= 0)
3876 if (size < n_variable * sz)
3879 where = m->rindex + size - (n_variable * sz);
3880 r = message_peek_body(m, &where, 1, n_variable * sz, &q);
3915 x = bus_gvariant_read_word_le((uint8_t*) q + v*sz, sz);
3925 x = size - (n_variable * sz);
4804 size_t sz;
4826 sz = c->end - c->begin;
4832 sz = BUS_MESSAGE_BSWAP32(m, *c->array_size);
4835 if (sz == 0)
4840 r = message_peek_body(m, &m->rindex, align, sz, &p);
4850 *size = sz;
5166 size_t sz = 0;
5175 sz = bus_gvariant_determine_word_size(BUS_MESSAGE_SIZE(m), 0);
5176 if (m->footer_accessible < 1 + sz)
5179 p = (char*) m->footer + m->footer_accessible - (1 + sz);
5193 l = ((char*) m->footer + m->footer_accessible) - p - (1 + sz);
5217 sz = bus_gvariant_determine_word_size(m->fields_size, 0);
5218 if (sz > 0) {
5222 ri = m->fields_size - sz;
5223 r = message_peek_fields(m, &ri, 1, sz, &q);
5227 framing = bus_gvariant_read_word_le(q, sz);
5228 if (framing >= m->fields_size - sz)
5230 if ((m->fields_size - framing) % sz != 0)
5238 n_offsets = (m->fields_size - framing) / sz;
5259 ri = ALIGN_TO(bus_gvariant_read_word_le((uint8_t*) offsets + (i-1)*sz, sz), 8);
5281 end = bus_gvariant_read_word_le((uint8_t*) offsets + i*sz, sz);
5548 int bus_message_get_blob(sd_bus_message *m, void **buffer, size_t *sz) {
5556 assert(sz);
5571 *sz = total;