Split CTF IR and CTF writer APIs and implementations
[babeltrace.git] / include / babeltrace / ctf-writer / event-types.h
index abad28c56928b6fdcf9f8b38a44947723c44a885..9b41bf09b04f0416e54cd9f8a5ca03aa33b7701b 100644 (file)
@@ -1,7 +1,10 @@
+#ifndef BABELTRACE_CTF_WRITER_EVENT_TYPES_H
+#define BABELTRACE_CTF_WRITER_EVENT_TYPES_H
+
 /*
  * BabelTrace - CTF Writer: Event Types
  *
- * Copyright 2013 EfficiOS Inc.
+ * 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/event-types.h>
+#include <babeltrace/ref.h>
+#include <babeltrace/ctf-ir/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_get() and bt_put() 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_field_type *type)
+{
+       bt_get(type);
+}
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+void bt_ctf_field_type_put(struct bt_field_type *type)
+{
+       bt_put(type);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_CTF_WRITER_EVENT_TYPES_H */
This page took 0.023775 seconds and 4 git commands to generate.