#include <babeltrace/ctf-writer/trace-internal.h>
#include <babeltrace/ctf-writer/writer-internal.h>
#include <babeltrace/endian-internal.h>
-#include <babeltrace/ref.h>
+#include <babeltrace/ctf-writer/object.h>
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <unistd.h>
static
-void bt_ctf_writer_destroy(struct bt_object *obj);
+void bt_ctf_writer_destroy(struct bt_ctf_object *obj);
static
int init_trace_packet_header(struct bt_ctf_trace *trace)
goto end;
}
end:
- bt_put(uuid_array_type);
- bt_put(_uint32_t);
- bt_put(_uint8_t);
- bt_put(trace_packet_header_type);
+ bt_ctf_object_put_ref(uuid_array_type);
+ bt_ctf_object_put_ref(_uint32_t);
+ bt_ctf_object_put_ref(_uint8_t);
+ bt_ctf_object_put_ref(trace_packet_header_type);
return ret;
}
metadata_path = g_build_filename(path, "metadata", NULL);
- bt_object_init_shared(&writer->base, bt_ctf_writer_destroy);
+ bt_ctf_object_init_shared(&writer->base, bt_ctf_writer_destroy);
writer->path = g_string_new(path);
if (!writer->path) {
goto error_destroy;
goto error_destroy;
}
- bt_object_set_parent(&writer->trace->common.base, &writer->base);
- bt_put(writer->trace);
+ bt_ctf_object_set_parent(&writer->trace->common.base, &writer->base);
+ bt_ctf_object_put_ref(writer->trace);
/* Default to little-endian */
ret = bt_ctf_writer_set_byte_order(writer, BT_CTF_BYTE_ORDER_NATIVE);
return writer;
error_destroy:
- BT_PUT(writer);
+ BT_CTF_OBJECT_PUT_REF_AND_RESET(writer);
error:
g_free(metadata_path);
return writer;
}
-void bt_ctf_writer_destroy(struct bt_object *obj)
+void bt_ctf_writer_destroy(struct bt_ctf_object *obj)
{
struct bt_ctf_writer *writer;
}
}
- bt_object_try_spec_release(&writer->trace->common.base);
+ bt_ctf_object_try_spec_release(&writer->trace->common.base);
g_free(writer);
}
}
trace = writer->trace;
- bt_get(trace);
+ bt_ctf_object_get_ref(trace);
end:
return trace;
}
stream_class_found = BT_TRUE;
}
- BT_PUT(existing_stream_class);
+ BT_CTF_OBJECT_PUT_REF_AND_RESET(existing_stream_class);
if (stream_class_found) {
break;
return stream;
error:
- BT_PUT(stream);
+ BT_CTF_OBJECT_PUT_REF_AND_RESET(stream);
return stream;
}
}
if (byte_order == BT_CTF_BYTE_ORDER_NATIVE) {
- byte_order = (int) BT_MY_BYTE_ORDER;
+ byte_order = BT_CTF_MY_BYTE_ORDER;
}
ret = bt_ctf_trace_set_native_byte_order(writer->trace,
field_type = bt_ctf_field_type_integer_create(size);
ret = bt_ctf_field_type_set_alignment(field_type, alignment);
if (ret) {
- BT_PUT(field_type);
+ BT_CTF_OBJECT_PUT_REF_AND_RESET(field_type);
}
end:
return field_type;