- struct_class = g_new(struct type_class_struct, 1);
- type_class = &struct_class->p;
- struct_class->fields_by_name = g_hash_table_new(g_direct_hash,
- g_direct_equal);
- struct_class->fields = g_array_sized_new(FALSE, TRUE,
- sizeof(struct type_class_field),
- DEFAULT_NR_STRUCT_FIELDS);
- type_class->name = g_quark_from_string(name);
- type_class->alignment = 1;
- type_class->copy = struct_copy;
- type_class->class_free = _struct_type_class_free;
- type_class->type_new = _struct_type_new;
- type_class->type_free = _struct_type_free;
- type_class->ref = 1;
-
- if (type_class->name) {
- ret = register_type(type_class);
+ struct_type = g_new(struct type_struct, 1);
+ type = &struct_type->p;
+ struct_type->fields_by_name = g_hash_table_new(g_direct_hash,
+ g_direct_equal);
+ struct_type->fields = g_array_sized_new(FALSE, TRUE,
+ sizeof(struct type_field),
+ DEFAULT_NR_STRUCT_FIELDS);
+ type->name = g_quark_from_string(name);
+ type->alignment = 1;
+ type->copy = struct_copy;
+ type->type_free = _struct_type_free;
+ type->declaration_new = _struct_declaration_new;
+ type->declaration_free = _struct_declaration_free;
+ type->ref = 1;
+
+ if (type->name) {
+ ret = register_type(type);