- g_free(field);
-}
-
-BT_HIDDEN
-void bt_field_destroy_recursive(struct bt_field *field)
-{
- if (!field) {
- return;
- }
-
- BT_ASSERT(bt_field_type_has_known_id((void *) field->type));
- field_destroy_funcs[field->type->id](field);
-}
-
-static inline
-void bt_field_initialize(struct bt_field *field,
- struct bt_field_type *ft,
- struct bt_field_methods *methods)
-{
- BT_ASSERT(field);
- BT_ASSERT(ft);
- bt_object_init_unique(&field->base);
- field->methods = methods;
- field->type = bt_get(ft);
-}
-
-static
-struct bt_field *bt_field_integer_create(struct bt_field_type *type)
-{
- struct bt_field_integer *integer =
- g_new0(struct bt_field_integer, 1);
-
- BT_LOGD("Creating integer field object: ft-addr=%p", type);
-
- if (integer) {
- bt_field_initialize((void *) integer, (void *) type,
- &bt_field_integer_methods);
- BT_LOGD("Created integer field object: addr=%p, ft-addr=%p",
- integer, type);
- } else {
- BT_LOGE_STR("Failed to allocate one integer field.");
- }
-
- return (void *) integer;
-}
-
-static
-struct bt_field *bt_field_enumeration_create(struct bt_field_type *type)
-{
- struct bt_field_enumeration *enumeration = g_new0(
- struct bt_field_enumeration, 1);
-
- BT_LOGD("Creating enumeration field object: ft-addr=%p", type);
-
- if (enumeration) {
- bt_field_initialize((void *) enumeration,
- (void *) type, &bt_field_enumeration_methods);
- BT_LOGD("Created enumeration field object: addr=%p, ft-addr=%p",
- enumeration, type);
- } else {
- BT_LOGE_STR("Failed to allocate one enumeration field.");
- }
-
- return (void *) enumeration;
-}