Revision 049cb3cf
b/qom/object.c | ||
---|---|---|
95 | 95 |
return g_hash_table_lookup(type_table_get(), name); |
96 | 96 |
} |
97 | 97 |
|
98 |
TypeImpl *type_register(const TypeInfo *info)
|
|
98 |
static TypeImpl *type_register_internal(const TypeInfo *info)
|
|
99 | 99 |
{ |
100 | 100 |
TypeImpl *ti = g_malloc0(sizeof(*ti)); |
101 | 101 |
|
... | ... | |
137 | 137 |
return ti; |
138 | 138 |
} |
139 | 139 |
|
140 |
TypeImpl *type_register(const TypeInfo *info) |
|
141 |
{ |
|
142 |
assert(info->parent); |
|
143 |
return type_register_internal(info); |
|
144 |
} |
|
145 |
|
|
140 | 146 |
TypeImpl *type_register_static(const TypeInfo *info) |
141 | 147 |
{ |
142 | 148 |
return type_register(info); |
... | ... | |
204 | 210 |
char *name = g_strdup_printf("<%s::%s>", ti->name, iface->parent); |
205 | 211 |
|
206 | 212 |
info.name = name; |
207 |
iface->type = type_register(&info); |
|
213 |
iface->type = type_register_internal(&info);
|
|
208 | 214 |
g_free(name); |
209 | 215 |
} |
210 | 216 |
|
... | ... | |
1239 | 1245 |
.abstract = true, |
1240 | 1246 |
}; |
1241 | 1247 |
|
1242 |
type_interface = type_register_static(&interface_info);
|
|
1243 |
type_register_static(&object_info);
|
|
1248 |
type_interface = type_register_internal(&interface_info);
|
|
1249 |
type_register_internal(&object_info);
|
|
1244 | 1250 |
} |
1245 | 1251 |
|
1246 | 1252 |
type_init(register_types) |
Also available in: Unified diff