Fix: headers: add missing end of `extern "C"` curly brackets (for C++)
[babeltrace.git] / include / babeltrace / ctf-writer / writer.h
index 940736fe7eb552d22203a3b91cb20c68c85dfd4c..82719c66aebdf09f9e1cea56c224ec78a902837a 100644 (file)
@@ -2,8 +2,6 @@
 #define BABELTRACE_CTF_WRITER_WRITER_H
 
 /*
- * BabelTrace - CTF Writer: Writer
- *
  * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
  * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
  * http://www.efficios.com/ctf
  */
 
-#include <babeltrace/ctf-ir/field-types.h>
-#include <babeltrace/ctf-ir/trace.h>
+#include <babeltrace/ctf-writer/field-types.h>
+#include <babeltrace/ctf-writer/stream-class.h>
+#include <babeltrace/ctf-writer/stream.h>
+#include <babeltrace/ctf-writer/trace.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -95,6 +95,23 @@ 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.
  *
@@ -165,8 +182,20 @@ extern int bt_ctf_writer_set_byte_order(struct bt_ctf_writer *writer,
  *
  * @param writer Writer instance.
  */
-extern void bt_ctf_writer_get(struct bt_ctf_writer *writer);
-extern void bt_ctf_writer_put(struct bt_ctf_writer *writer);
+
+/* 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
 }
This page took 0.025146 seconds and 4 git commands to generate.