Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- <strong>Name</strong>: none. You can set a name
with bt_ctf_trace_set_name().
- <strong>Default byte order</strong>: #BT_CTF_BYTE_ORDER_NATIVE. You
- <strong>Name</strong>: none. You can set a name
with bt_ctf_trace_set_name().
- <strong>Default byte order</strong>: #BT_CTF_BYTE_ORDER_NATIVE. You
- can set a default byte order with bt_ctf_trace_set_byte_order().
+ can set a default byte order with bt_ctf_trace_set_native_byte_order().
Note that you \em must set the default byte order if any field type
contained in the created trace class, in its stream classes, or in
Note that you \em must set the default byte order if any field type
contained in the created trace class, in its stream classes, or in
/**
@brief Sets the default byte order of the CTF IR trace class
/**
@brief Sets the default byte order of the CTF IR trace class
- \p trace_class to \p name.
+ \p trace_class to \p native_byte_order.
-\p byte_order \em must be one of:
+\p native_byte_order \em must be one of:
- #BT_CTF_BYTE_ORDER_LITTLE_ENDIAN
- #BT_CTF_BYTE_ORDER_BIG_ENDIAN
- #BT_CTF_BYTE_ORDER_NETWORK
- #BT_CTF_BYTE_ORDER_LITTLE_ENDIAN
- #BT_CTF_BYTE_ORDER_BIG_ENDIAN
- #BT_CTF_BYTE_ORDER_NETWORK
-@param[in] trace_class Trace class of which to set the default byte
- order.
-@param[in] byte_order Default byte order of the trace class.
-@returns 0 on success, or a negative value on error.
+@param[in] trace_class Trace class of which to set the default byte
+ order.
+@param[in] native_byte_order Default byte order of the trace class.
+@returns 0 on success, or a negative value on error.
@prenotnull{trace_class}
@prenotnull{name}
@prehot{trace_class}
@prenotnull{trace_class}
@prenotnull{name}
@prehot{trace_class}
-@pre \p byte_order is either #BT_CTF_BYTE_ORDER_LITTLE_ENDIAN,
+@pre \p native_byte_order is either #BT_CTF_BYTE_ORDER_LITTLE_ENDIAN,
#BT_CTF_BYTE_ORDER_BIG_ENDIAN, or
#BT_CTF_BYTE_ORDER_NETWORK.
@postrefcountsame{trace_class}
@sa bt_ctf_trace_get_name(): Returns the name of a given trace class.
*/
#BT_CTF_BYTE_ORDER_BIG_ENDIAN, or
#BT_CTF_BYTE_ORDER_NETWORK.
@postrefcountsame{trace_class}
@sa bt_ctf_trace_get_name(): Returns the name of a given trace class.
*/
-extern int bt_ctf_trace_set_byte_order(struct bt_ctf_trace *trace_class,
- enum bt_ctf_byte_order byte_order);
+extern int bt_ctf_trace_set_native_byte_order(struct bt_ctf_trace *trace_class,
+ enum bt_ctf_byte_order native_byte_order);
/**
@brief Returns the number of entries contained in the environment of
/**
@brief Returns the number of entries contained in the environment of
- bt_ctf_trace_set_byte_order(trace, BT_CTF_BYTE_ORDER_NATIVE);
+ trace->native_byte_order = BT_CTF_BYTE_ORDER_NATIVE;
bt_object_init(trace, bt_ctf_trace_destroy);
trace->clocks = g_ptr_array_new_with_free_func(
(GDestroyNotify) bt_put);
bt_object_init(trace, bt_ctf_trace_destroy);
trace->clocks = g_ptr_array_new_with_free_func(
(GDestroyNotify) bt_put);
-int bt_ctf_trace_set_byte_order(struct bt_ctf_trace *trace,
+int bt_ctf_trace_set_native_byte_order(struct bt_ctf_trace *trace,
enum bt_ctf_byte_order byte_order)
{
int ret = 0;
enum bt_ctf_byte_order byte_order)
{
int ret = 0;
- ret = bt_ctf_trace_set_byte_order(writer->trace,
+ ret = bt_ctf_trace_set_native_byte_order(writer->trace,
byte_order);
end:
return ret;
byte_order);
end:
return ret;
- ret = bt_ctf_trace_set_byte_order(
+ ret = bt_ctf_trace_set_native_byte_order(
ctx->trace, bo);
if (ret) {
_PERROR("cannot set trace's byte order (%d)",
ctx->trace, bo);
if (ret) {
_PERROR("cannot set trace's byte order (%d)",
/* Create non-writer trace, stream class, stream, and clock */
non_writer_trace = bt_ctf_trace_create();
assert(non_writer_trace);
/* Create non-writer trace, stream class, stream, and clock */
non_writer_trace = bt_ctf_trace_create();
assert(non_writer_trace);
- ret = bt_ctf_trace_set_byte_order(non_writer_trace,
+ ret = bt_ctf_trace_set_native_byte_order(non_writer_trace,
BT_CTF_BYTE_ORDER_LITTLE_ENDIAN);
assert(!ret);
non_writer_sc = bt_ctf_stream_class_create("nonwriter_sc");
BT_CTF_BYTE_ORDER_LITTLE_ENDIAN);
assert(!ret);
non_writer_sc = bt_ctf_stream_class_create("nonwriter_sc");
trace = bt_ctf_writer_get_trace(writer);
ok(trace,
"bt_ctf_writer_get_trace returns a bt_ctf_trace object");
trace = bt_ctf_writer_get_trace(writer);
ok(trace,
"bt_ctf_writer_get_trace returns a bt_ctf_trace object");
- ok(bt_ctf_trace_set_byte_order(trace, BT_CTF_BYTE_ORDER_BIG_ENDIAN) == 0,
+ ok(bt_ctf_trace_set_native_byte_order(trace, BT_CTF_BYTE_ORDER_BIG_ENDIAN) == 0,
"Set a trace's byte order to big endian");
ok(bt_ctf_trace_get_byte_order(trace) == BT_CTF_BYTE_ORDER_BIG_ENDIAN,
"bt_ctf_trace_get_byte_order returns a correct endianness");
"Set a trace's byte order to big endian");
ok(bt_ctf_trace_get_byte_order(trace) == BT_CTF_BYTE_ORDER_BIG_ENDIAN,
"bt_ctf_trace_get_byte_order returns a correct endianness");