Move `include/babeltrace2/ctf-writer` -> `include/babeltrace2-ctf-writer`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 10 Jul 2019 06:05:42 +0000 (02:05 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 10 Jul 2019 15:25:15 +0000 (11:25 -0400)
CTF writer is not part of the Babeltrace library.

With this patch, `include/babeltrace2` contains only the Babeltrace
library public headers, and `include/babeltrace2-ctf-writer` contains
only the Babeltrace CTF writer library public headers.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I605ef01e1afbf0188f1ba5b094aed48717d46aff
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1675
Tested-by: jenkins <jenkins@lttng.org>
68 files changed:
include/Makefile.am
include/babeltrace2-ctf-writer/clock-class.h [new file with mode: 0644]
include/babeltrace2-ctf-writer/clock.h [new file with mode: 0644]
include/babeltrace2-ctf-writer/event-fields.h [new file with mode: 0644]
include/babeltrace2-ctf-writer/event-types.h [new file with mode: 0644]
include/babeltrace2-ctf-writer/event.h [new file with mode: 0644]
include/babeltrace2-ctf-writer/field-types.h [new file with mode: 0644]
include/babeltrace2-ctf-writer/fields.h [new file with mode: 0644]
include/babeltrace2-ctf-writer/object.h [new file with mode: 0644]
include/babeltrace2-ctf-writer/stream-class.h [new file with mode: 0644]
include/babeltrace2-ctf-writer/stream.h [new file with mode: 0644]
include/babeltrace2-ctf-writer/trace.h [new file with mode: 0644]
include/babeltrace2-ctf-writer/types.h [new file with mode: 0644]
include/babeltrace2-ctf-writer/utils.h [new file with mode: 0644]
include/babeltrace2-ctf-writer/visitor.h [new file with mode: 0644]
include/babeltrace2-ctf-writer/writer.h [new file with mode: 0644]
include/babeltrace2/ctf-writer/clock-class.h [deleted file]
include/babeltrace2/ctf-writer/clock.h [deleted file]
include/babeltrace2/ctf-writer/event-fields.h [deleted file]
include/babeltrace2/ctf-writer/event-types.h [deleted file]
include/babeltrace2/ctf-writer/event.h [deleted file]
include/babeltrace2/ctf-writer/field-types.h [deleted file]
include/babeltrace2/ctf-writer/fields.h [deleted file]
include/babeltrace2/ctf-writer/object.h [deleted file]
include/babeltrace2/ctf-writer/stream-class.h [deleted file]
include/babeltrace2/ctf-writer/stream.h [deleted file]
include/babeltrace2/ctf-writer/trace.h [deleted file]
include/babeltrace2/ctf-writer/types.h [deleted file]
include/babeltrace2/ctf-writer/utils.h [deleted file]
include/babeltrace2/ctf-writer/visitor.h [deleted file]
include/babeltrace2/ctf-writer/writer.h [deleted file]
src/ctf-writer/attributes.c
src/ctf-writer/clock-class.c
src/ctf-writer/clock-class.h
src/ctf-writer/clock.c
src/ctf-writer/clock.h
src/ctf-writer/event-class.c
src/ctf-writer/event-class.h
src/ctf-writer/event.c
src/ctf-writer/event.h
src/ctf-writer/field-path.c
src/ctf-writer/field-path.h
src/ctf-writer/field-types.c
src/ctf-writer/field-types.h
src/ctf-writer/fields.c
src/ctf-writer/fields.h
src/ctf-writer/resolve.c
src/ctf-writer/resolve.h
src/ctf-writer/stream-class.c
src/ctf-writer/stream-class.h
src/ctf-writer/stream.c
src/ctf-writer/stream.h
src/ctf-writer/trace.c
src/ctf-writer/trace.h
src/ctf-writer/utils.c
src/ctf-writer/utils.h
src/ctf-writer/validation.c
src/ctf-writer/values.c
src/ctf-writer/values.h
src/ctf-writer/visitor.c
src/ctf-writer/visitor.h
src/ctf-writer/writer.c
src/ctf-writer/writer.h
tests/ctf-writer/ctf_writer.c
tests/lib/test_trace_ir_ref.c
tests/plugins/sink.ctf.fs/succeed/gen-trace-double.c
tests/plugins/sink.ctf.fs/succeed/gen-trace-float.c
tests/plugins/src.ctf.fs/succeed/gen-trace-simple.c

index 339ccc2217d5567eda383581d4bc7d2a0c5f95df..8063039fab3f03646128979a8561202e06c8a65a 100644 (file)
@@ -15,23 +15,23 @@ babeltrace2include_HEADERS = \
        babeltrace2/version.h
 
 # CTF writer API
-babeltrace2ctfwriterincludedir = "$(includedir)/babeltrace2/ctf-writer"
+babeltrace2ctfwriterincludedir = "$(includedir)/babeltrace2-ctf-writer"
 babeltrace2ctfwriterinclude_HEADERS = \
-       babeltrace2/ctf-writer/clock-class.h \
-       babeltrace2/ctf-writer/clock.h \
-       babeltrace2/ctf-writer/event-fields.h \
-       babeltrace2/ctf-writer/event-types.h \
-       babeltrace2/ctf-writer/event.h \
-       babeltrace2/ctf-writer/field-types.h \
-       babeltrace2/ctf-writer/fields.h \
-       babeltrace2/ctf-writer/object.h \
-       babeltrace2/ctf-writer/stream-class.h \
-       babeltrace2/ctf-writer/stream.h \
-       babeltrace2/ctf-writer/trace.h \
-       babeltrace2/ctf-writer/types.h \
-       babeltrace2/ctf-writer/utils.h \
-       babeltrace2/ctf-writer/visitor.h \
-       babeltrace2/ctf-writer/writer.h
+       babeltrace2-ctf-writer/clock-class.h \
+       babeltrace2-ctf-writer/clock.h \
+       babeltrace2-ctf-writer/event-fields.h \
+       babeltrace2-ctf-writer/event-types.h \
+       babeltrace2-ctf-writer/event.h \
+       babeltrace2-ctf-writer/field-types.h \
+       babeltrace2-ctf-writer/fields.h \
+       babeltrace2-ctf-writer/object.h \
+       babeltrace2-ctf-writer/stream-class.h \
+       babeltrace2-ctf-writer/stream.h \
+       babeltrace2-ctf-writer/trace.h \
+       babeltrace2-ctf-writer/types.h \
+       babeltrace2-ctf-writer/utils.h \
+       babeltrace2-ctf-writer/visitor.h \
+       babeltrace2-ctf-writer/writer.h
 
 # Trace IR API
 babeltrace2traceirincludedir = "$(includedir)/babeltrace2/trace-ir"
diff --git a/include/babeltrace2-ctf-writer/clock-class.h b/include/babeltrace2-ctf-writer/clock-class.h
new file mode 100644 (file)
index 0000000..c73f7e9
--- /dev/null
@@ -0,0 +1,89 @@
+#ifndef BABELTRACE2_CTF_WRITER_CLOCK_CLASS_H
+#define BABELTRACE2_CTF_WRITER_CLOCK_CLASS_H
+
+/*
+ * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_ctf_clock_class;
+
+extern struct bt_ctf_clock_class *bt_ctf_clock_class_create(const char *name,
+                uint64_t freq);
+
+extern const char *bt_ctf_clock_class_get_name(
+                struct bt_ctf_clock_class *clock_class);
+
+extern int bt_ctf_clock_class_set_name(struct bt_ctf_clock_class *clock_class,
+                const char *name);
+
+extern const char *bt_ctf_clock_class_get_description(
+                struct bt_ctf_clock_class *clock_class);
+
+extern int bt_ctf_clock_class_set_description(
+                struct bt_ctf_clock_class *clock_class,
+                const char *desc);
+
+extern uint64_t bt_ctf_clock_class_get_frequency(
+                struct bt_ctf_clock_class *clock_class);
+
+extern int bt_ctf_clock_class_set_frequency(
+                struct bt_ctf_clock_class *clock_class, uint64_t freq);
+
+extern uint64_t bt_ctf_clock_class_get_precision(
+                struct bt_ctf_clock_class *clock_class);
+
+extern int bt_ctf_clock_class_set_precision(
+                struct bt_ctf_clock_class *clock_class, uint64_t precision);
+
+extern int bt_ctf_clock_class_get_offset_s(
+                struct bt_ctf_clock_class *clock_class, int64_t *seconds);
+
+extern int bt_ctf_clock_class_set_offset_s(
+                struct bt_ctf_clock_class *clock_class, int64_t seconds);
+
+extern int bt_ctf_clock_class_get_offset_cycles(
+                struct bt_ctf_clock_class *clock_class, int64_t *cycles);
+
+extern int bt_ctf_clock_class_set_offset_cycles(
+                struct bt_ctf_clock_class *clock_class, int64_t cycles);
+
+extern bt_ctf_bool bt_ctf_clock_class_is_absolute(
+                struct bt_ctf_clock_class *clock_class);
+
+extern int bt_ctf_clock_class_set_is_absolute(
+                struct bt_ctf_clock_class *clock_class, bt_ctf_bool is_absolute);
+
+extern const uint8_t *bt_ctf_clock_class_get_uuid(
+                struct bt_ctf_clock_class *clock_class);
+
+extern int bt_ctf_clock_class_set_uuid(struct bt_ctf_clock_class *clock_class,
+                const uint8_t *uuid);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE2_CTF_WRITER_CLOCK_CLASS_H */
diff --git a/include/babeltrace2-ctf-writer/clock.h b/include/babeltrace2-ctf-writer/clock.h
new file mode 100644 (file)
index 0000000..2417093
--- /dev/null
@@ -0,0 +1,282 @@
+#ifndef BABELTRACE2_CTF_WRITER_CLOCK_H
+#define BABELTRACE2_CTF_WRITER_CLOCK_H
+
+/*
+ * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stdint.h>
+#include <babeltrace2-ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_ctf_clock;
+struct bt_ctf_clock_class;
+
+/*
+ * bt_ctf_clock_create: create a clock.
+ *
+ * Allocate a new clock setting its reference count to 1.
+ *
+ * @param name Name of the clock (will be copied); can be set to NULL
+ *             for nameless clocks.
+ *
+ * Returns an allocated clock on success, NULL on error.
+ */
+extern struct bt_ctf_clock *bt_ctf_clock_create(const char *name);
+
+/*
+ * bt_ctf_clock_get_name: get a clock's name.
+ *
+ * Get the clock's name.
+ *
+ * @param clock Clock instance.
+ *
+ * Returns the clock's name, NULL on error.
+ */
+extern const char *bt_ctf_clock_get_name(struct bt_ctf_clock *clock);
+
+/*
+ * bt_ctf_clock_get_description: get a clock's description.
+ *
+ * Get the clock's description.
+ *
+ * @param clock Clock instance.
+ *
+ * Returns the clock's description, NULL if unset.
+ */
+extern const char *bt_ctf_clock_get_description(struct bt_ctf_clock *clock);
+
+/*
+ * bt_ctf_clock_set_description: set a clock's description.
+ *
+ * Set the clock's description. The description appears in the clock's TSDL
+ * meta-data.
+ *
+ * @param clock Clock instance.
+ * @param desc Description of the clock.
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_ctf_clock_set_description(struct bt_ctf_clock *clock,
+        const char *desc);
+
+/*
+ * bt_ctf_clock_get_frequency: get a clock's frequency.
+ *
+ * Get the clock's frequency (Hz).
+ *
+ * @param clock Clock instance.
+ *
+ * Returns the clock's frequency, -1ULL on error.
+ */
+extern uint64_t bt_ctf_clock_get_frequency(struct bt_ctf_clock *clock);
+
+/*
+ * bt_ctf_clock_set_frequency: set a clock's frequency.
+ *
+ * Set the clock's frequency (Hz).
+ *
+ * @param clock Clock instance.
+ * @param freq Clock's frequency in Hz, defaults to 1 000 000 000 Hz (1ns).
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_ctf_clock_set_frequency(struct bt_ctf_clock *clock,
+        uint64_t freq);
+
+/*
+ * bt_ctf_clock_get_precision: get a clock's precision.
+ *
+ * Get the clock's precision (in clock ticks).
+ *
+ * @param clock Clock instance.
+ *
+ * Returns the clock's precision, -1ULL on error.
+ */
+extern uint64_t bt_ctf_clock_get_precision(struct bt_ctf_clock *clock);
+
+/*
+ * bt_ctf_clock_set_precision: set a clock's precision.
+ *
+ * Set the clock's precision.
+ *
+ * @param clock Clock instance.
+ * @param precision Clock's precision in clock ticks, defaults to 1.
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_ctf_clock_set_precision(struct bt_ctf_clock *clock,
+        uint64_t precision);
+
+/*
+ * bt_ctf_clock_get_offset_s: get a clock's offset in seconds.
+ *
+ * Get the clock's offset in seconds from POSIX.1 Epoch, 1970-01-01.
+ *
+ * @param clock Clock instance.
+ * @param offset_s Pointer to clock offset in seconds (output).
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_ctf_clock_get_offset_s(struct bt_ctf_clock *clock,
+        int64_t *offset_s);
+
+/*
+ * bt_ctf_clock_set_offset_s: set a clock's offset in seconds.
+ *
+ * Set the clock's offset in seconds from POSIX.1 Epoch, 1970-01-01,
+ * defaults to 0.
+ *
+ * @param clock Clock instance.
+ * @param offset_s Clock's offset in seconds, defaults to 0.
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_ctf_clock_set_offset_s(struct bt_ctf_clock *clock,
+        int64_t offset_s);
+
+/*
+ * bt_ctf_clock_get_offset: get a clock's offset in ticks.
+ *
+ * Get the clock's offset in ticks from Epoch + offset_t.
+ *
+ * @param clock Clock instance.
+ * @param offset Clock offset in ticks from Epoch + offset_s (output).
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_ctf_clock_get_offset(struct bt_ctf_clock *clock,
+        int64_t *offset);
+
+/*
+ * bt_ctf_clock_set_offset: set a clock's offset in ticks.
+ *
+ * Set the clock's offset in ticks from Epoch + offset_s.
+ *
+ * @param clock Clock instance.
+ * @param offset Clock's offset in ticks from Epoch + offset_s, defaults to 0.
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_ctf_clock_set_offset(struct bt_ctf_clock *clock,
+        int64_t offset);
+
+/*
+ * bt_ctf_clock_get_is_absolute: get a clock's absolute attribute.
+ *
+ * Get the clock's absolute attribute. A clock is absolute if the clock is a
+ * global reference across the trace's other clocks.
+ *
+ * @param clock Clock instance.
+ *
+ * Returns the clock's absolute attribute, a negative value on error.
+ */
+extern int bt_ctf_clock_get_is_absolute(struct bt_ctf_clock *clock);
+
+/*
+ * bt_ctf_clock_set_is_absolute: set a clock's absolute attribute.
+ *
+ * Set the clock's absolute attribute. A clock is absolute if the clock is a
+ * global reference across the trace's other clocks.
+ *
+ * @param clock Clock instance.
+ * @param is_absolute Clock's absolute attribute, defaults to FALSE.
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_ctf_clock_set_is_absolute(struct bt_ctf_clock *clock,
+        int is_absolute);
+
+/*
+ * bt_ctf_clock_get_uuid: get a clock's UUID.
+ *
+ * Get the clock's UUID.
+ *
+ * @param clock Clock instance.
+ *
+ * Returns a pointer to the clock's UUID (16 byte array) on success,
+ * NULL on error.
+ */
+extern const uint8_t *bt_ctf_clock_get_uuid(struct bt_ctf_clock *clock);
+
+/*
+ * bt_ctf_clock_set_uuid: set a clock's UUID.
+ *
+ * Set a clock's UUID.
+ *
+ * @param clock Clock instance.
+ * @param uuid A 16-byte array containing a UUID.
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_ctf_clock_set_uuid(struct bt_ctf_clock *clock,
+        const uint8_t *uuid);
+
+/*
+ * bt_ctf_clock_set_time: set a clock's current time value.
+ *
+ * Set the current time in nanoseconds since the clock's origin (offset and
+ * offset_s attributes). Defaults to 0.
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_ctf_clock_set_time(struct bt_ctf_clock *clock,
+               int64_t time);
+
+/*
+ * bt_ctf_clock_get and bt_ctf_clock_put: increment and decrement the
+ * refcount of the clock
+ *
+ * You may also use bt_ctf_get() and bt_ctf_put() with clock objects.
+ *
+ * These functions ensure that the clock won't be destroyed when it
+ * is in use. The same number of get and put (plus one extra put to
+ * release the initial reference done at creation) has to be done to
+ * destroy a clock.
+ *
+ * When the clock refcount is decremented to 0 by a bt_ctf_clock_put,
+ * the clock is freed.
+ *
+ * @param clock Clock instance.
+ */
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+void bt_ctf_clock_get(struct bt_ctf_clock *clock)
+{
+        bt_ctf_object_get_ref(clock);
+}
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+void bt_ctf_clock_put(struct bt_ctf_clock *clock)
+{
+        bt_ctf_object_put_ref(clock);
+}
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE2_CTF_WRITER_CLOCK_H */
diff --git a/include/babeltrace2-ctf-writer/event-fields.h b/include/babeltrace2-ctf-writer/event-fields.h
new file mode 100644 (file)
index 0000000..83df286
--- /dev/null
@@ -0,0 +1,69 @@
+#ifndef BABELTRACE2_CTF_WRITER_EVENT_FIELDS_H
+#define BABELTRACE2_CTF_WRITER_EVENT_FIELDS_H
+
+/*
+ * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace2-ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/field-types.h>
+#include <babeltrace2-ctf-writer/fields.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * bt_ctf_field_get and bt_ctf_field_put: increment and decrement the
+ * field's reference count.
+ *
+ * You may also use bt_ctf_object_get_ref() and bt_ctf_object_put_ref() with field objects.
+ *
+ * These functions ensure that the field won't be destroyed when it
+ * is in use. The same number of get and put (plus one extra put to
+ * release the initial reference done at creation) have to be done to
+ * destroy a field.
+ *
+ * When the field's reference count is decremented to 0 by a bt_ctf_field_put,
+ * the field is freed.
+ *
+ * @param field Field instance.
+ */
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+void bt_ctf_field_get(struct bt_ctf_field *field)
+{
+       bt_ctf_object_get_ref(field);
+}
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+void bt_ctf_field_put(struct bt_ctf_field *field)
+{
+       bt_ctf_object_put_ref(field);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE2_CTF_WRITER_EVENT_FIELDS_H */
diff --git a/include/babeltrace2-ctf-writer/event-types.h b/include/babeltrace2-ctf-writer/event-types.h
new file mode 100644 (file)
index 0000000..4df0e5d
--- /dev/null
@@ -0,0 +1,68 @@
+#ifndef BABELTRACE2_CTF_WRITER_EVENT_TYPES_H
+#define BABELTRACE2_CTF_WRITER_EVENT_TYPES_H
+
+/*
+ * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace2-ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/field-types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * bt_ctf_field_type_get and bt_ctf_field_type_put: increment and decrement
+ * the field type's reference count.
+ *
+ * You may also use bt_ctf_object_get_ref() and bt_ctf_object_put_ref() with field type objects.
+ *
+ * These functions ensure that the field type won't be destroyed while it
+ * is in use. The same number of get and put (plus one extra put to
+ * release the initial reference done at creation) have to be done to
+ * destroy a field type.
+ *
+ * When the field type's reference count is decremented to 0 by a
+ * bt_ctf_field_type_put, the field type is freed.
+ *
+ * @param type Field type.
+ */
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+void bt_ctf_field_type_get(struct bt_ctf_field_type *type)
+{
+       bt_ctf_object_get_ref(type);
+}
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+void bt_ctf_field_type_put(struct bt_ctf_field_type *type)
+{
+       bt_ctf_object_put_ref(type);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE2_CTF_WRITER_EVENT_TYPES_H */
diff --git a/include/babeltrace2-ctf-writer/event.h b/include/babeltrace2-ctf-writer/event.h
new file mode 100644 (file)
index 0000000..9815125
--- /dev/null
@@ -0,0 +1,211 @@
+#ifndef BABELTRACE2_CTF_WRITER_EVENT_H
+#define BABELTRACE2_CTF_WRITER_EVENT_H
+
+/*
+ * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace2-ctf-writer/object.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_ctf_event;
+struct bt_ctf_event_class;
+struct bt_ctf_stream;
+struct bt_ctf_field;
+struct bt_ctf_field_type;
+
+enum bt_ctf_event_class_log_level {
+       /// Unknown, used for errors.
+       BT_CTF_EVENT_CLASS_LOG_LEVEL_UNKNOWN            = -1,
+
+       /// Unspecified log level.
+       BT_CTF_EVENT_CLASS_LOG_LEVEL_UNSPECIFIED        = 255,
+
+       /// System is unusable.
+       BT_CTF_EVENT_CLASS_LOG_LEVEL_EMERGENCY          = 0,
+
+       /// Action must be taken immediately.
+       BT_CTF_EVENT_CLASS_LOG_LEVEL_ALERT              = 1,
+
+       /// Critical conditions.
+       BT_CTF_EVENT_CLASS_LOG_LEVEL_CRITICAL           = 2,
+
+       /// Error conditions.
+       BT_CTF_EVENT_CLASS_LOG_LEVEL_ERROR              = 3,
+
+       /// Warning conditions.
+       BT_CTF_EVENT_CLASS_LOG_LEVEL_WARNING            = 4,
+
+       /// Normal, but significant, condition.
+       BT_CTF_EVENT_CLASS_LOG_LEVEL_NOTICE             = 5,
+
+       /// Informational message.
+       BT_CTF_EVENT_CLASS_LOG_LEVEL_INFO               = 6,
+
+       /// Debug information with system-level scope (set of programs).
+       BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_SYSTEM       = 7,
+
+       /// Debug information with program-level scope (set of processes).
+       BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_PROGRAM      = 8,
+
+       /// Debug information with process-level scope (set of modules).
+       BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_PROCESS      = 9,
+
+       /// Debug information with module (executable/library) scope (set of units).
+       BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_MODULE       = 10,
+
+       /// Debug information with compilation unit scope (set of functions).
+       BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_UNIT         = 11,
+
+       /// Debug information with function-level scope.
+       BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_FUNCTION     = 12,
+
+       /// Debug information with line-level scope (default log level).
+       BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_LINE         = 13,
+
+       /// Debug-level message.
+       BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG              = 14,
+};
+
+extern struct bt_ctf_event *bt_ctf_event_create(
+               struct bt_ctf_event_class *event_class);
+
+extern struct bt_ctf_field *bt_ctf_event_get_payload(struct bt_ctf_event *event,
+               const char *name);
+
+extern int bt_ctf_event_set_payload(struct bt_ctf_event *event,
+               const char *name, struct bt_ctf_field *field);
+
+extern struct bt_ctf_field *bt_ctf_event_get_payload_field(
+               struct bt_ctf_event *event);
+
+extern int bt_ctf_event_set_payload_field(struct bt_ctf_event *event,
+               struct bt_ctf_field *field);
+
+extern int bt_ctf_event_set_context(struct bt_ctf_event *event,
+               struct bt_ctf_field *field);
+
+extern struct bt_ctf_field *bt_ctf_event_get_context(
+               struct bt_ctf_event *event);
+
+extern int bt_ctf_event_set_stream_event_context(struct bt_ctf_event *event,
+               struct bt_ctf_field *field);
+
+extern struct bt_ctf_field *bt_ctf_event_get_stream_event_context(
+               struct bt_ctf_event *event);
+
+extern int bt_ctf_event_set_header(struct bt_ctf_event *event,
+               struct bt_ctf_field *field);
+
+extern struct bt_ctf_field *bt_ctf_event_get_header(
+               struct bt_ctf_event *event);
+
+extern struct bt_ctf_stream *bt_ctf_event_get_stream(
+               struct bt_ctf_event *event);
+
+extern struct bt_ctf_event_class *bt_ctf_event_get_class(
+               struct bt_ctf_event *event);
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+void bt_ctf_event_get(struct bt_ctf_event *event)
+{
+       bt_ctf_object_get_ref(event);
+}
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+void bt_ctf_event_put(struct bt_ctf_event *event)
+{
+       bt_ctf_object_put_ref(event);
+}
+
+extern struct bt_ctf_event_class *bt_ctf_event_class_create(const char *name);
+
+extern struct bt_ctf_stream_class *bt_ctf_event_class_get_stream_class(
+               struct bt_ctf_event_class *event_class);
+
+extern const char *bt_ctf_event_class_get_name(
+               struct bt_ctf_event_class *event_class);
+
+extern int64_t bt_ctf_event_class_get_id(
+               struct bt_ctf_event_class *event_class);
+
+extern int bt_ctf_event_class_set_id(
+               struct bt_ctf_event_class *event_class, uint64_t id);
+
+extern enum bt_ctf_event_class_log_level bt_ctf_event_class_get_log_level(
+               struct bt_ctf_event_class *event_class);
+
+extern int bt_ctf_event_class_set_log_level(
+               struct bt_ctf_event_class *event_class,
+               enum bt_ctf_event_class_log_level log_level);
+
+extern const char *bt_ctf_event_class_get_emf_uri(
+               struct bt_ctf_event_class *event_class);
+
+extern int bt_ctf_event_class_set_emf_uri(
+               struct bt_ctf_event_class *event_class,
+               const char *emf_uri);
+
+extern struct bt_ctf_field_type *bt_ctf_event_class_get_context_field_type(
+               struct bt_ctf_event_class *event_class);
+
+extern int bt_ctf_event_class_set_context_field_type(
+               struct bt_ctf_event_class *event_class,
+               struct bt_ctf_field_type *context_type);
+
+extern struct bt_ctf_field_type *bt_ctf_event_class_get_payload_field_type(
+               struct bt_ctf_event_class *event_class);
+
+extern int bt_ctf_event_class_set_payload_field_type(
+               struct bt_ctf_event_class *event_class,
+               struct bt_ctf_field_type *payload_type);
+
+extern int bt_ctf_event_class_add_field(struct bt_ctf_event_class *event_class,
+               struct bt_ctf_field_type *field_type,
+               const char *name);
+
+extern struct bt_ctf_field_type *bt_ctf_event_class_get_field_by_name(
+               struct bt_ctf_event_class *event_class, const char *name);
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+void bt_ctf_event_class_get(struct bt_ctf_event_class *event_class)
+{
+       bt_ctf_object_get_ref(event_class);
+}
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+void bt_ctf_event_class_put(struct bt_ctf_event_class *event_class)
+{
+       bt_ctf_object_put_ref(event_class);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE2_CTF_WRITER_EVENT_H */
diff --git a/include/babeltrace2-ctf-writer/field-types.h b/include/babeltrace2-ctf-writer/field-types.h
new file mode 100644 (file)
index 0000000..8407606
--- /dev/null
@@ -0,0 +1,339 @@
+#ifndef BABELTRACE2_CTF_WRITER_FIELD_TYPES_H
+#define BABELTRACE2_CTF_WRITER_FIELD_TYPES_H
+
+/*
+ * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stdint.h>
+#include <stddef.h>
+#include <babeltrace2-ctf-writer/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_ctf_field;
+struct bt_ctf_field_type;
+
+enum bt_ctf_scope {
+       /// Unknown, used for errors.
+       BT_CTF_SCOPE_UNKNOWN                    = -1,
+
+       /// Trace packet header.
+       BT_CTF_SCOPE_TRACE_PACKET_HEADER        = 1,
+
+       /// Stream packet context.
+       BT_CTF_SCOPE_STREAM_PACKET_CONTEXT      = 2,
+
+       /// Stream event header.
+       BT_CTF_SCOPE_STREAM_EVENT_HEADER        = 3,
+
+       /// Stream event context.
+       BT_CTF_SCOPE_STREAM_EVENT_CONTEXT       = 4,
+
+       /// Event context.
+       BT_CTF_SCOPE_EVENT_CONTEXT              = 5,
+
+       /// Event payload.
+       BT_CTF_SCOPE_EVENT_PAYLOAD              = 6,
+
+       /// @cond DOCUMENT
+       BT_CTF_SCOPE_ENV                        = 0,
+       BT_CTF_SCOPE_EVENT_FIELDS               = 6,
+       /// @endcond
+};
+
+enum bt_ctf_field_type_id {
+       BT_CTF_FIELD_TYPE_ID_UNKNOWN    = -1,
+       BT_CTF_FIELD_TYPE_ID_INTEGER    = 0,
+       BT_CTF_FIELD_TYPE_ID_FLOAT      = 1,
+       BT_CTF_FIELD_TYPE_ID_ENUM       = 2,
+       BT_CTF_FIELD_TYPE_ID_STRING     = 3,
+       BT_CTF_FIELD_TYPE_ID_STRUCT     = 4,
+       BT_CTF_FIELD_TYPE_ID_ARRAY      = 5,
+       BT_CTF_FIELD_TYPE_ID_SEQUENCE   = 6,
+       BT_CTF_FIELD_TYPE_ID_VARIANT    = 7,
+       BT_CTF_FIELD_TYPE_ID_NR,
+};
+
+extern enum bt_ctf_field_type_id bt_ctf_field_type_get_type_id(
+               struct bt_ctf_field_type *field_type);
+
+enum bt_ctf_byte_order {
+       BT_CTF_BYTE_ORDER_UNKNOWN               = -1,
+       BT_CTF_BYTE_ORDER_NATIVE                = 0,
+       BT_CTF_BYTE_ORDER_UNSPECIFIED,
+       BT_CTF_BYTE_ORDER_LITTLE_ENDIAN,
+       BT_CTF_BYTE_ORDER_BIG_ENDIAN,
+       BT_CTF_BYTE_ORDER_NETWORK,
+};
+
+enum bt_ctf_string_encoding {
+       BT_CTF_STRING_ENCODING_UNKNOWN  = -1,
+       BT_CTF_STRING_ENCODING_NONE,
+       BT_CTF_STRING_ENCODING_UTF8,
+       BT_CTF_STRING_ENCODING_ASCII,
+};
+
+/* Pre-2.0 CTF writer compatibility */
+#define ctf_string_encoding    bt_ctf_string_encoding
+
+extern int bt_ctf_field_type_get_alignment(
+               struct bt_ctf_field_type *field_type);
+
+extern int bt_ctf_field_type_set_alignment(struct bt_ctf_field_type *field_type,
+               unsigned int alignment);
+
+extern enum bt_ctf_byte_order bt_ctf_field_type_get_byte_order(
+               struct bt_ctf_field_type *field_type);
+
+extern int bt_ctf_field_type_set_byte_order(
+               struct bt_ctf_field_type *field_type,
+               enum bt_ctf_byte_order byte_order);
+
+enum bt_ctf_integer_base {
+       /// Unknown, used for errors.
+       BT_CTF_INTEGER_BASE_UNKNOWN             = -1,
+
+       /// Unspecified by the tracer.
+       BT_CTF_INTEGER_BASE_UNSPECIFIED         = 0,
+
+       /// Binary.
+       BT_CTF_INTEGER_BASE_BINARY              = 2,
+
+       /// Octal.
+       BT_CTF_INTEGER_BASE_OCTAL               = 8,
+
+       /// Decimal.
+       BT_CTF_INTEGER_BASE_DECIMAL             = 10,
+
+       /// Hexadecimal.
+       BT_CTF_INTEGER_BASE_HEXADECIMAL         = 16,
+};
+
+extern struct bt_ctf_field_type *bt_ctf_field_type_integer_create(
+               unsigned int size);
+
+extern int bt_ctf_field_type_integer_get_size(
+               struct bt_ctf_field_type *int_field_type);
+
+extern int bt_ctf_field_type_integer_set_size(
+               struct bt_ctf_field_type *int_field_type, unsigned int size);
+
+extern bt_ctf_bool bt_ctf_field_type_integer_is_signed(
+               struct bt_ctf_field_type *int_field_type);
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+int bt_ctf_field_type_integer_get_signed(
+               struct bt_ctf_field_type *int_field_type)
+{
+       return bt_ctf_field_type_integer_is_signed(int_field_type) ? 1 : 0;
+}
+
+extern int bt_ctf_field_type_integer_set_is_signed(
+               struct bt_ctf_field_type *int_field_type, bt_ctf_bool is_signed);
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+int bt_ctf_field_type_integer_set_signed(
+               struct bt_ctf_field_type *int_field_type, int is_signed)
+{
+       return bt_ctf_field_type_integer_set_is_signed(int_field_type,
+               is_signed ? BT_CTF_TRUE : BT_CTF_FALSE);
+}
+
+extern enum bt_ctf_integer_base bt_ctf_field_type_integer_get_base(
+               struct bt_ctf_field_type *int_field_type);
+
+extern int bt_ctf_field_type_integer_set_base(
+               struct bt_ctf_field_type *int_field_type,
+               enum bt_ctf_integer_base base);
+
+extern enum bt_ctf_string_encoding bt_ctf_field_type_integer_get_encoding(
+               struct bt_ctf_field_type *int_field_type);
+
+extern int bt_ctf_field_type_integer_set_encoding(
+               struct bt_ctf_field_type *int_field_type,
+               enum bt_ctf_string_encoding encoding);
+
+extern struct bt_ctf_clock_class *bt_ctf_field_type_integer_get_mapped_clock_class(
+               struct bt_ctf_field_type *int_field_type);
+
+extern int bt_ctf_field_type_integer_set_mapped_clock_class(
+               struct bt_ctf_field_type *int_field_type,
+               struct bt_ctf_clock_class *clock_class);
+
+extern struct bt_ctf_field_type *bt_ctf_field_type_floating_point_create(void);
+
+extern int bt_ctf_field_type_floating_point_get_exponent_digits(
+               struct bt_ctf_field_type *float_field_type);
+
+extern int bt_ctf_field_type_floating_point_set_exponent_digits(
+               struct bt_ctf_field_type *float_field_type,
+               unsigned int exponent_size);
+
+extern int bt_ctf_field_type_floating_point_get_mantissa_digits(
+               struct bt_ctf_field_type *float_field_type);
+
+extern int bt_ctf_field_type_floating_point_set_mantissa_digits(
+               struct bt_ctf_field_type *float_field_type,
+               unsigned int mantissa_sign_size);
+
+extern struct bt_ctf_field_type *bt_ctf_field_type_enumeration_create(
+               struct bt_ctf_field_type *int_field_type);
+
+extern
+struct bt_ctf_field_type *bt_ctf_field_type_enumeration_get_container_field_type(
+               struct bt_ctf_field_type *enum_field_type);
+
+extern int64_t bt_ctf_field_type_enumeration_get_mapping_count(
+               struct bt_ctf_field_type *enum_field_type);
+
+extern int bt_ctf_field_type_enumeration_signed_get_mapping_by_index(
+               struct bt_ctf_field_type *enum_field_type, uint64_t index,
+               const char **name, int64_t *range_begin, int64_t *range_end);
+
+extern int bt_ctf_field_type_enumeration_unsigned_get_mapping_by_index(
+               struct bt_ctf_field_type *enum_field_type, uint64_t index,
+               const char **name, uint64_t *range_begin,
+               uint64_t *range_end);
+
+extern int bt_ctf_field_type_enumeration_signed_add_mapping(
+               struct bt_ctf_field_type *enum_field_type,
+               const char *name, int64_t range_begin, int64_t range_end);
+
+extern int bt_ctf_field_type_enumeration_unsigned_add_mapping(
+               struct bt_ctf_field_type *enum_field_type,
+               const char *name, uint64_t range_begin, uint64_t range_end);
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+int bt_ctf_field_type_enumeration_add_mapping(
+               struct bt_ctf_field_type *enumeration, const char *name,
+               int64_t range_start, int64_t range_end)
+{
+       return bt_ctf_field_type_enumeration_signed_add_mapping(enumeration,
+               name, range_start, range_end);
+}
+
+extern struct bt_ctf_field_type *bt_ctf_field_type_string_create(void);
+
+extern enum bt_ctf_string_encoding bt_ctf_field_type_string_get_encoding(
+               struct bt_ctf_field_type *string_field_type);
+
+extern int bt_ctf_field_type_string_set_encoding(
+               struct bt_ctf_field_type *string_field_type,
+               enum bt_ctf_string_encoding encoding);
+
+extern struct bt_ctf_field_type *bt_ctf_field_type_structure_create(void);
+
+extern int64_t bt_ctf_field_type_structure_get_field_count(
+               struct bt_ctf_field_type *struct_field_type);
+
+extern int bt_ctf_field_type_structure_get_field_by_index(
+               struct bt_ctf_field_type *struct_field_type,
+               const char **field_name, struct bt_ctf_field_type **field_type,
+               uint64_t index);
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+int bt_ctf_field_type_structure_get_field(struct bt_ctf_field_type *structure,
+               const char **field_name, struct bt_ctf_field_type **field_type,
+               int index)
+{
+       return bt_ctf_field_type_structure_get_field_by_index(structure,
+               field_name, field_type, (uint64_t) index);
+}
+
+extern
+struct bt_ctf_field_type *bt_ctf_field_type_structure_get_field_type_by_name(
+               struct bt_ctf_field_type *struct_field_type,
+               const char *field_name);
+
+extern int bt_ctf_field_type_structure_add_field(
+               struct bt_ctf_field_type *struct_field_type,
+               struct bt_ctf_field_type *field_type,
+               const char *field_name);
+
+extern struct bt_ctf_field_type *bt_ctf_field_type_array_create(
+               struct bt_ctf_field_type *element_field_type,
+               unsigned int length);
+
+extern struct bt_ctf_field_type *bt_ctf_field_type_array_get_element_field_type(
+               struct bt_ctf_field_type *array_field_type);
+
+extern int64_t bt_ctf_field_type_array_get_length(
+               struct bt_ctf_field_type *array_field_type);
+
+extern struct bt_ctf_field_type *bt_ctf_field_type_sequence_create(
+               struct bt_ctf_field_type *element_field_type,
+               const char *length_name);
+
+extern struct bt_ctf_field_type *bt_ctf_field_type_sequence_get_element_field_type(
+               struct bt_ctf_field_type *sequence_field_type);
+
+extern const char *bt_ctf_field_type_sequence_get_length_field_name(
+               struct bt_ctf_field_type *sequence_field_type);
+
+extern struct bt_ctf_field_type *bt_ctf_field_type_variant_create(
+               struct bt_ctf_field_type *tag_field_type,
+               const char *tag_name);
+
+extern struct bt_ctf_field_type *bt_ctf_field_type_variant_get_tag_field_type(
+               struct bt_ctf_field_type *variant_field_type);
+
+extern const char *bt_ctf_field_type_variant_get_tag_name(
+               struct bt_ctf_field_type *variant_field_type);
+
+extern int bt_ctf_field_type_variant_set_tag_name(
+               struct bt_ctf_field_type *variant_field_type,
+               const char *tag_name);
+
+extern int64_t bt_ctf_field_type_variant_get_field_count(
+               struct bt_ctf_field_type *variant_field_type);
+
+extern int bt_ctf_field_type_variant_get_field_by_index(
+               struct bt_ctf_field_type *variant_field_type,
+               const char **field_name,
+               struct bt_ctf_field_type **field_type, uint64_t index);
+
+extern
+struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_by_name(
+               struct bt_ctf_field_type *variant_field_type,
+               const char *field_name);
+
+extern
+struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_from_tag(
+               struct bt_ctf_field_type *variant_field_type,
+               struct bt_ctf_field *tag_field);
+
+extern int bt_ctf_field_type_variant_add_field(
+               struct bt_ctf_field_type *variant_field_type,
+               struct bt_ctf_field_type *field_type,
+               const char *field_name);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE2_CTF_WRITER_FIELD_TYPES_H */
diff --git a/include/babeltrace2-ctf-writer/fields.h b/include/babeltrace2-ctf-writer/fields.h
new file mode 100644 (file)
index 0000000..1345598
--- /dev/null
@@ -0,0 +1,134 @@
+#ifndef BABELTRACE2_CTF_WRITER_FIELDS_H
+#define BABELTRACE2_CTF_WRITER_FIELDS_H
+
+/*
+ * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stdint.h>
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_ctf_field;
+struct bt_ctf_event_class;
+struct bt_ctf_event;
+struct bt_ctf_field_type;
+struct bt_ctf_field_type_enumeration_mapping_iterator;
+
+extern struct bt_ctf_field *bt_ctf_field_create(
+               struct bt_ctf_field_type *field_type);
+
+extern struct bt_ctf_field_type *bt_ctf_field_get_type(
+               struct bt_ctf_field *field);
+
+extern enum bt_ctf_field_type_id bt_ctf_field_get_type_id(
+               struct bt_ctf_field *field);
+
+extern struct bt_ctf_field *bt_ctf_field_copy(struct bt_ctf_field *field);
+
+extern int bt_ctf_field_integer_signed_get_value(
+               struct bt_ctf_field *integer_field, int64_t *value);
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+int bt_ctf_field_signed_integer_set_value(
+               struct bt_ctf_field *integer_field, int64_t *value)
+{
+       return bt_ctf_field_integer_signed_get_value(integer_field, value);
+}
+
+extern int bt_ctf_field_integer_signed_set_value(
+               struct bt_ctf_field *integer_field, int64_t value);
+
+extern int bt_ctf_field_integer_unsigned_get_value(
+               struct bt_ctf_field *integer_field, uint64_t *value);
+
+extern int bt_ctf_field_integer_unsigned_set_value(
+               struct bt_ctf_field *integer_field, uint64_t value);
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+int bt_ctf_field_unsigned_integer_set_value(
+               struct bt_ctf_field *integer_field, uint64_t *value)
+{
+       return bt_ctf_field_integer_unsigned_get_value(integer_field, value);
+}
+
+extern int bt_ctf_field_floating_point_get_value(
+               struct bt_ctf_field *float_field, double *value);
+
+extern int bt_ctf_field_floating_point_set_value(
+               struct bt_ctf_field *float_field, double value);
+
+extern struct bt_ctf_field *bt_ctf_field_enumeration_get_container(
+               struct bt_ctf_field *enum_field);
+
+extern const char *bt_ctf_field_string_get_value(
+               struct bt_ctf_field *string_field);
+
+extern int bt_ctf_field_string_set_value(struct bt_ctf_field *string_field,
+               const char *value);
+
+extern int bt_ctf_field_string_append(struct bt_ctf_field *string_field,
+               const char *value);
+
+extern int bt_ctf_field_string_append_len(
+               struct bt_ctf_field *string_field, const char *value,
+               unsigned int length);
+
+extern struct bt_ctf_field *bt_ctf_field_structure_get_field_by_name(
+               struct bt_ctf_field *struct_field, const char *name);
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+struct bt_ctf_field *bt_ctf_field_structure_get_field(
+               struct bt_ctf_field *structure, const char *name)
+{
+       return bt_ctf_field_structure_get_field_by_name(structure, name);
+}
+
+extern struct bt_ctf_field *bt_ctf_field_structure_get_field_by_index(
+               struct bt_ctf_field *struct_field, uint64_t index);
+
+extern struct bt_ctf_field *bt_ctf_field_array_get_field(
+               struct bt_ctf_field *array_field, uint64_t index);
+
+extern struct bt_ctf_field *bt_ctf_field_sequence_get_field(
+               struct bt_ctf_field *sequence_field, uint64_t index);
+
+extern int bt_ctf_field_sequence_set_length(struct bt_ctf_field *sequence_field,
+               struct bt_ctf_field *length_field);
+
+extern struct bt_ctf_field *bt_ctf_field_variant_get_field(
+               struct bt_ctf_field *variant_field,
+               struct bt_ctf_field *tag_field);
+
+extern struct bt_ctf_field *bt_ctf_field_variant_get_current_field(
+               struct bt_ctf_field *variant_field);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE2_CTF_WRITER_FIELDS_H */
diff --git a/include/babeltrace2-ctf-writer/object.h b/include/babeltrace2-ctf-writer/object.h
new file mode 100644 (file)
index 0000000..904cfa2
--- /dev/null
@@ -0,0 +1,213 @@
+#ifndef BABELTRACE2_CTF_WRITER_OBJECT_H
+#define BABELTRACE2_CTF_WRITER_OBJECT_H
+
+/*
+ * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+@defgroup refs Reference counting management
+@ingroup apiref
+@brief Common reference counting management for all Babeltrace objects.
+
+@code
+#include <babeltrace2-ctf-writer/object.h>
+@endcode
+
+The macros and functions of this module are everything that is needed
+to handle the <strong><em>reference counting</em></strong> of
+Babeltrace objects.
+
+Any Babeltrace object can be shared by multiple owners thanks to
+<a href="https://en.wikipedia.org/wiki/Reference_counting">reference
+counting</a>.
+
+The Babeltrace C API complies with the following key principles:
+
+1. When you call an API function which accepts a Babeltrace object
+   pointer as a parameter, the API function <strong>borrows the
+   reference</strong> for the <strong>duration of the function</strong>.
+
+   @image html ref-count-user-calls.png
+
+   The API function can also get a new reference if the system needs a
+   more persistent reference, but the ownership is <strong>never
+   transferred</strong> from the caller to the API function.
+
+   In other words, the caller still owns the object after calling any
+   API function: no function "steals" the user's reference (except
+   bt_ctf_object_put_ref()).
+
+2. An API function which \em returns a Babeltrace object pointer to the
+   user returns a <strong>new reference</strong>. The caller becomes an
+   owner of the object.
+
+   @image html ref-count-api-returns.png
+
+   It is your responsibility to discard the object when you don't
+   need it anymore with bt_ctf_object_put_ref().
+
+   For example, see bt_ctf_value_array_get().
+
+3. A Babeltrace object pointer received as a parameter in a user
+   function called back from an API function is a
+   <strong>borrowed</strong>, or <strong>weak reference</strong>: if you
+   need a reference which is more persistent than the duration of the
+   user function, call bt_ctf_object_get_ref() on the pointer.
+
+   @image html ref-count-callback.png
+
+   For example, see bt_ctf_value_map_foreach_entry().
+
+The two macros BT_CTF_OBJECT_PUT_REF_AND_RESET() and BT_CTF_OBJECT_MOVE_REF() operate on \em variables rather
+than pointer values. You should use BT_CTF_OBJECT_PUT_REF_AND_RESET() instead of bt_ctf_object_put_ref() when
+possible to avoid "double puts". For the same reason, you should use use
+BT_CTF_OBJECT_MOVE_REF() instead of performing manual reference moves between
+variables.
+
+@file
+@brief Reference counting management macros and functions.
+@sa refs
+
+@addtogroup refs
+@{
+*/
+
+/**
+@brief Calls bt_ctf_object_put_ref() on a variable named \p _var, then
+       sets \p _var to \c NULL.
+
+Using this macro is considered safer than calling bt_ctf_object_put_ref() because it
+makes sure that the variable which used to contain a reference to a
+Babeltrace object is set to \c NULL so that a future BT_CTF_OBJECT_PUT_REF_AND_RESET() or
+bt_ctf_object_put_ref() call will not cause another, unwanted reference decrementation.
+
+@param[in,out] _var    Name of a variable containing a
+                       Babeltrace object's address (this address
+                       can be \c NULL).
+
+@post <strong>If \p _var does not contain \p NULL</strong>,
+       its reference count is decremented.
+@post \p _var contains \c NULL.
+
+@sa BT_CTF_OBJECT_MOVE_REF(): Transfers the ownership of a Babeltrace object from a
+       variable to another.
+*/
+#define BT_CTF_OBJECT_PUT_REF_AND_RESET(_var)  \
+       do {                                    \
+               bt_ctf_object_put_ref(_var);    \
+               (_var) = NULL;                  \
+       } while (0)
+
+/**
+@brief Transfers the ownership of a Babeltrace object from a variable
+       named \p _var_src to a variable named \p _var_dst.
+
+This macro implements the following common pattern:
+
+  1. Call bt_ctf_object_put_ref() on \p _var_dst to make sure the previous reference
+     held by \p _var_dst is discarded.
+  2. Assign \p _var_src to \p _var_dst.
+  3. Set \p _var_src to \c NULL to avoid future, unwanted reference
+     decrementation of \p _var_src.
+
+@warning
+You must \em not use this macro when both \p _var_dst and
+\p _var_src contain the same Babeltrace object address and the reference
+count of this object is 1. The initial call to bt_ctf_object_put_ref() on \p _var_dst
+would destroy the object and leave a dangling pointer in \p _var_dst.
+
+@param[in,out] _var_dst        Name of the destination variable, containing
+                       either the address of a Babeltrace object to
+                       put first, or \c NULL.
+@param[in,out] _var_src        Name of the source variable, containing
+                       either the address of a Babeltrace object to
+                       move, or \c NULL.
+
+@pre <strong>If \p _var_dst and \p _var_src contain the same
+       value which is not \c NULL</strong>, this object's reference
+       count is greater than 1.
+@post <strong>If \c _var_dst is not \c NULL</strong>, its reference
+       count is decremented.
+@post \p _var_dst is equal to the value of \p _var_src \em before
+       you called this macro.
+@post \p _var_src is \c NULL.
+
+@sa BT_CTF_OBJECT_PUT_REF_AND_RESET(): Calls bt_ctf_object_put_ref() on a variable, then sets it to \c NULL.
+*/
+#define BT_CTF_OBJECT_MOVE_REF(_var_dst, _var_src)     \
+       do {                                    \
+               bt_ctf_object_put_ref(_var_dst);        \
+               (_var_dst) = (_var_src);        \
+               (_var_src) = NULL;              \
+       } while (0)
+
+/**
+@brief  Increments the reference count of the Babeltrace object \p obj.
+
+@param[in] obj Babeltrace object of which to get a new reference
+               (can be \c NULL).
+@returns       \p obj
+
+@post <strong>If \c obj is not \c NULL</strong>, its reference
+       count is incremented.
+
+@sa bt_ctf_object_put_ref(): Decrements the reference count of a Babeltrace object.
+*/
+void *bt_ctf_object_get_ref(void *obj);
+
+/**
+@brief Decrements the reference count of the Babeltrace object
+       \p obj.
+
+When the object's reference count reaches 0, the object can no longer
+be accessed and is considered \em destroyed.
+
+@remarks
+You should use the BT_CTF_OBJECT_PUT_REF_AND_RESET() macro instead of calling bt_ctf_object_put_ref() since the
+former is generally safer.
+
+@param[in] obj Babeltrace object of which to drop a reference
+               (can be \c NULL).
+
+@post <strong>If \c obj is not \c NULL</strong>, its reference
+       count is decremented.
+
+@sa BT_CTF_OBJECT_PUT_REF_AND_RESET(): Calls bt_ctf_object_put_ref() on a variable, then sets it to \c NULL.
+@sa BT_CTF_OBJECT_MOVE_REF(): Transfers the ownership of a Babeltrace object from a
+       variable to another.
+@sa bt_ctf_object_get_ref(): Increments the reference count of a Babeltrace object.
+*/
+void bt_ctf_object_put_ref(void *obj);
+
+/**
+@}
+*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE2_CTF_WRITER_OBJECT_H */
diff --git a/include/babeltrace2-ctf-writer/stream-class.h b/include/babeltrace2-ctf-writer/stream-class.h
new file mode 100644 (file)
index 0000000..e1d3471
--- /dev/null
@@ -0,0 +1,117 @@
+#ifndef BABELTRACE2_CTF_WRITER_STREAM_CLASS_H
+#define BABELTRACE2_CTF_WRITER_STREAM_CLASS_H
+
+/*
+ * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace2-ctf-writer/object.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_ctf_stream_class;
+struct bt_ctf_trace;
+struct bt_ctf_event_class;
+struct bt_ctf_field_type;
+struct bt_ctf_clock;
+
+extern struct bt_ctf_stream_class *bt_ctf_stream_class_create(
+               const char *name);
+
+extern struct bt_ctf_trace *bt_ctf_stream_class_get_trace(
+               struct bt_ctf_stream_class *stream_class);
+
+extern const char *bt_ctf_stream_class_get_name(
+               struct bt_ctf_stream_class *stream_class);
+
+extern int bt_ctf_stream_class_set_name(
+               struct bt_ctf_stream_class *stream_class, const char *name);
+
+extern int64_t bt_ctf_stream_class_get_id(
+               struct bt_ctf_stream_class *stream_class);
+
+extern int bt_ctf_stream_class_set_id(
+               struct bt_ctf_stream_class *stream_class, uint64_t id);
+
+extern struct bt_ctf_field_type *bt_ctf_stream_class_get_packet_context_type(
+               struct bt_ctf_stream_class *stream_class);
+
+extern int bt_ctf_stream_class_set_packet_context_type(
+               struct bt_ctf_stream_class *stream_class,
+               struct bt_ctf_field_type *packet_context_type);
+
+extern struct bt_ctf_field_type *
+bt_ctf_stream_class_get_event_header_type(
+               struct bt_ctf_stream_class *stream_class);
+
+extern int bt_ctf_stream_class_set_event_header_type(
+               struct bt_ctf_stream_class *stream_class,
+               struct bt_ctf_field_type *event_header_type);
+
+extern struct bt_ctf_field_type *
+bt_ctf_stream_class_get_event_context_type(
+               struct bt_ctf_stream_class *stream_class);
+
+extern int bt_ctf_stream_class_set_event_context_type(
+               struct bt_ctf_stream_class *stream_class,
+               struct bt_ctf_field_type *event_context_type);
+
+extern int64_t bt_ctf_stream_class_get_event_class_count(
+               struct bt_ctf_stream_class *stream_class);
+
+extern struct bt_ctf_event_class *bt_ctf_stream_class_get_event_class_by_index(
+               struct bt_ctf_stream_class *stream_class, uint64_t index);
+
+extern struct bt_ctf_event_class *bt_ctf_stream_class_get_event_class_by_id(
+               struct bt_ctf_stream_class *stream_class, uint64_t id);
+
+extern int bt_ctf_stream_class_add_event_class(
+               struct bt_ctf_stream_class *stream_class,
+               struct bt_ctf_event_class *event_class);
+
+extern int bt_ctf_stream_class_set_clock(
+               struct bt_ctf_stream_class *ctf_stream_class,
+               struct bt_ctf_clock *clock);
+
+extern struct bt_ctf_clock *bt_ctf_stream_class_get_clock(
+        struct bt_ctf_stream_class *stream_class);
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+void bt_ctf_stream_class_get(struct bt_ctf_stream_class *stream_class)
+{
+       bt_ctf_object_get_ref(stream_class);
+}
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+void bt_ctf_stream_class_put(struct bt_ctf_stream_class *stream_class)
+{
+       bt_ctf_object_put_ref(stream_class);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE2_CTF_WRITER_STREAM_CLASS_H */
diff --git a/include/babeltrace2-ctf-writer/stream.h b/include/babeltrace2-ctf-writer/stream.h
new file mode 100644 (file)
index 0000000..003e8d5
--- /dev/null
@@ -0,0 +1,182 @@
+#ifndef BABELTRACE2_CTF_WRITER_STREAM_H
+#define BABELTRACE2_CTF_WRITER_STREAM_H
+
+/*
+ * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_ctf_stream;
+struct bt_ctf_event;
+
+/*
+ * bt_ctf_stream_get_discarded_events_count: get the number of discarded
+ * events associated with this stream.
+ *
+ * Note that discarded events are not stored if the stream's packet
+ * context has no "events_discarded" field. An error will be returned
+ * in that case.
+ *
+ * @param stream Stream instance.
+ *
+ * Returns the number of discarded events, a negative value on error.
+ */
+extern int bt_ctf_stream_get_discarded_events_count(
+               struct bt_ctf_stream *stream, uint64_t *count);
+
+/*
+ * bt_ctf_stream_append_discarded_events: increment discarded events count.
+ *
+ * Increase the current packet's discarded event count. Has no effect if the
+ * stream class' packet context has no "events_discarded" field.
+ *
+ * @param stream Stream instance.
+ * @param event_count Number of discarded events to add to the stream's current
+ *     packet.
+ */
+extern void bt_ctf_stream_append_discarded_events(struct bt_ctf_stream *stream,
+               uint64_t event_count);
+
+/*
+ * bt_ctf_stream_append_event: append an event to the stream.
+ *
+ * Append "event" to the stream's current packet. The stream's associated clock
+ * will be sampled during this call. The event shall not be modified after
+ * being appended to a stream. The stream will share the event's ownership by
+ * incrementing its reference count. The current packet is not flushed to disk
+ * until the next call to bt_ctf_stream_flush.
+ *
+ * The stream event context will be sampled for every appended event if
+ * a stream event context was defined.
+ *
+ * @param stream Stream instance.
+ * @param event Event instance to append to the stream's current packet.
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_ctf_stream_append_event(struct bt_ctf_stream *stream,
+               struct bt_ctf_event *event);
+
+/*
+ * bt_ctf_stream_get_packet_header: get a stream's packet header.
+ *
+ * @param stream Stream instance.
+ *
+ * Returns a field instance on success, NULL on error.
+ */
+extern struct bt_ctf_field *bt_ctf_stream_get_packet_header(
+               struct bt_ctf_stream *stream);
+
+/*
+ * bt_ctf_stream_set_packet_header: set a stream's packet header.
+ *
+ * The packet header's type must match the trace's packet header
+ * type.
+ *
+ * @param stream Stream instance.
+ * @param packet_header Packet header instance.
+ *
+ * Returns a field instance on success, NULL on error.
+ */
+extern int bt_ctf_stream_set_packet_header(
+               struct bt_ctf_stream *stream,
+               struct bt_ctf_field *packet_header);
+
+/*
+ * bt_ctf_stream_get_packet_context: get a stream's packet context.
+ *
+ * @param stream Stream instance.
+ *
+ * Returns a field instance on success, NULL on error.
+ */
+extern struct bt_ctf_field *bt_ctf_stream_get_packet_context(
+               struct bt_ctf_stream *stream);
+
+/*
+ * bt_ctf_stream_set_packet_context: set a stream's packet context.
+ *
+ * The packet context's type must match the stream class' packet
+ * context type.
+ *
+ * @param stream Stream instance.
+ * @param packet_context Packet context field instance.
+ *
+ * Returns a field instance on success, NULL on error.
+ */
+extern int bt_ctf_stream_set_packet_context(
+               struct bt_ctf_stream *stream,
+               struct bt_ctf_field *packet_context);
+
+/*
+ * bt_ctf_stream_flush: flush a stream.
+ *
+ * The stream's current packet's events will be flushed, thus closing the
+ * current packet. Events subsequently appended to the stream will be
+ * added to a new packet.
+ *
+ * Flushing will also set the packet context's default attributes if
+ * they remained unset while populating the current packet. These default
+ * attributes, along with their expected types, are detailed in stream-class.h.
+ *
+ * @param stream Stream instance.
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_ctf_stream_flush(struct bt_ctf_stream *stream);
+
+extern int bt_ctf_stream_is_writer(struct bt_ctf_stream *stream);
+
+extern
+struct bt_ctf_stream *bt_ctf_stream_create(
+               struct bt_ctf_stream_class *stream_class,
+               const char *name, uint64_t id);
+
+extern struct bt_ctf_stream_class *bt_ctf_stream_get_class(
+               struct bt_ctf_stream *stream);
+
+extern const char *bt_ctf_stream_get_name(struct bt_ctf_stream *stream);
+
+extern int64_t bt_ctf_stream_get_id(struct bt_ctf_stream *stream);
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+void bt_ctf_stream_get(struct bt_ctf_stream *stream)
+{
+       bt_ctf_object_get_ref(stream);
+}
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+void bt_ctf_stream_put(struct bt_ctf_stream *stream)
+{
+       bt_ctf_object_put_ref(stream);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE2_CTF_WRITER_STREAM_H */
diff --git a/include/babeltrace2-ctf-writer/trace.h b/include/babeltrace2-ctf-writer/trace.h
new file mode 100644 (file)
index 0000000..95e8854
--- /dev/null
@@ -0,0 +1,83 @@
+#ifndef BABELTRACE2_CTF_WRITER_TRACE_H
+#define BABELTRACE2_CTF_WRITER_TRACE_H
+
+/*
+ * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_ctf_trace;
+struct bt_ctf_stream_class;
+struct bt_ctf_stream;
+
+extern enum bt_ctf_byte_order bt_ctf_trace_get_native_byte_order(
+               struct bt_ctf_trace *trace);
+
+extern int bt_ctf_trace_set_native_byte_order(struct bt_ctf_trace *trace,
+               enum bt_ctf_byte_order native_byte_order);
+
+extern const uint8_t *bt_ctf_trace_get_uuid(
+               struct bt_ctf_trace *trace);
+
+extern int bt_ctf_trace_set_uuid(struct bt_ctf_trace *trace,
+               const uint8_t *uuid);
+
+extern int bt_ctf_trace_set_environment_field_integer(
+               struct bt_ctf_trace *trace, const char *name,
+               int64_t value);
+
+extern int bt_ctf_trace_set_environment_field_string(
+               struct bt_ctf_trace *trace, const char *name,
+               const char *value);
+
+extern struct bt_ctf_field_type *bt_ctf_trace_get_packet_header_field_type(
+               struct bt_ctf_trace *trace);
+
+extern int bt_ctf_trace_set_packet_header_field_type(struct bt_ctf_trace *trace,
+               struct bt_ctf_field_type *packet_header_type);
+
+extern int64_t bt_ctf_trace_get_stream_class_count(
+               struct bt_ctf_trace *trace);
+
+extern struct bt_ctf_stream_class *bt_ctf_trace_get_stream_class_by_index(
+               struct bt_ctf_trace *trace, uint64_t index);
+
+extern struct bt_ctf_stream_class *bt_ctf_trace_get_stream_class_by_id(
+               struct bt_ctf_trace *trace, uint64_t id);
+
+extern int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
+               struct bt_ctf_stream_class *stream_class);
+
+extern int64_t bt_ctf_trace_get_stream_count(struct bt_ctf_trace *trace);
+
+extern struct bt_ctf_stream *bt_ctf_trace_get_stream_by_index(
+               struct bt_ctf_trace *trace, uint64_t index);
+
+extern const char *bt_ctf_trace_get_name(struct bt_ctf_trace *trace);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE2_CTF_WRITER_TRACE_H */
diff --git a/include/babeltrace2-ctf-writer/types.h b/include/babeltrace2-ctf-writer/types.h
new file mode 100644 (file)
index 0000000..c45b2b1
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef BABELTRACE2_CTF_WRITER_TYPES_H
+#define BABELTRACE2_CTF_WRITER_TYPES_H
+
+/*
+ * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/// False boolean value for the #bt_ctf_bool type.
+#define BT_CTF_FALSE    0
+
+/// True boolean value for the #bt_ctf_bool type.
+#define BT_CTF_TRUE     1
+
+typedef int bt_ctf_bool;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE2_CTF_WRITER_TYPES_H */
diff --git a/include/babeltrace2-ctf-writer/utils.h b/include/babeltrace2-ctf-writer/utils.h
new file mode 100644 (file)
index 0000000..e39d009
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef BABELTRACE2_CTF_WRITER_UTILS_H
+#define BABELTRACE2_CTF_WRITER_UTILS_H
+
+/*
+ * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/* For bt_ctf_bool */
+#include <babeltrace2-ctf-writer/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern bt_ctf_bool bt_ctf_identifier_is_valid(const char *identifier);
+
+static inline
+int bt_ctf_validate_identifier(const char *identifier)
+{
+       return bt_ctf_identifier_is_valid(identifier) ? 1 : 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE2_CTF_WRITER_UTILS_H */
diff --git a/include/babeltrace2-ctf-writer/visitor.h b/include/babeltrace2-ctf-writer/visitor.h
new file mode 100644 (file)
index 0000000..c2fb0da
--- /dev/null
@@ -0,0 +1,168 @@
+#ifndef BABELTRACE2_CTF_WRITER_VISITOR_H
+#define BABELTRACE2_CTF_WRITER_VISITOR_H
+
+/*
+ * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+@defgroup ctfirvisitor CTF IR visitor
+@ingroup ctfir
+@brief CTF IR visitor.
+
+@code
+#include <babeltrace2/trace-ir/visitor.h>
+@endcode
+
+A CTF IR <strong><em>visitor</em></strong> is a function that you
+can use to visit the hierarchy of a
+\link ctfirtraceclass CTF IR trace class\endlink with
+bt_ctf_trace_visit() or of a
+\link ctfirstreamclass CTF IR stream class\endlink with
+bt_ctf_stream_class_visit().
+
+The traversal of the object's hierarchy is always done in a
+pre-order fashion.
+
+@sa ctfirstreamclass
+@sa ctfirtraceclass
+
+@file
+@brief CTF IR visitor types and functions.
+@sa ctfirvisitor
+
+@addtogroup ctfirvisitor
+@{
+*/
+
+/**
+@struct bt_ctf_object
+@brief A CTF IR object wrapper.
+
+This structure wraps both a CTF IR object and its type
+(see #bt_ctf_object_type). It is used in the visiting function.
+
+You can use the bt_ctf_object_get_type() and
+bt_ctf_object_get_object() accessors to get the type and wrapped
+CTF IR object of a CTF IR object wrapper.
+
+A CTF IR object wrapper has <strong>no reference count</strong>: do \em
+not use bt_ctf_object_put_ref() or bt_ctf_object_get_ref() on it.
+
+@sa ctfirvisitor
+*/
+struct bt_ctf_visitor_object;
+
+/**
+@brief CTF IR object wrapper type.
+*/
+enum bt_ctf_visitor_object_type {
+       /// Unknown (used for errors).
+       BT_CTF_VISITOR_OBJECT_TYPE_UNKNOWN = -1,
+
+       /// \ref ctfirtraceclass.
+       BT_CTF_VISITOR_OBJECT_TYPE_TRACE = 0,
+
+       /// \ref ctfirstreamclass.
+       BT_CTF_VISITOR_OBJECT_TYPE_STREAM_CLASS = 1,
+
+       /// \ref ctfirstream.
+       BT_CTF_VISITOR_OBJECT_TYPE_STREAM = 2,
+
+       /// \ref ctfireventclass.
+       BT_CTF_VISITOR_OBJECT_TYPE_EVENT_CLASS = 3,
+
+       /// \ref ctfirevent.
+       BT_CTF_VISITOR_OBJECT_TYPE_EVENT = 4,
+
+       /// Number of entries in this enumeration.
+       BT_CTF_VISITOR_OBJECT_TYPE_NR,
+};
+
+/**
+@brief Visting function type.
+
+A function of this type is called by bt_ctf_trace_visit() or
+bt_ctf_stream_class_visit() when visiting the CTF IR object wrapper
+\p object.
+
+\p object has <strong>no reference count</strong>: do \em not use
+bt_ctf_object_put_ref() or bt_ctf_object_get_ref() on it.
+
+@param[in] object      Currently visited CTF IR object wrapper.
+@param[in] data                User data.
+@returns               0 on success, or a negative value on error.
+
+@prenotnull{object}
+
+@sa bt_ctf_trace_visit(): Accepts a visitor to visit a trace class.
+@sa bt_ctf_stream_class_visit(): Accepts a visitor to visit a stream
+       class.
+*/
+typedef int (*bt_ctf_visitor)(struct bt_ctf_visitor_object *object,
+               void *data);
+
+/**
+@brief Returns the type of the CTF IR object wrapped by the CTF IR
+       object wrapper \p object.
+
+@param[in] object      Object wrapper of which to get the type.
+@returns               Type of \p object.
+
+@prenotnull{object}
+
+@sa bt_ctf_visitor_object_get_object(): Returns the object wrapped by a given
+       CTF IR object wrapper.
+*/
+enum bt_ctf_visitor_object_type bt_ctf_visitor_object_get_type(
+               struct bt_ctf_visitor_object *object);
+
+/**
+@brief Returns the CTF IR object wrapped by the CTF IR object
+       wrapper \p object.
+
+The reference count of \p object is \em not incremented by this
+function. On success, you must call bt_ctf_object_get_ref() on the return value to
+have your own reference.
+
+@param[in] object      Object wrapper of which to get the wrapped
+                       CTF IR object.
+@returns               CTF IR object wrapped by \p object.
+
+@prenotnull{object}
+@post The reference count of the returned object is not modified.
+
+@sa bt_ctf_visitor_object_get_type(): Returns the type of a given
+       CTF IR object wrapper.
+*/
+void *bt_ctf_visitor_object_get_object(struct bt_ctf_visitor_object *object);
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE2_CTF_WRITER_VISITOR_H */
diff --git a/include/babeltrace2-ctf-writer/writer.h b/include/babeltrace2-ctf-writer/writer.h
new file mode 100644 (file)
index 0000000..7718d25
--- /dev/null
@@ -0,0 +1,199 @@
+#ifndef BABELTRACE2_CTF_WRITER_WRITER_H
+#define BABELTRACE2_CTF_WRITER_WRITER_H
+
+/*
+ * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace2-ctf-writer/field-types.h>
+#include <babeltrace2-ctf-writer/stream-class.h>
+#include <babeltrace2-ctf-writer/stream.h>
+#include <babeltrace2-ctf-writer/trace.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_ctf_writer;
+struct bt_ctf_stream;
+struct bt_ctf_stream_class;
+struct bt_ctf_clock;
+
+/*
+ * bt_ctf_writer_create: create a writer instance.
+ *
+ * Allocate a new writer that will produce a trace in the given path.
+ * The creation of a writer sets its reference count to 1.
+ *
+ * @param path Path to the trace's containing folder (string is copied).
+ *
+ * Returns an allocated writer on success, NULL on error.
+ */
+extern struct bt_ctf_writer *bt_ctf_writer_create(const char *path);
+
+/*
+ * bt_ctf_writer_get_trace: Get a writer's associated trace.
+ *
+ * @param writer Writer instance.
+ *
+ * Return the writer's associated instance, NULL on error.
+ */
+extern struct bt_ctf_trace *bt_ctf_writer_get_trace(
+               struct bt_ctf_writer *writer);
+
+/*
+ * bt_ctf_writer_create_stream: create a stream instance.
+ *
+ * Allocate a new stream instance and register it to the writer. The creation of
+ * a stream sets its reference count to 1.
+ *
+ * @param writer Writer instance.
+ * @param stream_class Stream class to instantiate.
+ *
+ * Returns an allocated stream on success, NULL on error.
+ */
+extern struct bt_ctf_stream *bt_ctf_writer_create_stream(
+               struct bt_ctf_writer *writer,
+               struct bt_ctf_stream_class *stream_class);
+
+/*
+ * bt_ctf_writer_add_environment_field: add an environment field to the trace.
+ *
+ * Add an environment field to the trace. The name and value parameters are
+ * copied.
+ *
+ * @param writer Writer instance.
+ * @param name Name of the environment field (will be copied).
+ * @param value Value of the environment field (will be copied).
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_ctf_writer_add_environment_field(struct bt_ctf_writer *writer,
+               const char *name,
+               const char *value);
+
+/*
+ * bt_ctf_writer_add_environment_field_int64: add an environment field to the trace.
+ *
+ * Add an environment field to the trace. The name and value parameters are
+ * copied.
+ *
+ * @param writer Writer instance.
+ * @param name Name of the environment field (will be copied).
+ * @param value Value of the environment field.
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_ctf_writer_add_environment_field_int64(
+               struct bt_ctf_writer *writer,
+               const char *name,
+               int64_t value);
+
+/*
+ * bt_ctf_writer_add_clock: add a clock to the trace.
+ *
+ * Add a clock to the trace. Clocks assigned to stream classes must be
+ * registered to the writer.
+ *
+ * @param writer Writer instance.
+ * @param clock Clock to add to the trace.
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_ctf_writer_add_clock(struct bt_ctf_writer *writer,
+               struct bt_ctf_clock *clock);
+
+/*
+ * bt_ctf_writer_get_metadata_string: get meta-data string.
+ *
+ * Get the trace's TSDL meta-data. The caller assumes the ownership of the
+ * returned string.
+ *
+ * @param writer Writer instance.
+ *
+ * Returns the metadata string on success, NULL on error.
+ */
+extern char *bt_ctf_writer_get_metadata_string(struct bt_ctf_writer *writer);
+
+/*
+ * bt_ctf_writer_flush_metadata: flush the trace's metadata to disk.
+ *
+ * Flush the trace's metadata to the metadata file. Note that the metadata will
+ * be flushed automatically when the Writer instance is released (last call to
+ * bt_ctf_writer_put).
+ *
+ * @param writer Writer instance.
+ */
+extern void bt_ctf_writer_flush_metadata(struct bt_ctf_writer *writer);
+
+/*
+ * bt_ctf_writer_set_byte_order: set a field type's byte order.
+ *
+ * Set the trace's byte order. Defaults to the host machine's endianness.
+ *
+ * @param writer Writer instance.
+ * @param byte_order Trace's byte order.
+ *
+ * Returns 0 on success, a negative value on error.
+ *
+ * Note: byte_order must not be BT_CTF_BYTE_ORDER_NATIVE since, according
+ * to the CTF specification, is defined as "the byte order described in the
+ * trace description".
+ */
+extern int bt_ctf_writer_set_byte_order(struct bt_ctf_writer *writer,
+               enum bt_ctf_byte_order byte_order);
+
+/*
+ * bt_ctf_writer_get and bt_ctf_writer_put: increment and decrement the
+ * writer's reference count.
+ *
+ * You may also use bt_ctf_get() and bt_ctf_put() with writer objects.
+ *
+ * These functions ensure that the writer won't be destroyed while it
+ * is in use. The same number of get and put (plus one extra put to
+ * release the initial reference done at creation) have to be done to
+ * destroy a writer.
+ *
+ * When the writer's reference count is decremented to 0 by a
+ * bt_ctf_writer_put, the writer is freed.
+ *
+ * @param writer Writer instance.
+ */
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+void bt_ctf_writer_get(struct bt_ctf_writer *writer)
+{
+       bt_ctf_object_get_ref(writer);
+}
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+void bt_ctf_writer_put(struct bt_ctf_writer *writer)
+{
+       bt_ctf_object_put_ref(writer);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE2_CTF_WRITER_WRITER_H */
diff --git a/include/babeltrace2/ctf-writer/clock-class.h b/include/babeltrace2/ctf-writer/clock-class.h
deleted file mode 100644 (file)
index c73f7e9..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-#ifndef BABELTRACE2_CTF_WRITER_CLOCK_CLASS_H
-#define BABELTRACE2_CTF_WRITER_CLOCK_CLASS_H
-
-/*
- * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_ctf_clock_class;
-
-extern struct bt_ctf_clock_class *bt_ctf_clock_class_create(const char *name,
-                uint64_t freq);
-
-extern const char *bt_ctf_clock_class_get_name(
-                struct bt_ctf_clock_class *clock_class);
-
-extern int bt_ctf_clock_class_set_name(struct bt_ctf_clock_class *clock_class,
-                const char *name);
-
-extern const char *bt_ctf_clock_class_get_description(
-                struct bt_ctf_clock_class *clock_class);
-
-extern int bt_ctf_clock_class_set_description(
-                struct bt_ctf_clock_class *clock_class,
-                const char *desc);
-
-extern uint64_t bt_ctf_clock_class_get_frequency(
-                struct bt_ctf_clock_class *clock_class);
-
-extern int bt_ctf_clock_class_set_frequency(
-                struct bt_ctf_clock_class *clock_class, uint64_t freq);
-
-extern uint64_t bt_ctf_clock_class_get_precision(
-                struct bt_ctf_clock_class *clock_class);
-
-extern int bt_ctf_clock_class_set_precision(
-                struct bt_ctf_clock_class *clock_class, uint64_t precision);
-
-extern int bt_ctf_clock_class_get_offset_s(
-                struct bt_ctf_clock_class *clock_class, int64_t *seconds);
-
-extern int bt_ctf_clock_class_set_offset_s(
-                struct bt_ctf_clock_class *clock_class, int64_t seconds);
-
-extern int bt_ctf_clock_class_get_offset_cycles(
-                struct bt_ctf_clock_class *clock_class, int64_t *cycles);
-
-extern int bt_ctf_clock_class_set_offset_cycles(
-                struct bt_ctf_clock_class *clock_class, int64_t cycles);
-
-extern bt_ctf_bool bt_ctf_clock_class_is_absolute(
-                struct bt_ctf_clock_class *clock_class);
-
-extern int bt_ctf_clock_class_set_is_absolute(
-                struct bt_ctf_clock_class *clock_class, bt_ctf_bool is_absolute);
-
-extern const uint8_t *bt_ctf_clock_class_get_uuid(
-                struct bt_ctf_clock_class *clock_class);
-
-extern int bt_ctf_clock_class_set_uuid(struct bt_ctf_clock_class *clock_class,
-                const uint8_t *uuid);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE2_CTF_WRITER_CLOCK_CLASS_H */
diff --git a/include/babeltrace2/ctf-writer/clock.h b/include/babeltrace2/ctf-writer/clock.h
deleted file mode 100644 (file)
index 0f1bfa1..0000000
+++ /dev/null
@@ -1,282 +0,0 @@
-#ifndef BABELTRACE2_CTF_WRITER_CLOCK_H
-#define BABELTRACE2_CTF_WRITER_CLOCK_H
-
-/*
- * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdint.h>
-#include <babeltrace2/ctf-writer/object.h>
-#include <babeltrace2/ctf-writer/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_ctf_clock;
-struct bt_ctf_clock_class;
-
-/*
- * bt_ctf_clock_create: create a clock.
- *
- * Allocate a new clock setting its reference count to 1.
- *
- * @param name Name of the clock (will be copied); can be set to NULL
- *             for nameless clocks.
- *
- * Returns an allocated clock on success, NULL on error.
- */
-extern struct bt_ctf_clock *bt_ctf_clock_create(const char *name);
-
-/*
- * bt_ctf_clock_get_name: get a clock's name.
- *
- * Get the clock's name.
- *
- * @param clock Clock instance.
- *
- * Returns the clock's name, NULL on error.
- */
-extern const char *bt_ctf_clock_get_name(struct bt_ctf_clock *clock);
-
-/*
- * bt_ctf_clock_get_description: get a clock's description.
- *
- * Get the clock's description.
- *
- * @param clock Clock instance.
- *
- * Returns the clock's description, NULL if unset.
- */
-extern const char *bt_ctf_clock_get_description(struct bt_ctf_clock *clock);
-
-/*
- * bt_ctf_clock_set_description: set a clock's description.
- *
- * Set the clock's description. The description appears in the clock's TSDL
- * meta-data.
- *
- * @param clock Clock instance.
- * @param desc Description of the clock.
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_ctf_clock_set_description(struct bt_ctf_clock *clock,
-        const char *desc);
-
-/*
- * bt_ctf_clock_get_frequency: get a clock's frequency.
- *
- * Get the clock's frequency (Hz).
- *
- * @param clock Clock instance.
- *
- * Returns the clock's frequency, -1ULL on error.
- */
-extern uint64_t bt_ctf_clock_get_frequency(struct bt_ctf_clock *clock);
-
-/*
- * bt_ctf_clock_set_frequency: set a clock's frequency.
- *
- * Set the clock's frequency (Hz).
- *
- * @param clock Clock instance.
- * @param freq Clock's frequency in Hz, defaults to 1 000 000 000 Hz (1ns).
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_ctf_clock_set_frequency(struct bt_ctf_clock *clock,
-        uint64_t freq);
-
-/*
- * bt_ctf_clock_get_precision: get a clock's precision.
- *
- * Get the clock's precision (in clock ticks).
- *
- * @param clock Clock instance.
- *
- * Returns the clock's precision, -1ULL on error.
- */
-extern uint64_t bt_ctf_clock_get_precision(struct bt_ctf_clock *clock);
-
-/*
- * bt_ctf_clock_set_precision: set a clock's precision.
- *
- * Set the clock's precision.
- *
- * @param clock Clock instance.
- * @param precision Clock's precision in clock ticks, defaults to 1.
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_ctf_clock_set_precision(struct bt_ctf_clock *clock,
-        uint64_t precision);
-
-/*
- * bt_ctf_clock_get_offset_s: get a clock's offset in seconds.
- *
- * Get the clock's offset in seconds from POSIX.1 Epoch, 1970-01-01.
- *
- * @param clock Clock instance.
- * @param offset_s Pointer to clock offset in seconds (output).
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_ctf_clock_get_offset_s(struct bt_ctf_clock *clock,
-        int64_t *offset_s);
-
-/*
- * bt_ctf_clock_set_offset_s: set a clock's offset in seconds.
- *
- * Set the clock's offset in seconds from POSIX.1 Epoch, 1970-01-01,
- * defaults to 0.
- *
- * @param clock Clock instance.
- * @param offset_s Clock's offset in seconds, defaults to 0.
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_ctf_clock_set_offset_s(struct bt_ctf_clock *clock,
-        int64_t offset_s);
-
-/*
- * bt_ctf_clock_get_offset: get a clock's offset in ticks.
- *
- * Get the clock's offset in ticks from Epoch + offset_t.
- *
- * @param clock Clock instance.
- * @param offset Clock offset in ticks from Epoch + offset_s (output).
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_ctf_clock_get_offset(struct bt_ctf_clock *clock,
-        int64_t *offset);
-
-/*
- * bt_ctf_clock_set_offset: set a clock's offset in ticks.
- *
- * Set the clock's offset in ticks from Epoch + offset_s.
- *
- * @param clock Clock instance.
- * @param offset Clock's offset in ticks from Epoch + offset_s, defaults to 0.
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_ctf_clock_set_offset(struct bt_ctf_clock *clock,
-        int64_t offset);
-
-/*
- * bt_ctf_clock_get_is_absolute: get a clock's absolute attribute.
- *
- * Get the clock's absolute attribute. A clock is absolute if the clock is a
- * global reference across the trace's other clocks.
- *
- * @param clock Clock instance.
- *
- * Returns the clock's absolute attribute, a negative value on error.
- */
-extern int bt_ctf_clock_get_is_absolute(struct bt_ctf_clock *clock);
-
-/*
- * bt_ctf_clock_set_is_absolute: set a clock's absolute attribute.
- *
- * Set the clock's absolute attribute. A clock is absolute if the clock is a
- * global reference across the trace's other clocks.
- *
- * @param clock Clock instance.
- * @param is_absolute Clock's absolute attribute, defaults to FALSE.
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_ctf_clock_set_is_absolute(struct bt_ctf_clock *clock,
-        int is_absolute);
-
-/*
- * bt_ctf_clock_get_uuid: get a clock's UUID.
- *
- * Get the clock's UUID.
- *
- * @param clock Clock instance.
- *
- * Returns a pointer to the clock's UUID (16 byte array) on success,
- * NULL on error.
- */
-extern const uint8_t *bt_ctf_clock_get_uuid(struct bt_ctf_clock *clock);
-
-/*
- * bt_ctf_clock_set_uuid: set a clock's UUID.
- *
- * Set a clock's UUID.
- *
- * @param clock Clock instance.
- * @param uuid A 16-byte array containing a UUID.
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_ctf_clock_set_uuid(struct bt_ctf_clock *clock,
-        const uint8_t *uuid);
-
-/*
- * bt_ctf_clock_set_time: set a clock's current time value.
- *
- * Set the current time in nanoseconds since the clock's origin (offset and
- * offset_s attributes). Defaults to 0.
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_ctf_clock_set_time(struct bt_ctf_clock *clock,
-               int64_t time);
-
-/*
- * bt_ctf_clock_get and bt_ctf_clock_put: increment and decrement the
- * refcount of the clock
- *
- * You may also use bt_ctf_get() and bt_ctf_put() with clock objects.
- *
- * These functions ensure that the clock won't be destroyed when it
- * is in use. The same number of get and put (plus one extra put to
- * release the initial reference done at creation) has to be done to
- * destroy a clock.
- *
- * When the clock refcount is decremented to 0 by a bt_ctf_clock_put,
- * the clock is freed.
- *
- * @param clock Clock instance.
- */
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-void bt_ctf_clock_get(struct bt_ctf_clock *clock)
-{
-        bt_ctf_object_get_ref(clock);
-}
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-void bt_ctf_clock_put(struct bt_ctf_clock *clock)
-{
-        bt_ctf_object_put_ref(clock);
-}
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE2_CTF_WRITER_CLOCK_H */
diff --git a/include/babeltrace2/ctf-writer/event-fields.h b/include/babeltrace2/ctf-writer/event-fields.h
deleted file mode 100644 (file)
index 568e387..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#ifndef BABELTRACE2_CTF_WRITER_EVENT_FIELDS_H
-#define BABELTRACE2_CTF_WRITER_EVENT_FIELDS_H
-
-/*
- * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace2/ctf-writer/object.h>
-#include <babeltrace2/ctf-writer/field-types.h>
-#include <babeltrace2/ctf-writer/fields.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * bt_ctf_field_get and bt_ctf_field_put: increment and decrement the
- * field's reference count.
- *
- * You may also use bt_ctf_object_get_ref() and bt_ctf_object_put_ref() with field objects.
- *
- * These functions ensure that the field won't be destroyed when it
- * is in use. The same number of get and put (plus one extra put to
- * release the initial reference done at creation) have to be done to
- * destroy a field.
- *
- * When the field's reference count is decremented to 0 by a bt_ctf_field_put,
- * the field is freed.
- *
- * @param field Field instance.
- */
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-void bt_ctf_field_get(struct bt_ctf_field *field)
-{
-       bt_ctf_object_get_ref(field);
-}
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-void bt_ctf_field_put(struct bt_ctf_field *field)
-{
-       bt_ctf_object_put_ref(field);
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE2_CTF_WRITER_EVENT_FIELDS_H */
diff --git a/include/babeltrace2/ctf-writer/event-types.h b/include/babeltrace2/ctf-writer/event-types.h
deleted file mode 100644 (file)
index db863ed..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef BABELTRACE2_CTF_WRITER_EVENT_TYPES_H
-#define BABELTRACE2_CTF_WRITER_EVENT_TYPES_H
-
-/*
- * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace2/ctf-writer/object.h>
-#include <babeltrace2/ctf-writer/field-types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * bt_ctf_field_type_get and bt_ctf_field_type_put: increment and decrement
- * the field type's reference count.
- *
- * You may also use bt_ctf_object_get_ref() and bt_ctf_object_put_ref() with field type objects.
- *
- * These functions ensure that the field type won't be destroyed while it
- * is in use. The same number of get and put (plus one extra put to
- * release the initial reference done at creation) have to be done to
- * destroy a field type.
- *
- * When the field type's reference count is decremented to 0 by a
- * bt_ctf_field_type_put, the field type is freed.
- *
- * @param type Field type.
- */
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-void bt_ctf_field_type_get(struct bt_ctf_field_type *type)
-{
-       bt_ctf_object_get_ref(type);
-}
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-void bt_ctf_field_type_put(struct bt_ctf_field_type *type)
-{
-       bt_ctf_object_put_ref(type);
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE2_CTF_WRITER_EVENT_TYPES_H */
diff --git a/include/babeltrace2/ctf-writer/event.h b/include/babeltrace2/ctf-writer/event.h
deleted file mode 100644 (file)
index 3e0965b..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-#ifndef BABELTRACE2_CTF_WRITER_EVENT_H
-#define BABELTRACE2_CTF_WRITER_EVENT_H
-
-/*
- * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace2/ctf-writer/object.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_ctf_event;
-struct bt_ctf_event_class;
-struct bt_ctf_stream;
-struct bt_ctf_field;
-struct bt_ctf_field_type;
-
-enum bt_ctf_event_class_log_level {
-       /// Unknown, used for errors.
-       BT_CTF_EVENT_CLASS_LOG_LEVEL_UNKNOWN            = -1,
-
-       /// Unspecified log level.
-       BT_CTF_EVENT_CLASS_LOG_LEVEL_UNSPECIFIED        = 255,
-
-       /// System is unusable.
-       BT_CTF_EVENT_CLASS_LOG_LEVEL_EMERGENCY          = 0,
-
-       /// Action must be taken immediately.
-       BT_CTF_EVENT_CLASS_LOG_LEVEL_ALERT              = 1,
-
-       /// Critical conditions.
-       BT_CTF_EVENT_CLASS_LOG_LEVEL_CRITICAL           = 2,
-
-       /// Error conditions.
-       BT_CTF_EVENT_CLASS_LOG_LEVEL_ERROR              = 3,
-
-       /// Warning conditions.
-       BT_CTF_EVENT_CLASS_LOG_LEVEL_WARNING            = 4,
-
-       /// Normal, but significant, condition.
-       BT_CTF_EVENT_CLASS_LOG_LEVEL_NOTICE             = 5,
-
-       /// Informational message.
-       BT_CTF_EVENT_CLASS_LOG_LEVEL_INFO               = 6,
-
-       /// Debug information with system-level scope (set of programs).
-       BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_SYSTEM       = 7,
-
-       /// Debug information with program-level scope (set of processes).
-       BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_PROGRAM      = 8,
-
-       /// Debug information with process-level scope (set of modules).
-       BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_PROCESS      = 9,
-
-       /// Debug information with module (executable/library) scope (set of units).
-       BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_MODULE       = 10,
-
-       /// Debug information with compilation unit scope (set of functions).
-       BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_UNIT         = 11,
-
-       /// Debug information with function-level scope.
-       BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_FUNCTION     = 12,
-
-       /// Debug information with line-level scope (default log level).
-       BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_LINE         = 13,
-
-       /// Debug-level message.
-       BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG              = 14,
-};
-
-extern struct bt_ctf_event *bt_ctf_event_create(
-               struct bt_ctf_event_class *event_class);
-
-extern struct bt_ctf_field *bt_ctf_event_get_payload(struct bt_ctf_event *event,
-               const char *name);
-
-extern int bt_ctf_event_set_payload(struct bt_ctf_event *event,
-               const char *name, struct bt_ctf_field *field);
-
-extern struct bt_ctf_field *bt_ctf_event_get_payload_field(
-               struct bt_ctf_event *event);
-
-extern int bt_ctf_event_set_payload_field(struct bt_ctf_event *event,
-               struct bt_ctf_field *field);
-
-extern int bt_ctf_event_set_context(struct bt_ctf_event *event,
-               struct bt_ctf_field *field);
-
-extern struct bt_ctf_field *bt_ctf_event_get_context(
-               struct bt_ctf_event *event);
-
-extern int bt_ctf_event_set_stream_event_context(struct bt_ctf_event *event,
-               struct bt_ctf_field *field);
-
-extern struct bt_ctf_field *bt_ctf_event_get_stream_event_context(
-               struct bt_ctf_event *event);
-
-extern int bt_ctf_event_set_header(struct bt_ctf_event *event,
-               struct bt_ctf_field *field);
-
-extern struct bt_ctf_field *bt_ctf_event_get_header(
-               struct bt_ctf_event *event);
-
-extern struct bt_ctf_stream *bt_ctf_event_get_stream(
-               struct bt_ctf_event *event);
-
-extern struct bt_ctf_event_class *bt_ctf_event_get_class(
-               struct bt_ctf_event *event);
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-void bt_ctf_event_get(struct bt_ctf_event *event)
-{
-       bt_ctf_object_get_ref(event);
-}
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-void bt_ctf_event_put(struct bt_ctf_event *event)
-{
-       bt_ctf_object_put_ref(event);
-}
-
-extern struct bt_ctf_event_class *bt_ctf_event_class_create(const char *name);
-
-extern struct bt_ctf_stream_class *bt_ctf_event_class_get_stream_class(
-               struct bt_ctf_event_class *event_class);
-
-extern const char *bt_ctf_event_class_get_name(
-               struct bt_ctf_event_class *event_class);
-
-extern int64_t bt_ctf_event_class_get_id(
-               struct bt_ctf_event_class *event_class);
-
-extern int bt_ctf_event_class_set_id(
-               struct bt_ctf_event_class *event_class, uint64_t id);
-
-extern enum bt_ctf_event_class_log_level bt_ctf_event_class_get_log_level(
-               struct bt_ctf_event_class *event_class);
-
-extern int bt_ctf_event_class_set_log_level(
-               struct bt_ctf_event_class *event_class,
-               enum bt_ctf_event_class_log_level log_level);
-
-extern const char *bt_ctf_event_class_get_emf_uri(
-               struct bt_ctf_event_class *event_class);
-
-extern int bt_ctf_event_class_set_emf_uri(
-               struct bt_ctf_event_class *event_class,
-               const char *emf_uri);
-
-extern struct bt_ctf_field_type *bt_ctf_event_class_get_context_field_type(
-               struct bt_ctf_event_class *event_class);
-
-extern int bt_ctf_event_class_set_context_field_type(
-               struct bt_ctf_event_class *event_class,
-               struct bt_ctf_field_type *context_type);
-
-extern struct bt_ctf_field_type *bt_ctf_event_class_get_payload_field_type(
-               struct bt_ctf_event_class *event_class);
-
-extern int bt_ctf_event_class_set_payload_field_type(
-               struct bt_ctf_event_class *event_class,
-               struct bt_ctf_field_type *payload_type);
-
-extern int bt_ctf_event_class_add_field(struct bt_ctf_event_class *event_class,
-               struct bt_ctf_field_type *field_type,
-               const char *name);
-
-extern struct bt_ctf_field_type *bt_ctf_event_class_get_field_by_name(
-               struct bt_ctf_event_class *event_class, const char *name);
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-void bt_ctf_event_class_get(struct bt_ctf_event_class *event_class)
-{
-       bt_ctf_object_get_ref(event_class);
-}
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-void bt_ctf_event_class_put(struct bt_ctf_event_class *event_class)
-{
-       bt_ctf_object_put_ref(event_class);
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE2_CTF_WRITER_EVENT_H */
diff --git a/include/babeltrace2/ctf-writer/field-types.h b/include/babeltrace2/ctf-writer/field-types.h
deleted file mode 100644 (file)
index 10b1033..0000000
+++ /dev/null
@@ -1,339 +0,0 @@
-#ifndef BABELTRACE2_CTF_WRITER_FIELD_TYPES_H
-#define BABELTRACE2_CTF_WRITER_FIELD_TYPES_H
-
-/*
- * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdint.h>
-#include <stddef.h>
-#include <babeltrace2/ctf-writer/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_ctf_field;
-struct bt_ctf_field_type;
-
-enum bt_ctf_scope {
-       /// Unknown, used for errors.
-       BT_CTF_SCOPE_UNKNOWN                    = -1,
-
-       /// Trace packet header.
-       BT_CTF_SCOPE_TRACE_PACKET_HEADER        = 1,
-
-       /// Stream packet context.
-       BT_CTF_SCOPE_STREAM_PACKET_CONTEXT      = 2,
-
-       /// Stream event header.
-       BT_CTF_SCOPE_STREAM_EVENT_HEADER        = 3,
-
-       /// Stream event context.
-       BT_CTF_SCOPE_STREAM_EVENT_CONTEXT       = 4,
-
-       /// Event context.
-       BT_CTF_SCOPE_EVENT_CONTEXT              = 5,
-
-       /// Event payload.
-       BT_CTF_SCOPE_EVENT_PAYLOAD              = 6,
-
-       /// @cond DOCUMENT
-       BT_CTF_SCOPE_ENV                        = 0,
-       BT_CTF_SCOPE_EVENT_FIELDS               = 6,
-       /// @endcond
-};
-
-enum bt_ctf_field_type_id {
-       BT_CTF_FIELD_TYPE_ID_UNKNOWN    = -1,
-       BT_CTF_FIELD_TYPE_ID_INTEGER    = 0,
-       BT_CTF_FIELD_TYPE_ID_FLOAT      = 1,
-       BT_CTF_FIELD_TYPE_ID_ENUM       = 2,
-       BT_CTF_FIELD_TYPE_ID_STRING     = 3,
-       BT_CTF_FIELD_TYPE_ID_STRUCT     = 4,
-       BT_CTF_FIELD_TYPE_ID_ARRAY      = 5,
-       BT_CTF_FIELD_TYPE_ID_SEQUENCE   = 6,
-       BT_CTF_FIELD_TYPE_ID_VARIANT    = 7,
-       BT_CTF_FIELD_TYPE_ID_NR,
-};
-
-extern enum bt_ctf_field_type_id bt_ctf_field_type_get_type_id(
-               struct bt_ctf_field_type *field_type);
-
-enum bt_ctf_byte_order {
-       BT_CTF_BYTE_ORDER_UNKNOWN               = -1,
-       BT_CTF_BYTE_ORDER_NATIVE                = 0,
-       BT_CTF_BYTE_ORDER_UNSPECIFIED,
-       BT_CTF_BYTE_ORDER_LITTLE_ENDIAN,
-       BT_CTF_BYTE_ORDER_BIG_ENDIAN,
-       BT_CTF_BYTE_ORDER_NETWORK,
-};
-
-enum bt_ctf_string_encoding {
-       BT_CTF_STRING_ENCODING_UNKNOWN  = -1,
-       BT_CTF_STRING_ENCODING_NONE,
-       BT_CTF_STRING_ENCODING_UTF8,
-       BT_CTF_STRING_ENCODING_ASCII,
-};
-
-/* Pre-2.0 CTF writer compatibility */
-#define ctf_string_encoding    bt_ctf_string_encoding
-
-extern int bt_ctf_field_type_get_alignment(
-               struct bt_ctf_field_type *field_type);
-
-extern int bt_ctf_field_type_set_alignment(struct bt_ctf_field_type *field_type,
-               unsigned int alignment);
-
-extern enum bt_ctf_byte_order bt_ctf_field_type_get_byte_order(
-               struct bt_ctf_field_type *field_type);
-
-extern int bt_ctf_field_type_set_byte_order(
-               struct bt_ctf_field_type *field_type,
-               enum bt_ctf_byte_order byte_order);
-
-enum bt_ctf_integer_base {
-       /// Unknown, used for errors.
-       BT_CTF_INTEGER_BASE_UNKNOWN             = -1,
-
-       /// Unspecified by the tracer.
-       BT_CTF_INTEGER_BASE_UNSPECIFIED         = 0,
-
-       /// Binary.
-       BT_CTF_INTEGER_BASE_BINARY              = 2,
-
-       /// Octal.
-       BT_CTF_INTEGER_BASE_OCTAL               = 8,
-
-       /// Decimal.
-       BT_CTF_INTEGER_BASE_DECIMAL             = 10,
-
-       /// Hexadecimal.
-       BT_CTF_INTEGER_BASE_HEXADECIMAL         = 16,
-};
-
-extern struct bt_ctf_field_type *bt_ctf_field_type_integer_create(
-               unsigned int size);
-
-extern int bt_ctf_field_type_integer_get_size(
-               struct bt_ctf_field_type *int_field_type);
-
-extern int bt_ctf_field_type_integer_set_size(
-               struct bt_ctf_field_type *int_field_type, unsigned int size);
-
-extern bt_ctf_bool bt_ctf_field_type_integer_is_signed(
-               struct bt_ctf_field_type *int_field_type);
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-int bt_ctf_field_type_integer_get_signed(
-               struct bt_ctf_field_type *int_field_type)
-{
-       return bt_ctf_field_type_integer_is_signed(int_field_type) ? 1 : 0;
-}
-
-extern int bt_ctf_field_type_integer_set_is_signed(
-               struct bt_ctf_field_type *int_field_type, bt_ctf_bool is_signed);
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-int bt_ctf_field_type_integer_set_signed(
-               struct bt_ctf_field_type *int_field_type, int is_signed)
-{
-       return bt_ctf_field_type_integer_set_is_signed(int_field_type,
-               is_signed ? BT_CTF_TRUE : BT_CTF_FALSE);
-}
-
-extern enum bt_ctf_integer_base bt_ctf_field_type_integer_get_base(
-               struct bt_ctf_field_type *int_field_type);
-
-extern int bt_ctf_field_type_integer_set_base(
-               struct bt_ctf_field_type *int_field_type,
-               enum bt_ctf_integer_base base);
-
-extern enum bt_ctf_string_encoding bt_ctf_field_type_integer_get_encoding(
-               struct bt_ctf_field_type *int_field_type);
-
-extern int bt_ctf_field_type_integer_set_encoding(
-               struct bt_ctf_field_type *int_field_type,
-               enum bt_ctf_string_encoding encoding);
-
-extern struct bt_ctf_clock_class *bt_ctf_field_type_integer_get_mapped_clock_class(
-               struct bt_ctf_field_type *int_field_type);
-
-extern int bt_ctf_field_type_integer_set_mapped_clock_class(
-               struct bt_ctf_field_type *int_field_type,
-               struct bt_ctf_clock_class *clock_class);
-
-extern struct bt_ctf_field_type *bt_ctf_field_type_floating_point_create(void);
-
-extern int bt_ctf_field_type_floating_point_get_exponent_digits(
-               struct bt_ctf_field_type *float_field_type);
-
-extern int bt_ctf_field_type_floating_point_set_exponent_digits(
-               struct bt_ctf_field_type *float_field_type,
-               unsigned int exponent_size);
-
-extern int bt_ctf_field_type_floating_point_get_mantissa_digits(
-               struct bt_ctf_field_type *float_field_type);
-
-extern int bt_ctf_field_type_floating_point_set_mantissa_digits(
-               struct bt_ctf_field_type *float_field_type,
-               unsigned int mantissa_sign_size);
-
-extern struct bt_ctf_field_type *bt_ctf_field_type_enumeration_create(
-               struct bt_ctf_field_type *int_field_type);
-
-extern
-struct bt_ctf_field_type *bt_ctf_field_type_enumeration_get_container_field_type(
-               struct bt_ctf_field_type *enum_field_type);
-
-extern int64_t bt_ctf_field_type_enumeration_get_mapping_count(
-               struct bt_ctf_field_type *enum_field_type);
-
-extern int bt_ctf_field_type_enumeration_signed_get_mapping_by_index(
-               struct bt_ctf_field_type *enum_field_type, uint64_t index,
-               const char **name, int64_t *range_begin, int64_t *range_end);
-
-extern int bt_ctf_field_type_enumeration_unsigned_get_mapping_by_index(
-               struct bt_ctf_field_type *enum_field_type, uint64_t index,
-               const char **name, uint64_t *range_begin,
-               uint64_t *range_end);
-
-extern int bt_ctf_field_type_enumeration_signed_add_mapping(
-               struct bt_ctf_field_type *enum_field_type,
-               const char *name, int64_t range_begin, int64_t range_end);
-
-extern int bt_ctf_field_type_enumeration_unsigned_add_mapping(
-               struct bt_ctf_field_type *enum_field_type,
-               const char *name, uint64_t range_begin, uint64_t range_end);
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-int bt_ctf_field_type_enumeration_add_mapping(
-               struct bt_ctf_field_type *enumeration, const char *name,
-               int64_t range_start, int64_t range_end)
-{
-       return bt_ctf_field_type_enumeration_signed_add_mapping(enumeration,
-               name, range_start, range_end);
-}
-
-extern struct bt_ctf_field_type *bt_ctf_field_type_string_create(void);
-
-extern enum bt_ctf_string_encoding bt_ctf_field_type_string_get_encoding(
-               struct bt_ctf_field_type *string_field_type);
-
-extern int bt_ctf_field_type_string_set_encoding(
-               struct bt_ctf_field_type *string_field_type,
-               enum bt_ctf_string_encoding encoding);
-
-extern struct bt_ctf_field_type *bt_ctf_field_type_structure_create(void);
-
-extern int64_t bt_ctf_field_type_structure_get_field_count(
-               struct bt_ctf_field_type *struct_field_type);
-
-extern int bt_ctf_field_type_structure_get_field_by_index(
-               struct bt_ctf_field_type *struct_field_type,
-               const char **field_name, struct bt_ctf_field_type **field_type,
-               uint64_t index);
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-int bt_ctf_field_type_structure_get_field(struct bt_ctf_field_type *structure,
-               const char **field_name, struct bt_ctf_field_type **field_type,
-               int index)
-{
-       return bt_ctf_field_type_structure_get_field_by_index(structure,
-               field_name, field_type, (uint64_t) index);
-}
-
-extern
-struct bt_ctf_field_type *bt_ctf_field_type_structure_get_field_type_by_name(
-               struct bt_ctf_field_type *struct_field_type,
-               const char *field_name);
-
-extern int bt_ctf_field_type_structure_add_field(
-               struct bt_ctf_field_type *struct_field_type,
-               struct bt_ctf_field_type *field_type,
-               const char *field_name);
-
-extern struct bt_ctf_field_type *bt_ctf_field_type_array_create(
-               struct bt_ctf_field_type *element_field_type,
-               unsigned int length);
-
-extern struct bt_ctf_field_type *bt_ctf_field_type_array_get_element_field_type(
-               struct bt_ctf_field_type *array_field_type);
-
-extern int64_t bt_ctf_field_type_array_get_length(
-               struct bt_ctf_field_type *array_field_type);
-
-extern struct bt_ctf_field_type *bt_ctf_field_type_sequence_create(
-               struct bt_ctf_field_type *element_field_type,
-               const char *length_name);
-
-extern struct bt_ctf_field_type *bt_ctf_field_type_sequence_get_element_field_type(
-               struct bt_ctf_field_type *sequence_field_type);
-
-extern const char *bt_ctf_field_type_sequence_get_length_field_name(
-               struct bt_ctf_field_type *sequence_field_type);
-
-extern struct bt_ctf_field_type *bt_ctf_field_type_variant_create(
-               struct bt_ctf_field_type *tag_field_type,
-               const char *tag_name);
-
-extern struct bt_ctf_field_type *bt_ctf_field_type_variant_get_tag_field_type(
-               struct bt_ctf_field_type *variant_field_type);
-
-extern const char *bt_ctf_field_type_variant_get_tag_name(
-               struct bt_ctf_field_type *variant_field_type);
-
-extern int bt_ctf_field_type_variant_set_tag_name(
-               struct bt_ctf_field_type *variant_field_type,
-               const char *tag_name);
-
-extern int64_t bt_ctf_field_type_variant_get_field_count(
-               struct bt_ctf_field_type *variant_field_type);
-
-extern int bt_ctf_field_type_variant_get_field_by_index(
-               struct bt_ctf_field_type *variant_field_type,
-               const char **field_name,
-               struct bt_ctf_field_type **field_type, uint64_t index);
-
-extern
-struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_by_name(
-               struct bt_ctf_field_type *variant_field_type,
-               const char *field_name);
-
-extern
-struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_from_tag(
-               struct bt_ctf_field_type *variant_field_type,
-               struct bt_ctf_field *tag_field);
-
-extern int bt_ctf_field_type_variant_add_field(
-               struct bt_ctf_field_type *variant_field_type,
-               struct bt_ctf_field_type *field_type,
-               const char *field_name);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE2_CTF_WRITER_FIELD_TYPES_H */
diff --git a/include/babeltrace2/ctf-writer/fields.h b/include/babeltrace2/ctf-writer/fields.h
deleted file mode 100644 (file)
index 1345598..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-#ifndef BABELTRACE2_CTF_WRITER_FIELDS_H
-#define BABELTRACE2_CTF_WRITER_FIELDS_H
-
-/*
- * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdint.h>
-#include <stddef.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_ctf_field;
-struct bt_ctf_event_class;
-struct bt_ctf_event;
-struct bt_ctf_field_type;
-struct bt_ctf_field_type_enumeration_mapping_iterator;
-
-extern struct bt_ctf_field *bt_ctf_field_create(
-               struct bt_ctf_field_type *field_type);
-
-extern struct bt_ctf_field_type *bt_ctf_field_get_type(
-               struct bt_ctf_field *field);
-
-extern enum bt_ctf_field_type_id bt_ctf_field_get_type_id(
-               struct bt_ctf_field *field);
-
-extern struct bt_ctf_field *bt_ctf_field_copy(struct bt_ctf_field *field);
-
-extern int bt_ctf_field_integer_signed_get_value(
-               struct bt_ctf_field *integer_field, int64_t *value);
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-int bt_ctf_field_signed_integer_set_value(
-               struct bt_ctf_field *integer_field, int64_t *value)
-{
-       return bt_ctf_field_integer_signed_get_value(integer_field, value);
-}
-
-extern int bt_ctf_field_integer_signed_set_value(
-               struct bt_ctf_field *integer_field, int64_t value);
-
-extern int bt_ctf_field_integer_unsigned_get_value(
-               struct bt_ctf_field *integer_field, uint64_t *value);
-
-extern int bt_ctf_field_integer_unsigned_set_value(
-               struct bt_ctf_field *integer_field, uint64_t value);
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-int bt_ctf_field_unsigned_integer_set_value(
-               struct bt_ctf_field *integer_field, uint64_t *value)
-{
-       return bt_ctf_field_integer_unsigned_get_value(integer_field, value);
-}
-
-extern int bt_ctf_field_floating_point_get_value(
-               struct bt_ctf_field *float_field, double *value);
-
-extern int bt_ctf_field_floating_point_set_value(
-               struct bt_ctf_field *float_field, double value);
-
-extern struct bt_ctf_field *bt_ctf_field_enumeration_get_container(
-               struct bt_ctf_field *enum_field);
-
-extern const char *bt_ctf_field_string_get_value(
-               struct bt_ctf_field *string_field);
-
-extern int bt_ctf_field_string_set_value(struct bt_ctf_field *string_field,
-               const char *value);
-
-extern int bt_ctf_field_string_append(struct bt_ctf_field *string_field,
-               const char *value);
-
-extern int bt_ctf_field_string_append_len(
-               struct bt_ctf_field *string_field, const char *value,
-               unsigned int length);
-
-extern struct bt_ctf_field *bt_ctf_field_structure_get_field_by_name(
-               struct bt_ctf_field *struct_field, const char *name);
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-struct bt_ctf_field *bt_ctf_field_structure_get_field(
-               struct bt_ctf_field *structure, const char *name)
-{
-       return bt_ctf_field_structure_get_field_by_name(structure, name);
-}
-
-extern struct bt_ctf_field *bt_ctf_field_structure_get_field_by_index(
-               struct bt_ctf_field *struct_field, uint64_t index);
-
-extern struct bt_ctf_field *bt_ctf_field_array_get_field(
-               struct bt_ctf_field *array_field, uint64_t index);
-
-extern struct bt_ctf_field *bt_ctf_field_sequence_get_field(
-               struct bt_ctf_field *sequence_field, uint64_t index);
-
-extern int bt_ctf_field_sequence_set_length(struct bt_ctf_field *sequence_field,
-               struct bt_ctf_field *length_field);
-
-extern struct bt_ctf_field *bt_ctf_field_variant_get_field(
-               struct bt_ctf_field *variant_field,
-               struct bt_ctf_field *tag_field);
-
-extern struct bt_ctf_field *bt_ctf_field_variant_get_current_field(
-               struct bt_ctf_field *variant_field);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE2_CTF_WRITER_FIELDS_H */
diff --git a/include/babeltrace2/ctf-writer/object.h b/include/babeltrace2/ctf-writer/object.h
deleted file mode 100644 (file)
index 2feedac..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-#ifndef BABELTRACE2_CTF_WRITER_OBJECT_H
-#define BABELTRACE2_CTF_WRITER_OBJECT_H
-
-/*
- * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
-@defgroup refs Reference counting management
-@ingroup apiref
-@brief Common reference counting management for all Babeltrace objects.
-
-@code
-#include <babeltrace2/ctf-writer/object.h>
-@endcode
-
-The macros and functions of this module are everything that is needed
-to handle the <strong><em>reference counting</em></strong> of
-Babeltrace objects.
-
-Any Babeltrace object can be shared by multiple owners thanks to
-<a href="https://en.wikipedia.org/wiki/Reference_counting">reference
-counting</a>.
-
-The Babeltrace C API complies with the following key principles:
-
-1. When you call an API function which accepts a Babeltrace object
-   pointer as a parameter, the API function <strong>borrows the
-   reference</strong> for the <strong>duration of the function</strong>.
-
-   @image html ref-count-user-calls.png
-
-   The API function can also get a new reference if the system needs a
-   more persistent reference, but the ownership is <strong>never
-   transferred</strong> from the caller to the API function.
-
-   In other words, the caller still owns the object after calling any
-   API function: no function "steals" the user's reference (except
-   bt_ctf_object_put_ref()).
-
-2. An API function which \em returns a Babeltrace object pointer to the
-   user returns a <strong>new reference</strong>. The caller becomes an
-   owner of the object.
-
-   @image html ref-count-api-returns.png
-
-   It is your responsibility to discard the object when you don't
-   need it anymore with bt_ctf_object_put_ref().
-
-   For example, see bt_ctf_value_array_get().
-
-3. A Babeltrace object pointer received as a parameter in a user
-   function called back from an API function is a
-   <strong>borrowed</strong>, or <strong>weak reference</strong>: if you
-   need a reference which is more persistent than the duration of the
-   user function, call bt_ctf_object_get_ref() on the pointer.
-
-   @image html ref-count-callback.png
-
-   For example, see bt_ctf_value_map_foreach_entry().
-
-The two macros BT_CTF_OBJECT_PUT_REF_AND_RESET() and BT_CTF_OBJECT_MOVE_REF() operate on \em variables rather
-than pointer values. You should use BT_CTF_OBJECT_PUT_REF_AND_RESET() instead of bt_ctf_object_put_ref() when
-possible to avoid "double puts". For the same reason, you should use use
-BT_CTF_OBJECT_MOVE_REF() instead of performing manual reference moves between
-variables.
-
-@file
-@brief Reference counting management macros and functions.
-@sa refs
-
-@addtogroup refs
-@{
-*/
-
-/**
-@brief Calls bt_ctf_object_put_ref() on a variable named \p _var, then
-       sets \p _var to \c NULL.
-
-Using this macro is considered safer than calling bt_ctf_object_put_ref() because it
-makes sure that the variable which used to contain a reference to a
-Babeltrace object is set to \c NULL so that a future BT_CTF_OBJECT_PUT_REF_AND_RESET() or
-bt_ctf_object_put_ref() call will not cause another, unwanted reference decrementation.
-
-@param[in,out] _var    Name of a variable containing a
-                       Babeltrace object's address (this address
-                       can be \c NULL).
-
-@post <strong>If \p _var does not contain \p NULL</strong>,
-       its reference count is decremented.
-@post \p _var contains \c NULL.
-
-@sa BT_CTF_OBJECT_MOVE_REF(): Transfers the ownership of a Babeltrace object from a
-       variable to another.
-*/
-#define BT_CTF_OBJECT_PUT_REF_AND_RESET(_var)  \
-       do {                                    \
-               bt_ctf_object_put_ref(_var);    \
-               (_var) = NULL;                  \
-       } while (0)
-
-/**
-@brief Transfers the ownership of a Babeltrace object from a variable
-       named \p _var_src to a variable named \p _var_dst.
-
-This macro implements the following common pattern:
-
-  1. Call bt_ctf_object_put_ref() on \p _var_dst to make sure the previous reference
-     held by \p _var_dst is discarded.
-  2. Assign \p _var_src to \p _var_dst.
-  3. Set \p _var_src to \c NULL to avoid future, unwanted reference
-     decrementation of \p _var_src.
-
-@warning
-You must \em not use this macro when both \p _var_dst and
-\p _var_src contain the same Babeltrace object address and the reference
-count of this object is 1. The initial call to bt_ctf_object_put_ref() on \p _var_dst
-would destroy the object and leave a dangling pointer in \p _var_dst.
-
-@param[in,out] _var_dst        Name of the destination variable, containing
-                       either the address of a Babeltrace object to
-                       put first, or \c NULL.
-@param[in,out] _var_src        Name of the source variable, containing
-                       either the address of a Babeltrace object to
-                       move, or \c NULL.
-
-@pre <strong>If \p _var_dst and \p _var_src contain the same
-       value which is not \c NULL</strong>, this object's reference
-       count is greater than 1.
-@post <strong>If \c _var_dst is not \c NULL</strong>, its reference
-       count is decremented.
-@post \p _var_dst is equal to the value of \p _var_src \em before
-       you called this macro.
-@post \p _var_src is \c NULL.
-
-@sa BT_CTF_OBJECT_PUT_REF_AND_RESET(): Calls bt_ctf_object_put_ref() on a variable, then sets it to \c NULL.
-*/
-#define BT_CTF_OBJECT_MOVE_REF(_var_dst, _var_src)     \
-       do {                                    \
-               bt_ctf_object_put_ref(_var_dst);        \
-               (_var_dst) = (_var_src);        \
-               (_var_src) = NULL;              \
-       } while (0)
-
-/**
-@brief  Increments the reference count of the Babeltrace object \p obj.
-
-@param[in] obj Babeltrace object of which to get a new reference
-               (can be \c NULL).
-@returns       \p obj
-
-@post <strong>If \c obj is not \c NULL</strong>, its reference
-       count is incremented.
-
-@sa bt_ctf_object_put_ref(): Decrements the reference count of a Babeltrace object.
-*/
-void *bt_ctf_object_get_ref(void *obj);
-
-/**
-@brief Decrements the reference count of the Babeltrace object
-       \p obj.
-
-When the object's reference count reaches 0, the object can no longer
-be accessed and is considered \em destroyed.
-
-@remarks
-You should use the BT_CTF_OBJECT_PUT_REF_AND_RESET() macro instead of calling bt_ctf_object_put_ref() since the
-former is generally safer.
-
-@param[in] obj Babeltrace object of which to drop a reference
-               (can be \c NULL).
-
-@post <strong>If \c obj is not \c NULL</strong>, its reference
-       count is decremented.
-
-@sa BT_CTF_OBJECT_PUT_REF_AND_RESET(): Calls bt_ctf_object_put_ref() on a variable, then sets it to \c NULL.
-@sa BT_CTF_OBJECT_MOVE_REF(): Transfers the ownership of a Babeltrace object from a
-       variable to another.
-@sa bt_ctf_object_get_ref(): Increments the reference count of a Babeltrace object.
-*/
-void bt_ctf_object_put_ref(void *obj);
-
-/**
-@}
-*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE2_CTF_WRITER_OBJECT_H */
diff --git a/include/babeltrace2/ctf-writer/stream-class.h b/include/babeltrace2/ctf-writer/stream-class.h
deleted file mode 100644 (file)
index 5d43318..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-#ifndef BABELTRACE2_CTF_WRITER_STREAM_CLASS_H
-#define BABELTRACE2_CTF_WRITER_STREAM_CLASS_H
-
-/*
- * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace2/ctf-writer/object.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_ctf_stream_class;
-struct bt_ctf_trace;
-struct bt_ctf_event_class;
-struct bt_ctf_field_type;
-struct bt_ctf_clock;
-
-extern struct bt_ctf_stream_class *bt_ctf_stream_class_create(
-               const char *name);
-
-extern struct bt_ctf_trace *bt_ctf_stream_class_get_trace(
-               struct bt_ctf_stream_class *stream_class);
-
-extern const char *bt_ctf_stream_class_get_name(
-               struct bt_ctf_stream_class *stream_class);
-
-extern int bt_ctf_stream_class_set_name(
-               struct bt_ctf_stream_class *stream_class, const char *name);
-
-extern int64_t bt_ctf_stream_class_get_id(
-               struct bt_ctf_stream_class *stream_class);
-
-extern int bt_ctf_stream_class_set_id(
-               struct bt_ctf_stream_class *stream_class, uint64_t id);
-
-extern struct bt_ctf_field_type *bt_ctf_stream_class_get_packet_context_type(
-               struct bt_ctf_stream_class *stream_class);
-
-extern int bt_ctf_stream_class_set_packet_context_type(
-               struct bt_ctf_stream_class *stream_class,
-               struct bt_ctf_field_type *packet_context_type);
-
-extern struct bt_ctf_field_type *
-bt_ctf_stream_class_get_event_header_type(
-               struct bt_ctf_stream_class *stream_class);
-
-extern int bt_ctf_stream_class_set_event_header_type(
-               struct bt_ctf_stream_class *stream_class,
-               struct bt_ctf_field_type *event_header_type);
-
-extern struct bt_ctf_field_type *
-bt_ctf_stream_class_get_event_context_type(
-               struct bt_ctf_stream_class *stream_class);
-
-extern int bt_ctf_stream_class_set_event_context_type(
-               struct bt_ctf_stream_class *stream_class,
-               struct bt_ctf_field_type *event_context_type);
-
-extern int64_t bt_ctf_stream_class_get_event_class_count(
-               struct bt_ctf_stream_class *stream_class);
-
-extern struct bt_ctf_event_class *bt_ctf_stream_class_get_event_class_by_index(
-               struct bt_ctf_stream_class *stream_class, uint64_t index);
-
-extern struct bt_ctf_event_class *bt_ctf_stream_class_get_event_class_by_id(
-               struct bt_ctf_stream_class *stream_class, uint64_t id);
-
-extern int bt_ctf_stream_class_add_event_class(
-               struct bt_ctf_stream_class *stream_class,
-               struct bt_ctf_event_class *event_class);
-
-extern int bt_ctf_stream_class_set_clock(
-               struct bt_ctf_stream_class *ctf_stream_class,
-               struct bt_ctf_clock *clock);
-
-extern struct bt_ctf_clock *bt_ctf_stream_class_get_clock(
-        struct bt_ctf_stream_class *stream_class);
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-void bt_ctf_stream_class_get(struct bt_ctf_stream_class *stream_class)
-{
-       bt_ctf_object_get_ref(stream_class);
-}
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-void bt_ctf_stream_class_put(struct bt_ctf_stream_class *stream_class)
-{
-       bt_ctf_object_put_ref(stream_class);
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE2_CTF_WRITER_STREAM_CLASS_H */
diff --git a/include/babeltrace2/ctf-writer/stream.h b/include/babeltrace2/ctf-writer/stream.h
deleted file mode 100644 (file)
index 003e8d5..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-#ifndef BABELTRACE2_CTF_WRITER_STREAM_H
-#define BABELTRACE2_CTF_WRITER_STREAM_H
-
-/*
- * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_ctf_stream;
-struct bt_ctf_event;
-
-/*
- * bt_ctf_stream_get_discarded_events_count: get the number of discarded
- * events associated with this stream.
- *
- * Note that discarded events are not stored if the stream's packet
- * context has no "events_discarded" field. An error will be returned
- * in that case.
- *
- * @param stream Stream instance.
- *
- * Returns the number of discarded events, a negative value on error.
- */
-extern int bt_ctf_stream_get_discarded_events_count(
-               struct bt_ctf_stream *stream, uint64_t *count);
-
-/*
- * bt_ctf_stream_append_discarded_events: increment discarded events count.
- *
- * Increase the current packet's discarded event count. Has no effect if the
- * stream class' packet context has no "events_discarded" field.
- *
- * @param stream Stream instance.
- * @param event_count Number of discarded events to add to the stream's current
- *     packet.
- */
-extern void bt_ctf_stream_append_discarded_events(struct bt_ctf_stream *stream,
-               uint64_t event_count);
-
-/*
- * bt_ctf_stream_append_event: append an event to the stream.
- *
- * Append "event" to the stream's current packet. The stream's associated clock
- * will be sampled during this call. The event shall not be modified after
- * being appended to a stream. The stream will share the event's ownership by
- * incrementing its reference count. The current packet is not flushed to disk
- * until the next call to bt_ctf_stream_flush.
- *
- * The stream event context will be sampled for every appended event if
- * a stream event context was defined.
- *
- * @param stream Stream instance.
- * @param event Event instance to append to the stream's current packet.
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_ctf_stream_append_event(struct bt_ctf_stream *stream,
-               struct bt_ctf_event *event);
-
-/*
- * bt_ctf_stream_get_packet_header: get a stream's packet header.
- *
- * @param stream Stream instance.
- *
- * Returns a field instance on success, NULL on error.
- */
-extern struct bt_ctf_field *bt_ctf_stream_get_packet_header(
-               struct bt_ctf_stream *stream);
-
-/*
- * bt_ctf_stream_set_packet_header: set a stream's packet header.
- *
- * The packet header's type must match the trace's packet header
- * type.
- *
- * @param stream Stream instance.
- * @param packet_header Packet header instance.
- *
- * Returns a field instance on success, NULL on error.
- */
-extern int bt_ctf_stream_set_packet_header(
-               struct bt_ctf_stream *stream,
-               struct bt_ctf_field *packet_header);
-
-/*
- * bt_ctf_stream_get_packet_context: get a stream's packet context.
- *
- * @param stream Stream instance.
- *
- * Returns a field instance on success, NULL on error.
- */
-extern struct bt_ctf_field *bt_ctf_stream_get_packet_context(
-               struct bt_ctf_stream *stream);
-
-/*
- * bt_ctf_stream_set_packet_context: set a stream's packet context.
- *
- * The packet context's type must match the stream class' packet
- * context type.
- *
- * @param stream Stream instance.
- * @param packet_context Packet context field instance.
- *
- * Returns a field instance on success, NULL on error.
- */
-extern int bt_ctf_stream_set_packet_context(
-               struct bt_ctf_stream *stream,
-               struct bt_ctf_field *packet_context);
-
-/*
- * bt_ctf_stream_flush: flush a stream.
- *
- * The stream's current packet's events will be flushed, thus closing the
- * current packet. Events subsequently appended to the stream will be
- * added to a new packet.
- *
- * Flushing will also set the packet context's default attributes if
- * they remained unset while populating the current packet. These default
- * attributes, along with their expected types, are detailed in stream-class.h.
- *
- * @param stream Stream instance.
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_ctf_stream_flush(struct bt_ctf_stream *stream);
-
-extern int bt_ctf_stream_is_writer(struct bt_ctf_stream *stream);
-
-extern
-struct bt_ctf_stream *bt_ctf_stream_create(
-               struct bt_ctf_stream_class *stream_class,
-               const char *name, uint64_t id);
-
-extern struct bt_ctf_stream_class *bt_ctf_stream_get_class(
-               struct bt_ctf_stream *stream);
-
-extern const char *bt_ctf_stream_get_name(struct bt_ctf_stream *stream);
-
-extern int64_t bt_ctf_stream_get_id(struct bt_ctf_stream *stream);
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-void bt_ctf_stream_get(struct bt_ctf_stream *stream)
-{
-       bt_ctf_object_get_ref(stream);
-}
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-void bt_ctf_stream_put(struct bt_ctf_stream *stream)
-{
-       bt_ctf_object_put_ref(stream);
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE2_CTF_WRITER_STREAM_H */
diff --git a/include/babeltrace2/ctf-writer/trace.h b/include/babeltrace2/ctf-writer/trace.h
deleted file mode 100644 (file)
index 95e8854..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#ifndef BABELTRACE2_CTF_WRITER_TRACE_H
-#define BABELTRACE2_CTF_WRITER_TRACE_H
-
-/*
- * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_ctf_trace;
-struct bt_ctf_stream_class;
-struct bt_ctf_stream;
-
-extern enum bt_ctf_byte_order bt_ctf_trace_get_native_byte_order(
-               struct bt_ctf_trace *trace);
-
-extern int bt_ctf_trace_set_native_byte_order(struct bt_ctf_trace *trace,
-               enum bt_ctf_byte_order native_byte_order);
-
-extern const uint8_t *bt_ctf_trace_get_uuid(
-               struct bt_ctf_trace *trace);
-
-extern int bt_ctf_trace_set_uuid(struct bt_ctf_trace *trace,
-               const uint8_t *uuid);
-
-extern int bt_ctf_trace_set_environment_field_integer(
-               struct bt_ctf_trace *trace, const char *name,
-               int64_t value);
-
-extern int bt_ctf_trace_set_environment_field_string(
-               struct bt_ctf_trace *trace, const char *name,
-               const char *value);
-
-extern struct bt_ctf_field_type *bt_ctf_trace_get_packet_header_field_type(
-               struct bt_ctf_trace *trace);
-
-extern int bt_ctf_trace_set_packet_header_field_type(struct bt_ctf_trace *trace,
-               struct bt_ctf_field_type *packet_header_type);
-
-extern int64_t bt_ctf_trace_get_stream_class_count(
-               struct bt_ctf_trace *trace);
-
-extern struct bt_ctf_stream_class *bt_ctf_trace_get_stream_class_by_index(
-               struct bt_ctf_trace *trace, uint64_t index);
-
-extern struct bt_ctf_stream_class *bt_ctf_trace_get_stream_class_by_id(
-               struct bt_ctf_trace *trace, uint64_t id);
-
-extern int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
-               struct bt_ctf_stream_class *stream_class);
-
-extern int64_t bt_ctf_trace_get_stream_count(struct bt_ctf_trace *trace);
-
-extern struct bt_ctf_stream *bt_ctf_trace_get_stream_by_index(
-               struct bt_ctf_trace *trace, uint64_t index);
-
-extern const char *bt_ctf_trace_get_name(struct bt_ctf_trace *trace);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE2_CTF_WRITER_TRACE_H */
diff --git a/include/babeltrace2/ctf-writer/types.h b/include/babeltrace2/ctf-writer/types.h
deleted file mode 100644 (file)
index c45b2b1..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef BABELTRACE2_CTF_WRITER_TYPES_H
-#define BABELTRACE2_CTF_WRITER_TYPES_H
-
-/*
- * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/// False boolean value for the #bt_ctf_bool type.
-#define BT_CTF_FALSE    0
-
-/// True boolean value for the #bt_ctf_bool type.
-#define BT_CTF_TRUE     1
-
-typedef int bt_ctf_bool;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE2_CTF_WRITER_TYPES_H */
diff --git a/include/babeltrace2/ctf-writer/utils.h b/include/babeltrace2/ctf-writer/utils.h
deleted file mode 100644 (file)
index 6465c0d..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef BABELTRACE2_CTF_WRITER_UTILS_H
-#define BABELTRACE2_CTF_WRITER_UTILS_H
-
-/*
- * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-/* For bt_ctf_bool */
-#include <babeltrace2/ctf-writer/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern bt_ctf_bool bt_ctf_identifier_is_valid(const char *identifier);
-
-static inline
-int bt_ctf_validate_identifier(const char *identifier)
-{
-       return bt_ctf_identifier_is_valid(identifier) ? 1 : 0;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE2_CTF_WRITER_UTILS_H */
diff --git a/include/babeltrace2/ctf-writer/visitor.h b/include/babeltrace2/ctf-writer/visitor.h
deleted file mode 100644 (file)
index c2fb0da..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-#ifndef BABELTRACE2_CTF_WRITER_VISITOR_H
-#define BABELTRACE2_CTF_WRITER_VISITOR_H
-
-/*
- * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
-@defgroup ctfirvisitor CTF IR visitor
-@ingroup ctfir
-@brief CTF IR visitor.
-
-@code
-#include <babeltrace2/trace-ir/visitor.h>
-@endcode
-
-A CTF IR <strong><em>visitor</em></strong> is a function that you
-can use to visit the hierarchy of a
-\link ctfirtraceclass CTF IR trace class\endlink with
-bt_ctf_trace_visit() or of a
-\link ctfirstreamclass CTF IR stream class\endlink with
-bt_ctf_stream_class_visit().
-
-The traversal of the object's hierarchy is always done in a
-pre-order fashion.
-
-@sa ctfirstreamclass
-@sa ctfirtraceclass
-
-@file
-@brief CTF IR visitor types and functions.
-@sa ctfirvisitor
-
-@addtogroup ctfirvisitor
-@{
-*/
-
-/**
-@struct bt_ctf_object
-@brief A CTF IR object wrapper.
-
-This structure wraps both a CTF IR object and its type
-(see #bt_ctf_object_type). It is used in the visiting function.
-
-You can use the bt_ctf_object_get_type() and
-bt_ctf_object_get_object() accessors to get the type and wrapped
-CTF IR object of a CTF IR object wrapper.
-
-A CTF IR object wrapper has <strong>no reference count</strong>: do \em
-not use bt_ctf_object_put_ref() or bt_ctf_object_get_ref() on it.
-
-@sa ctfirvisitor
-*/
-struct bt_ctf_visitor_object;
-
-/**
-@brief CTF IR object wrapper type.
-*/
-enum bt_ctf_visitor_object_type {
-       /// Unknown (used for errors).
-       BT_CTF_VISITOR_OBJECT_TYPE_UNKNOWN = -1,
-
-       /// \ref ctfirtraceclass.
-       BT_CTF_VISITOR_OBJECT_TYPE_TRACE = 0,
-
-       /// \ref ctfirstreamclass.
-       BT_CTF_VISITOR_OBJECT_TYPE_STREAM_CLASS = 1,
-
-       /// \ref ctfirstream.
-       BT_CTF_VISITOR_OBJECT_TYPE_STREAM = 2,
-
-       /// \ref ctfireventclass.
-       BT_CTF_VISITOR_OBJECT_TYPE_EVENT_CLASS = 3,
-
-       /// \ref ctfirevent.
-       BT_CTF_VISITOR_OBJECT_TYPE_EVENT = 4,
-
-       /// Number of entries in this enumeration.
-       BT_CTF_VISITOR_OBJECT_TYPE_NR,
-};
-
-/**
-@brief Visting function type.
-
-A function of this type is called by bt_ctf_trace_visit() or
-bt_ctf_stream_class_visit() when visiting the CTF IR object wrapper
-\p object.
-
-\p object has <strong>no reference count</strong>: do \em not use
-bt_ctf_object_put_ref() or bt_ctf_object_get_ref() on it.
-
-@param[in] object      Currently visited CTF IR object wrapper.
-@param[in] data                User data.
-@returns               0 on success, or a negative value on error.
-
-@prenotnull{object}
-
-@sa bt_ctf_trace_visit(): Accepts a visitor to visit a trace class.
-@sa bt_ctf_stream_class_visit(): Accepts a visitor to visit a stream
-       class.
-*/
-typedef int (*bt_ctf_visitor)(struct bt_ctf_visitor_object *object,
-               void *data);
-
-/**
-@brief Returns the type of the CTF IR object wrapped by the CTF IR
-       object wrapper \p object.
-
-@param[in] object      Object wrapper of which to get the type.
-@returns               Type of \p object.
-
-@prenotnull{object}
-
-@sa bt_ctf_visitor_object_get_object(): Returns the object wrapped by a given
-       CTF IR object wrapper.
-*/
-enum bt_ctf_visitor_object_type bt_ctf_visitor_object_get_type(
-               struct bt_ctf_visitor_object *object);
-
-/**
-@brief Returns the CTF IR object wrapped by the CTF IR object
-       wrapper \p object.
-
-The reference count of \p object is \em not incremented by this
-function. On success, you must call bt_ctf_object_get_ref() on the return value to
-have your own reference.
-
-@param[in] object      Object wrapper of which to get the wrapped
-                       CTF IR object.
-@returns               CTF IR object wrapped by \p object.
-
-@prenotnull{object}
-@post The reference count of the returned object is not modified.
-
-@sa bt_ctf_visitor_object_get_type(): Returns the type of a given
-       CTF IR object wrapper.
-*/
-void *bt_ctf_visitor_object_get_object(struct bt_ctf_visitor_object *object);
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE2_CTF_WRITER_VISITOR_H */
diff --git a/include/babeltrace2/ctf-writer/writer.h b/include/babeltrace2/ctf-writer/writer.h
deleted file mode 100644 (file)
index 63c1ba3..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-#ifndef BABELTRACE2_CTF_WRITER_WRITER_H
-#define BABELTRACE2_CTF_WRITER_WRITER_H
-
-/*
- * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace2/ctf-writer/field-types.h>
-#include <babeltrace2/ctf-writer/stream-class.h>
-#include <babeltrace2/ctf-writer/stream.h>
-#include <babeltrace2/ctf-writer/trace.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_ctf_writer;
-struct bt_ctf_stream;
-struct bt_ctf_stream_class;
-struct bt_ctf_clock;
-
-/*
- * bt_ctf_writer_create: create a writer instance.
- *
- * Allocate a new writer that will produce a trace in the given path.
- * The creation of a writer sets its reference count to 1.
- *
- * @param path Path to the trace's containing folder (string is copied).
- *
- * Returns an allocated writer on success, NULL on error.
- */
-extern struct bt_ctf_writer *bt_ctf_writer_create(const char *path);
-
-/*
- * bt_ctf_writer_get_trace: Get a writer's associated trace.
- *
- * @param writer Writer instance.
- *
- * Return the writer's associated instance, NULL on error.
- */
-extern struct bt_ctf_trace *bt_ctf_writer_get_trace(
-               struct bt_ctf_writer *writer);
-
-/*
- * bt_ctf_writer_create_stream: create a stream instance.
- *
- * Allocate a new stream instance and register it to the writer. The creation of
- * a stream sets its reference count to 1.
- *
- * @param writer Writer instance.
- * @param stream_class Stream class to instantiate.
- *
- * Returns an allocated stream on success, NULL on error.
- */
-extern struct bt_ctf_stream *bt_ctf_writer_create_stream(
-               struct bt_ctf_writer *writer,
-               struct bt_ctf_stream_class *stream_class);
-
-/*
- * bt_ctf_writer_add_environment_field: add an environment field to the trace.
- *
- * Add an environment field to the trace. The name and value parameters are
- * copied.
- *
- * @param writer Writer instance.
- * @param name Name of the environment field (will be copied).
- * @param value Value of the environment field (will be copied).
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_ctf_writer_add_environment_field(struct bt_ctf_writer *writer,
-               const char *name,
-               const char *value);
-
-/*
- * bt_ctf_writer_add_environment_field_int64: add an environment field to the trace.
- *
- * Add an environment field to the trace. The name and value parameters are
- * copied.
- *
- * @param writer Writer instance.
- * @param name Name of the environment field (will be copied).
- * @param value Value of the environment field.
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_ctf_writer_add_environment_field_int64(
-               struct bt_ctf_writer *writer,
-               const char *name,
-               int64_t value);
-
-/*
- * bt_ctf_writer_add_clock: add a clock to the trace.
- *
- * Add a clock to the trace. Clocks assigned to stream classes must be
- * registered to the writer.
- *
- * @param writer Writer instance.
- * @param clock Clock to add to the trace.
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_ctf_writer_add_clock(struct bt_ctf_writer *writer,
-               struct bt_ctf_clock *clock);
-
-/*
- * bt_ctf_writer_get_metadata_string: get meta-data string.
- *
- * Get the trace's TSDL meta-data. The caller assumes the ownership of the
- * returned string.
- *
- * @param writer Writer instance.
- *
- * Returns the metadata string on success, NULL on error.
- */
-extern char *bt_ctf_writer_get_metadata_string(struct bt_ctf_writer *writer);
-
-/*
- * bt_ctf_writer_flush_metadata: flush the trace's metadata to disk.
- *
- * Flush the trace's metadata to the metadata file. Note that the metadata will
- * be flushed automatically when the Writer instance is released (last call to
- * bt_ctf_writer_put).
- *
- * @param writer Writer instance.
- */
-extern void bt_ctf_writer_flush_metadata(struct bt_ctf_writer *writer);
-
-/*
- * bt_ctf_writer_set_byte_order: set a field type's byte order.
- *
- * Set the trace's byte order. Defaults to the host machine's endianness.
- *
- * @param writer Writer instance.
- * @param byte_order Trace's byte order.
- *
- * Returns 0 on success, a negative value on error.
- *
- * Note: byte_order must not be BT_CTF_BYTE_ORDER_NATIVE since, according
- * to the CTF specification, is defined as "the byte order described in the
- * trace description".
- */
-extern int bt_ctf_writer_set_byte_order(struct bt_ctf_writer *writer,
-               enum bt_ctf_byte_order byte_order);
-
-/*
- * bt_ctf_writer_get and bt_ctf_writer_put: increment and decrement the
- * writer's reference count.
- *
- * You may also use bt_ctf_get() and bt_ctf_put() with writer objects.
- *
- * These functions ensure that the writer won't be destroyed while it
- * is in use. The same number of get and put (plus one extra put to
- * release the initial reference done at creation) have to be done to
- * destroy a writer.
- *
- * When the writer's reference count is decremented to 0 by a
- * bt_ctf_writer_put, the writer is freed.
- *
- * @param writer Writer instance.
- */
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-void bt_ctf_writer_get(struct bt_ctf_writer *writer)
-{
-       bt_ctf_object_get_ref(writer);
-}
-
-/* Pre-2.0 CTF writer compatibility */
-static inline
-void bt_ctf_writer_put(struct bt_ctf_writer *writer)
-{
-       bt_ctf_object_put_ref(writer);
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE2_CTF_WRITER_WRITER_H */
index f331019ecd01ea7c948d914e6659cfd0ecf34392..dc51fc6b2eb23b6e6f8d08bd56be87348974210c 100644 (file)
@@ -31,7 +31,7 @@
 #include "common/assert.h"
 #include "common/macros.h"
 #include "compat/string.h"
-#include <babeltrace2/ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/object.h>
 #include <inttypes.h>
 
 #include "values.h"
index 47c49baceeb5e1a7800cd07c8e947415e1f3fee8..c1d3caffecd0b1b369a6ce4a88a9bc258d7ef838 100644 (file)
@@ -30,8 +30,8 @@
 #include "logging.h"
 
 #include "common/uuid.h"
-#include <babeltrace2/ctf-writer/utils.h>
-#include <babeltrace2/ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/utils.h>
+#include <babeltrace2-ctf-writer/object.h>
 #include "compat/compiler.h"
 #include <babeltrace2/types.h>
 #include "compat/string.h"
index 14e0bd4781f6474734650668965059e499c6c66d..413e6e8019ce8a1083531e78346427ca7f6aed60 100644 (file)
@@ -28,7 +28,7 @@
 #include "common/macros.h"
 #include "object-pool.h"
 #include "common/uuid.h"
-#include <babeltrace2/ctf-writer/types.h>
+#include <babeltrace2-ctf-writer/types.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <glib.h>
index e1c00dacce50d3a035ab285caeea321c9831ea17..b6889a6c62f29dcae15d9bd860442d7243aff662 100644 (file)
@@ -33,8 +33,8 @@
 #include "common/assert.h"
 #include "common/uuid.h"
 #include "compat/compiler.h"
-#include <babeltrace2/ctf-writer/utils.h>
-#include <babeltrace2/ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/utils.h>
+#include <babeltrace2-ctf-writer/object.h>
 #include <inttypes.h>
 
 #include "clock-class.h"
index 01cddc47eea52a26e5b700ee01afde431bcc3f2b..a6bfd5ce7b03b50f69ec247df90628d9df4fb6e5 100644 (file)
@@ -23,7 +23,7 @@
  * SOFTWARE.
  */
 
-#include <babeltrace2/ctf-writer/clock.h>
+#include <babeltrace2-ctf-writer/clock.h>
 #include "common/macros.h"
 #include <glib.h>
 
index ac5d89264b886db7d199d374700e7ab65260d590..823165c8c5c0fd6a62067be490e7041a28c484e1 100644 (file)
 #include <inttypes.h>
 #include <stdlib.h>
 
-#include <babeltrace2/ctf-writer/event.h>
-#include <babeltrace2/ctf-writer/field-types.h>
-#include <babeltrace2/ctf-writer/object.h>
-#include <babeltrace2/ctf-writer/stream-class.h>
-#include <babeltrace2/ctf-writer/utils.h>
+#include <babeltrace2-ctf-writer/event.h>
+#include <babeltrace2-ctf-writer/field-types.h>
+#include <babeltrace2-ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/stream-class.h>
+#include <babeltrace2-ctf-writer/utils.h>
 #include <babeltrace2/types.h>
 
 #include "common/assert.h"
index 35c1de5d244dd6ad89ea46898cf56eaedc6e0e33..522f15e47a656af613fac94a3e48cc89dbbd823e 100644 (file)
 
 #include "common/assert.h"
 #include "common/macros.h"
-#include <babeltrace2/ctf-writer/event.h>
-#include <babeltrace2/ctf-writer/field-types.h>
-#include <babeltrace2/ctf-writer/fields.h>
-#include <babeltrace2/ctf-writer/stream-class.h>
-#include <babeltrace2/ctf-writer/stream.h>
+#include <babeltrace2-ctf-writer/event.h>
+#include <babeltrace2-ctf-writer/field-types.h>
+#include <babeltrace2-ctf-writer/fields.h>
+#include <babeltrace2-ctf-writer/stream-class.h>
+#include <babeltrace2-ctf-writer/stream.h>
 #include <glib.h>
 
 #include "object.h"
index a470687678eab5a9a84e49dd387a951f410b9ea5..abe2521a9fc8153350dab2da685dc4960972506a 100644 (file)
 
 #include <inttypes.h>
 
-#include <babeltrace2/ctf-writer/event.h>
-#include <babeltrace2/ctf-writer/fields.h>
-#include <babeltrace2/ctf-writer/field-types.h>
-#include <babeltrace2/ctf-writer/object.h>
-#include <babeltrace2/ctf-writer/stream-class.h>
-#include <babeltrace2/ctf-writer/trace.h>
-#include <babeltrace2/ctf-writer/utils.h>
+#include <babeltrace2-ctf-writer/event.h>
+#include <babeltrace2-ctf-writer/fields.h>
+#include <babeltrace2-ctf-writer/field-types.h>
+#include <babeltrace2-ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/stream-class.h>
+#include <babeltrace2-ctf-writer/trace.h>
+#include <babeltrace2-ctf-writer/utils.h>
 
 #include "common/assert.h"
 #include "compat/compiler.h"
index 0bfbb007a24c7f2b7938810751f8d74772312b14..ed21444a2a11fc2430da27622dfcf996df6dc7e8 100644 (file)
 
 #include "common/assert.h"
 #include "common/macros.h"
-#include <babeltrace2/ctf-writer/field-types.h>
-#include <babeltrace2/ctf-writer/fields.h>
-#include <babeltrace2/ctf-writer/stream-class.h>
-#include <babeltrace2/ctf-writer/stream.h>
+#include <babeltrace2-ctf-writer/field-types.h>
+#include <babeltrace2-ctf-writer/fields.h>
+#include <babeltrace2-ctf-writer/stream-class.h>
+#include <babeltrace2-ctf-writer/stream.h>
 #include "ctfser/ctfser.h"
 
 #include "assert-pre.h"
index be19b4032c9e9a87e1624fb5b7922492c9c13c7b..6770290c426c5236999a6dcbbdfc870b2afbc450 100644 (file)
@@ -33,7 +33,7 @@
 #include <limits.h>
 #include <stdint.h>
 
-#include <babeltrace2/ctf-writer/field-types.h>
+#include <babeltrace2-ctf-writer/field-types.h>
 
 #include "common/assert.h"
 
index 76d3793ebfd9740ddf282005e3793b7049ea24be..c63a77520a90a0a368f1ba4f9263267c0df010d5 100644 (file)
@@ -29,7 +29,7 @@
 #include "common/common.h"
 #include "common/assert.h"
 #include "common/macros.h"
-#include <babeltrace2/ctf-writer/field-types.h>
+#include <babeltrace2-ctf-writer/field-types.h>
 #include <glib.h>
 
 #include "object.h"
index c427ee4fd03c1837a970597d4d379316fe3d4fa0..30b2cdc39992f2d0487d554504b7c54fa9ac14b5 100644 (file)
 #include <inttypes.h>
 #include <stdlib.h>
 
-#include <babeltrace2/ctf-writer/fields.h>
-#include <babeltrace2/ctf-writer/field-types.h>
-#include <babeltrace2/ctf-writer/object.h>
-#include <babeltrace2/ctf-writer/utils.h>
+#include <babeltrace2-ctf-writer/fields.h>
+#include <babeltrace2-ctf-writer/field-types.h>
+#include <babeltrace2-ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/utils.h>
 
 #include "common/assert.h"
 #include "compat/compiler.h"
index 52118235628363572cbff23f78386c9c27750905..ce4dafe65afc2309f28cef3235bd022391307843 100644 (file)
@@ -31,8 +31,8 @@
 #include <stdint.h>
 #include <stddef.h>
 
-#include <babeltrace2/ctf-writer/field-types.h>
-#include <babeltrace2/ctf-writer/types.h>
+#include <babeltrace2-ctf-writer/field-types.h>
+#include <babeltrace2-ctf-writer/types.h>
 
 #include "common/macros.h"
 
index 3909deb6a7fe6c72aef2b45275a09f3fd9bf3832..2d3fc63c5c609fe8da298d2105b64fa400f4b770 100644 (file)
@@ -29,7 +29,7 @@
 #include <inttypes.h>
 #include <stdlib.h>
 
-#include <babeltrace2/ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/object.h>
 
 #include "common/align.h"
 #include "common/assert.h"
index b2284996d68dd4bcc99a5d9d1cf2804152e08d49..87063fe20bd278a479fb6057cbf0ddb982985cc7 100644 (file)
@@ -35,7 +35,7 @@
 #include <stdint.h>
 #include <string.h>
 
-#include <babeltrace2/ctf-writer/fields.h>
+#include <babeltrace2-ctf-writer/fields.h>
 #include <babeltrace2/types.h>
 
 #include "common/macros.h"
index bc6ede5fc95d1c782a4f7a60085c89050ffb0a73..ae5fe94fbc828f7fd439df484ac8a75b4a26899d 100644 (file)
@@ -36,9 +36,9 @@
 #include <limits.h>
 #include <stdlib.h>
 
-#include <babeltrace2/ctf-writer/field-types.h>
-#include <babeltrace2/ctf-writer/object.h>
-#include <babeltrace2/ctf-writer/stream-class.h>
+#include <babeltrace2-ctf-writer/field-types.h>
+#include <babeltrace2-ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/stream-class.h>
 #include <babeltrace2/types.h>
 
 #include "common/macros.h"
index 930b22c4527aebef6bc1ffe6448196fb8d0035d6..799b3e6a3c856c01415cf7a22570dbae6d0c0ed3 100644 (file)
@@ -27,7 +27,7 @@
  * SOFTWARE.
  */
 
-#include <babeltrace2/ctf-writer/field-types.h>
+#include <babeltrace2-ctf-writer/field-types.h>
 #include "common/macros.h"
 #include <glib.h>
 
index 5346c530bdc5235baf4dcd3c3ea98670fd8723ea..ffec66557f991456a8ecdf4a8dfc4f09731e247f 100644 (file)
 #include <stdbool.h>
 #include <stdint.h>
 
-#include <babeltrace2/ctf-writer/event.h>
-#include <babeltrace2/ctf-writer/object.h>
-#include <babeltrace2/ctf-writer/trace.h>
-#include <babeltrace2/ctf-writer/utils.h>
+#include <babeltrace2-ctf-writer/event.h>
+#include <babeltrace2-ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/trace.h>
+#include <babeltrace2-ctf-writer/utils.h>
 
 #include "common/align.h"
 #include "common/assert.h"
index f39f405e813135588c69313ffd3938f877fca597..ca5a30750a16b8a4366ace41a4b33948c3d8f596 100644 (file)
@@ -31,8 +31,8 @@
 #include "common/assert.h"
 #include "common/macros.h"
 #include "common/common.h"
-#include <babeltrace2/ctf-writer/field-types.h>
-#include <babeltrace2/ctf-writer/visitor.h>
+#include <babeltrace2-ctf-writer/field-types.h>
+#include <babeltrace2-ctf-writer/visitor.h>
 #include <inttypes.h>
 
 #include "clock.h"
index 7d371ffd97a234781331191b318068857b572cc2..1bf60df144bf607a22aeba45282265d670ceff18 100644 (file)
 #include <stdint.h>
 #include <unistd.h>
 
-#include <babeltrace2/ctf-writer/field-types.h>
-#include <babeltrace2/ctf-writer/object.h>
-#include <babeltrace2/ctf-writer/stream-class.h>
-#include <babeltrace2/ctf-writer/stream.h>
-#include <babeltrace2/ctf-writer/trace.h>
+#include <babeltrace2-ctf-writer/field-types.h>
+#include <babeltrace2-ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/stream-class.h>
+#include <babeltrace2-ctf-writer/stream.h>
+#include <babeltrace2-ctf-writer/trace.h>
 
 #include "common/align.h"
 #include "common/assert.h"
index ff6f8a823f13a8b71275fa27fd2ae19ba8a65177..5596e33d097ff55a00469e91efef6d8ecf25c7fc 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "common/assert.h"
 #include "common/macros.h"
-#include <babeltrace2/ctf-writer/stream.h>
+#include <babeltrace2-ctf-writer/stream.h>
 #include "ctfser/ctfser.h"
 #include <stdint.h>
 
index 3e29ce7b761fe7bdb4a419be0913213f99825748..56a9a55f81df4a6b9b7db8b45bf9cc7c3b23b945 100644 (file)
@@ -29,9 +29,9 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <babeltrace2/ctf-writer/event.h>
-#include <babeltrace2/ctf-writer/object.h>
-#include <babeltrace2/ctf-writer/utils.h>
+#include <babeltrace2-ctf-writer/event.h>
+#include <babeltrace2-ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/utils.h>
 #include <babeltrace2/types.h>
 
 #include "common/assert.h"
index cd724c6a2a7456dd6c0bf0168e12fa4dd0150141..1b426821f182d65e181fe88671f1701c28b45da8 100644 (file)
@@ -30,9 +30,9 @@
 
 #include "common/macros.h"
 #include "common/uuid.h"
-#include <babeltrace2/ctf-writer/field-types.h>
-#include <babeltrace2/ctf-writer/fields.h>
-#include <babeltrace2/ctf-writer/trace.h>
+#include <babeltrace2-ctf-writer/field-types.h>
+#include <babeltrace2-ctf-writer/fields.h>
+#include <babeltrace2-ctf-writer/trace.h>
 #include <babeltrace2/types.h>
 #include <glib.h>
 #include <sys/types.h>
index 935bfa84ef38563805bd4d7b58387ae6594028a3..5c951ea99fbe2b6ee46f104076bf878848d88279 100644 (file)
@@ -32,8 +32,8 @@
 #include <glib.h>
 #include <stdlib.h>
 
-#include <babeltrace2/ctf-writer/utils.h>
-#include <babeltrace2/ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/utils.h>
+#include <babeltrace2-ctf-writer/object.h>
 
 #include "common/assert.h"
 
index 6cb0609a13822ca38a658a43e13493a4e13c9c3c..f08d544bd7ab6bb2a711f1beecc88aa101bd14fb 100644 (file)
@@ -22,8 +22,8 @@
  */
 
 #include "common/macros.h"
-#include <babeltrace2/ctf-writer/field-types.h>
-#include <babeltrace2/ctf-writer/event.h>
+#include <babeltrace2-ctf-writer/field-types.h>
+#include <babeltrace2-ctf-writer/event.h>
 #include <stdint.h>
 
 #include "field-path.h"
index f6d031d77efd7e6c1025018d73c21afb892e5d92..7acf37b048fcc361930f738966753e20687355dc 100644 (file)
@@ -27,7 +27,7 @@
 #define BT_LOG_TAG "CTF-WRITER/VALIDATION"
 #include "logging.h"
 
-#include <babeltrace2/ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/object.h>
 
 #include "common/macros.h"
 
index 89a808d4e0e98c29eab045f0bca374f19547cb39..f7f5a72e52e225978ef643f81db930c0cdf6a565 100644 (file)
@@ -28,7 +28,7 @@
 #include <string.h>
 #include <inttypes.h>
 
-#include <babeltrace2/ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/object.h>
 #include <babeltrace2/types.h>
 
 #include "common/assert.h"
index 990376666262116be2870140418f382ab8263e9c..dc237c5b5c54f0c8ba249ab49e2a248a20458341 100644 (file)
@@ -24,7 +24,7 @@
  * SOFTWARE.
  */
 
-#include <babeltrace2/ctf-writer/types.h>
+#include <babeltrace2-ctf-writer/types.h>
 
 #include "common/macros.h"
 
index ca943f8708a7a30d65b0738f2a56eeacf0f8ab53..0043611a33633e2dcd63a1aaa7366b0a367ecb23 100644 (file)
@@ -26,7 +26,7 @@
  * SOFTWARE.
  */
 
-#include <babeltrace2/ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/object.h>
 
 #include "common/macros.h"
 
index 5c583745e425cee2b866d02ca1fb7a55e7ccdfd7..bc6e05675cc59c9a9596469e279e58138ad93a00 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <stdlib.h>
 #include <stdint.h>
-#include <babeltrace2/ctf-writer/visitor.h>
+#include <babeltrace2-ctf-writer/visitor.h>
 #include "common/macros.h"
 
 typedef void *(*bt_ctf_child_accessor)(void *object, int index);
index a3d6f8b428934a41f13d2ba8da8f51a8e48bf8c5..1738b70c6df1b6b44b41d438edbe17cde253d9f2 100644 (file)
@@ -37,7 +37,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <babeltrace2/ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/object.h>
 
 #include "common/assert.h"
 #include "compat/compiler.h"
index 15b08856a65ec7cfe611b6dc132281a3980b9f2e..33f2fbe62b0f11297cea644834cb0a3aa4be973b 100644 (file)
@@ -29,8 +29,8 @@
 #include <glib.h>
 #include <sys/types.h>
 
-#include <babeltrace2/ctf-writer/trace.h>
-#include <babeltrace2/ctf-writer/writer.h>
+#include <babeltrace2-ctf-writer/trace.h>
+#include <babeltrace2-ctf-writer/writer.h>
 
 #include "common/macros.h"
 
index b41a068c10a8c953affdf3c230270709e58d82bf..73edf75c9857a550cf68914f9c45448af10ba3fd 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <babeltrace2/ctf-writer/writer.h>
-#include <babeltrace2/ctf-writer/clock.h>
-#include <babeltrace2/ctf-writer/clock-class.h>
-#include <babeltrace2/ctf-writer/stream.h>
-#include <babeltrace2/ctf-writer/event.h>
-#include <babeltrace2/ctf-writer/event-types.h>
-#include <babeltrace2/ctf-writer/event-fields.h>
-#include <babeltrace2/ctf-writer/stream-class.h>
-#include <babeltrace2/ctf-writer/trace.h>
+#include <babeltrace2-ctf-writer/writer.h>
+#include <babeltrace2-ctf-writer/clock.h>
+#include <babeltrace2-ctf-writer/clock-class.h>
+#include <babeltrace2-ctf-writer/stream.h>
+#include <babeltrace2-ctf-writer/event.h>
+#include <babeltrace2-ctf-writer/event-types.h>
+#include <babeltrace2-ctf-writer/event-fields.h>
+#include <babeltrace2-ctf-writer/stream-class.h>
+#include <babeltrace2-ctf-writer/trace.h>
 #include <babeltrace2/babeltrace.h>
 #include <glib.h>
 #include <unistd.h>
index 90cff9cddbeae57737a6bfcd2374e28b0d951638..e1b215b89541eccc6c53808cba5872dac282aff8 100644 (file)
 #include "lib/object.h"
 #include "compat/stdlib.h"
 #include "common/assert.h"
-#include <babeltrace2/ctf-writer/writer.h>
-#include <babeltrace2/ctf-writer/clock.h>
-#include <babeltrace2/ctf-writer/clock-class.h>
-#include <babeltrace2/ctf-writer/stream.h>
-#include <babeltrace2/ctf-writer/event.h>
-#include <babeltrace2/ctf-writer/event-types.h>
-#include <babeltrace2/ctf-writer/event-fields.h>
-#include <babeltrace2/ctf-writer/stream-class.h>
-#include <babeltrace2/ctf-writer/trace.h>
+#include <babeltrace2-ctf-writer/writer.h>
+#include <babeltrace2-ctf-writer/clock.h>
+#include <babeltrace2-ctf-writer/clock-class.h>
+#include <babeltrace2-ctf-writer/stream.h>
+#include <babeltrace2-ctf-writer/event.h>
+#include <babeltrace2-ctf-writer/event-types.h>
+#include <babeltrace2-ctf-writer/event-fields.h>
+#include <babeltrace2-ctf-writer/stream-class.h>
+#include <babeltrace2-ctf-writer/trace.h>
 #include "common.h"
 
 #define NR_TESTS 37
index 3c187ee37f84f7173baad585ea04e24dc0c59490..8357facb0d622708f8b1f3a4b777d2912ecdf713 100644 (file)
  */
 
 #include <stdint.h>
-#include <babeltrace2/ctf-writer/writer.h>
-#include <babeltrace2/ctf-writer/clock.h>
-#include <babeltrace2/ctf-writer/clock-class.h>
-#include <babeltrace2/ctf-writer/stream.h>
-#include <babeltrace2/ctf-writer/event.h>
-#include <babeltrace2/ctf-writer/event-types.h>
-#include <babeltrace2/ctf-writer/event-fields.h>
-#include <babeltrace2/ctf-writer/stream-class.h>
-#include <babeltrace2/ctf-writer/trace.h>
+#include <babeltrace2-ctf-writer/writer.h>
+#include <babeltrace2-ctf-writer/clock.h>
+#include <babeltrace2-ctf-writer/clock-class.h>
+#include <babeltrace2-ctf-writer/stream.h>
+#include <babeltrace2-ctf-writer/event.h>
+#include <babeltrace2-ctf-writer/event-types.h>
+#include <babeltrace2-ctf-writer/event-fields.h>
+#include <babeltrace2-ctf-writer/stream-class.h>
+#include <babeltrace2-ctf-writer/trace.h>
 
 #include "common/assert.h"
 
index 34444b2ed5d27804f9c32ada29278d9906d84587..8ba7c21d82be430a451763313ddca3b0da53e728 100644 (file)
  */
 
 #include <stdint.h>
-#include <babeltrace2/ctf-writer/writer.h>
-#include <babeltrace2/ctf-writer/clock.h>
-#include <babeltrace2/ctf-writer/clock-class.h>
-#include <babeltrace2/ctf-writer/stream.h>
-#include <babeltrace2/ctf-writer/event.h>
-#include <babeltrace2/ctf-writer/event-types.h>
-#include <babeltrace2/ctf-writer/event-fields.h>
-#include <babeltrace2/ctf-writer/stream-class.h>
-#include <babeltrace2/ctf-writer/trace.h>
+#include <babeltrace2-ctf-writer/writer.h>
+#include <babeltrace2-ctf-writer/clock.h>
+#include <babeltrace2-ctf-writer/clock-class.h>
+#include <babeltrace2-ctf-writer/stream.h>
+#include <babeltrace2-ctf-writer/event.h>
+#include <babeltrace2-ctf-writer/event-types.h>
+#include <babeltrace2-ctf-writer/event-fields.h>
+#include <babeltrace2-ctf-writer/stream-class.h>
+#include <babeltrace2-ctf-writer/trace.h>
 
 #include "common/assert.h"
 
index a7b9e9b63882e84136f1dead128ae6fc4a52a13f..75132eccfa065298417b189744c62c6a66289c60 100644 (file)
  */
 
 #include <stdint.h>
-#include <babeltrace2/ctf-writer/writer.h>
-#include <babeltrace2/ctf-writer/clock.h>
-#include <babeltrace2/ctf-writer/clock-class.h>
-#include <babeltrace2/ctf-writer/stream.h>
-#include <babeltrace2/ctf-writer/event.h>
-#include <babeltrace2/ctf-writer/event-types.h>
-#include <babeltrace2/ctf-writer/event-fields.h>
-#include <babeltrace2/ctf-writer/stream-class.h>
-#include <babeltrace2/ctf-writer/trace.h>
+#include <babeltrace2-ctf-writer/writer.h>
+#include <babeltrace2-ctf-writer/clock.h>
+#include <babeltrace2-ctf-writer/clock-class.h>
+#include <babeltrace2-ctf-writer/stream.h>
+#include <babeltrace2-ctf-writer/event.h>
+#include <babeltrace2-ctf-writer/event-types.h>
+#include <babeltrace2-ctf-writer/event-fields.h>
+#include <babeltrace2-ctf-writer/stream-class.h>
+#include <babeltrace2-ctf-writer/trace.h>
 
 #include "common/assert.h"
 
This page took 0.116078 seconds and 4 git commands to generate.