static
struct definition *_struct_definition_new(struct declaration *declaration,
- struct definition_scope *parent_scope);
+ struct definition_scope *parent_scope,
+ GQuark field_name, int index);
static
void _struct_definition_free(struct definition *definition);
static
struct definition *
_struct_definition_new(struct declaration *declaration,
- struct definition_scope *parent_scope)
+ struct definition_scope *parent_scope,
+ GQuark field_name, int index)
{
struct declaration_struct *struct_declaration =
container_of(declaration, struct declaration_struct, p);
_struct->p.declaration = declaration;
_struct->declaration = struct_declaration;
_struct->p.ref = 1;
- _struct->scope = new_definition_scope(parent_scope);
+ _struct->p.index = index;
+ _struct->scope = new_definition_scope(parent_scope, field_name);
_struct->fields = g_array_sized_new(FALSE, TRUE,
sizeof(struct field),
DEFAULT_NR_STRUCT_FIELDS);
field->name = declaration_field->name;
field->definition =
declaration_field->declaration->definition_new(declaration_field->declaration,
- _struct->scope);
+ _struct->scope,
+ field->name, i);
ret = register_field_definition(field->name,
field->definition,
_struct->scope);