Fix: Variable name typo in SequenceField and Event classes

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Add fallback for betoh/htobe if they do not exist

For older systems endian.h may not contain the betoh/htobe macros.
If they are missing, add them and make sure that any user of
htobe/betoh uses the compat/endian.h

Signed-off-by: Jesper Derehag <jderehag@hotmail.com>
Tested-by: Jesper Derehag <jderehag@hotmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: Align buffers from objstack_alloc on sizeof(void *)

The buffers from objstack_alloc will store pointers, so they must
be aligned on a pointer's size, or else it will cause issues on the
CPUs which do not support unaligned addresses access.

Signed-off-by: Fredrik Markstrom <fredrik.markstrom@gmail.com>
Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: Report the sequence's length field's value as length

bt_ctf_get_field_list currently returns the underlying array's
size which is always the highest element count encountered to
date.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: don't use a return code in _bt_ctf_stream_append_discarded_events

That function is defined as void:
| File "/usr/lib/python3/dist-packages/babeltrace.py", line 2284, in
| append_discarded_events
| if ret < 0:
| TypeError: unorderable types: NoneType() < int()

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Split ctf-writer's stream.h into stream.h and stream-class.h

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Split the CTF-Writer API into IR and Writer-specific parts

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Split the CTF-Writer implementation in IR and Writer parts

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Implement CTF-IR Clock getters

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Tests: Test CTF-IR Clock's getters

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Add Python bindings for CTF-IR clock's getters

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Add bt_ctf_field_type_enumeration private search functions

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Fix: Check that enumeration container types are integers

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Implement CTF-IR event fields getters

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Docs: CTF-IR sequence's length field must be unsigned

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Tests: Test CTF-IR event-field's getters

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Update CTF-Writer and CTF-IR copyrights

Changed the copyrights to stay remain in line with our usual
politic of authors retaining their copyright on the code they
contribute.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Add Python bindings for CTF-IR event-field getters

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Clean-up: Remove unecessary line break

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Implement CTF-IR field types getters

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>