Add bt_ctf_field_variant_get_tag
[babeltrace.git] / include / babeltrace / ctf-ir / fields.h
index 1b1ac8c2c8bcb53f86131ba5e62a370a57df472a..9ef06e281b007b2e559fbc75beb1c09226f007ed 100644 (file)
@@ -170,6 +170,22 @@ extern struct bt_ctf_field *bt_ctf_field_variant_get_field(
 extern struct bt_ctf_field *bt_ctf_field_variant_get_current_field(
                struct bt_ctf_field *variant);
 
+/*
+ * bt_ctf_field_variant_get_tag: get the tag field of a variant.
+ *
+ * Return the variant's associated tag field. This function, unlike
+ * bt_ctf_field_variant_get_field(), does not create any field; it
+ * returns NULL if there's no current selected field yet (and, thus, no
+ * associated tag).
+ *
+ * @param variant Variant field instance.
+ *
+ * Returns a field instance (enumeration) on success, NULL on error or when
+ * there is no currently selected field.
+ */
+extern struct bt_ctf_field *bt_ctf_field_variant_get_tag(
+               struct bt_ctf_field *variant);
+
 /*
  * bt_ctf_field_enumeration_get_container: get an enumeration field's container.
  *
@@ -460,25 +476,6 @@ extern int bt_ctf_field_is_variant(struct bt_ctf_field *field);
  */
 extern struct bt_ctf_field *bt_ctf_field_copy(struct bt_ctf_field *field);
 
-/*
- * 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
This page took 0.023667 seconds and 4 git commands to generate.