#define BT_LOG_TAG "CTF-WRITER"
#include <babeltrace/lib-logging-internal.h>
+#include <babeltrace/assert-internal.h>
+#include <babeltrace/compat/uuid-internal.h>
+#include <babeltrace/compiler-internal.h>
#include <babeltrace/ctf-writer/clock-internal.h>
#include <babeltrace/ctf-writer/field-types-internal.h>
#include <babeltrace/ctf-writer/fields-internal.h>
#include <babeltrace/ctf-writer/stream-internal.h>
#include <babeltrace/ctf-writer/trace-internal.h>
#include <babeltrace/ctf-writer/writer-internal.h>
-#include <babeltrace/ref.h>
#include <babeltrace/endian-internal.h>
-#include <babeltrace/compiler-internal.h>
-#include <babeltrace/compat/uuid-internal.h>
-#include <babeltrace/assert-internal.h>
+#include <babeltrace/ref.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
-#include <errno.h>
#include <unistd.h>
-#include <fcntl.h>
-#include <inttypes.h>
static
void bt_ctf_writer_destroy(struct bt_object *obj);
metadata_path = g_build_filename(path, "metadata", NULL);
- bt_object_init(writer, bt_ctf_writer_destroy);
+ bt_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, writer);
+ bt_object_set_parent(&writer->trace->common.base, &writer->base);
bt_put(writer->trace);
/* Default to little-endian */
}
}
- bt_object_release(writer->trace);
+ bt_object_try_spec_release(&writer->trace->common.base);
g_free(writer);
}
}
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,
}
BT_HIDDEN
-const char *get_byte_order_string(enum bt_byte_order byte_order)
+const char *bt_ctf_get_byte_order_string(enum bt_ctf_byte_order byte_order)
{
const char *string;
switch (byte_order) {
- case BT_BYTE_ORDER_LITTLE_ENDIAN:
+ case BT_CTF_BYTE_ORDER_LITTLE_ENDIAN:
string = "le";
break;
- case BT_BYTE_ORDER_BIG_ENDIAN:
+ case BT_CTF_BYTE_ORDER_BIG_ENDIAN:
string = "be";
break;
- case BT_BYTE_ORDER_NATIVE:
+ case BT_CTF_BYTE_ORDER_NATIVE:
string = "native";
break;
default: