ir: move writer-specific declarations to writer header
[babeltrace.git] / include / babeltrace / ctf-writer / event-fields.h
index 3ab3e39fffa9f6a9bee82a76df8b1c98bb4530d1..ce13907a13b827c341ed162b41560db02350fe9f 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef BABELTRACE_CTF_WRITER_EVENT_FIELDS_H
+#define BABELTRACE_CTF_WRITER_EVENT_FIELDS_H
+
 /*
  * BabelTrace - CTF Writer: Event Fields
  *
  */
 
 #include <babeltrace/ctf-ir/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_get() and bt_ctf_put() 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.
+ */
+extern void bt_ctf_field_get(struct bt_ctf_field *field);
+extern void bt_ctf_field_put(struct bt_ctf_field *field);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_CTF_WRITER_EVENT_FIELDS_H */
This page took 0.024116 seconds and 4 git commands to generate.