self.c_need_sizeof = True
field.c_iterator_type = _t(field.field_type + ('iterator',)) # xcb_fieldtype_iterator_t
self.c_need_sizeof = True
field.c_iterator_type = _t(field.field_type + ('iterator',)) # xcb_fieldtype_iterator_t
# no list with switch as element, so no call to
# _c_iterator(field.type, field_name) necessary
# no list with switch as element, so no call to
# _c_iterator(field.type, field_name) necessary
if self.c_need_serialize:
if self.c_serialize_name not in finished_serializers:
finished_serializers.append(self.c_serialize_name)
if self.c_need_serialize:
if self.c_serialize_name not in finished_serializers:
finished_serializers.append(self.c_serialize_name)
all_fields[f.field_name] = (fname, f)
if f.type.is_container and flat==False:
all_fields[f.field_name] = (fname, f)
if f.type.is_container and flat==False:
tmp_prefix.append((name, sep, obj))
all_fields.update(_c_helper_field_mapping(obj, tmp_prefix, flat=True))
tmp_prefix.append((name, sep, obj))
all_fields.update(_c_helper_field_mapping(obj, tmp_prefix, flat=True))
for n, expr in enumerate(b.type.expr):
bitcase_expr = _c_accessor_get_expr(expr, None)
# only one <enumref> in the <bitcase>
if len_expr == 1:
for n, expr in enumerate(b.type.expr):
bitcase_expr = _c_accessor_get_expr(expr, None)
# only one <enumref> in the <bitcase>
if len_expr == 1:
code_lines.append('%s /* %s.%s */' % (space, self.c_type, field.c_field_name))
else:
scoped_name = [p[2].c_type if idx==0 else p[0] for idx, p in enumerate(prefix)]
code_lines.append('%s /* %s.%s */' % (space, self.c_type, field.c_field_name))
else:
scoped_name = [p[2].c_type if idx==0 else p[0] for idx, p in enumerate(prefix)]
if prev_field_was_variable and need_padding:
# insert padding
# count += _c_serialize_helper_insert_padding(context, code_lines, space,
if prev_field_was_variable and need_padding:
# insert padding
# count += _c_serialize_helper_insert_padding(context, code_lines, space,
count += _c_serialize_helper_insert_padding(context, code_lines, space,
self.c_var_followed_by_fixed_fields)
count += _c_serialize_helper_insert_padding(context, code_lines, space,
self.c_var_followed_by_fixed_fields)
code_lines.append('%s%s' % (space, value))
if field.type.fixed_size():
code_lines.append('%s%s' % (space, value))
if field.type.fixed_size():
# keep track of (un)serialized object's size
code_lines.append('%s xcb_block_len += %s;' % (space, length))
if context in ('unserialize', 'unpack', 'sizeof'):
# keep track of (un)serialized object's size
code_lines.append('%s xcb_block_len += %s;' % (space, length))
if context in ('unserialize', 'unpack', 'sizeof'):
switch_obj = self.parents[-1]
if switch_obj is not None:
c_type = switch_obj.c_type
switch_obj = self.parents[-1]
if switch_obj is not None:
c_type = switch_obj.c_type
# the reason is that switch is either a child of a request/reply or nested in another switch,
# so whenever we need to access a length field, we might need to refer to some anchestor type
switch_obj = self if self.is_switch else None
# the reason is that switch is either a child of a request/reply or nested in another switch,
# so whenever we need to access a length field, we might need to refer to some anchestor type
switch_obj = self if self.is_switch else None
switch_obj = self.parents[-1]
if switch_obj is not None:
c_type = switch_obj.c_type
switch_obj = self.parents[-1]
if switch_obj is not None:
c_type = switch_obj.c_type
for p in parents[2:] + [self]:
# the separator between parent and child is always '.' here,
# because of nested switch statements
for p in parents[2:] + [self]:
# the separator between parent and child is always '.' here,
# because of nested switch statements
prefix.append((p.name[-1], '.', p))
fields.update(_c_helper_field_mapping(p, prefix, flat=True))
prefix.append((p.name[-1], '.', p))
fields.update(_c_helper_field_mapping(p, prefix, flat=True))
switch_obj = self.parents[-1]
if switch_obj is not None:
c_type = switch_obj.c_type
switch_obj = self.parents[-1]
if switch_obj is not None:
c_type = switch_obj.c_type
# the reason is that switch is either a child of a request/reply or nested in another switch,
# so whenever we need to access a length field, we might need to refer to some anchestor type
switch_obj = self if self.is_switch else None
# the reason is that switch is either a child of a request/reply or nested in another switch,
# so whenever we need to access a length field, we might need to refer to some anchestor type
switch_obj = self if self.is_switch else None
switch_obj = self.parents[-1]
if switch_obj is not None:
c_type = switch_obj.c_type
switch_obj = self.parents[-1]
if switch_obj is not None:
c_type = switch_obj.c_type
for p in parents[2:] + [self]:
# the separator between parent and child is always '.' here,
# because of nested switch statements
for p in parents[2:] + [self]:
# the separator between parent and child is always '.' here,
# because of nested switch statements
prefix.append((p.name[-1], '.', p))
fields.update(_c_helper_field_mapping(p, prefix, flat=True))
prefix.append((p.name[-1], '.', p))
fields.update(_c_helper_field_mapping(p, prefix, flat=True))