ir: consolidate reference counting functions
[babeltrace.git] / include / babeltrace / ctf-ir / event-types.h
index 9562318172103ba14e1ad961af80a02b80f8b0b7..d777ce6b40603c23ff438ea28ec38e45fd561c2b 100644 (file)
@@ -501,6 +501,17 @@ extern struct bt_ctf_field_type *bt_ctf_field_type_variant_get_tag_type(
 extern const char *bt_ctf_field_type_variant_get_tag_name(
                struct bt_ctf_field_type *variant);
 
+/*
+ * bt_ctf_field_type_variant_set_tag_name: set a variant's tag name.
+ *
+ * @param variant Variant type.
+ * @param name Tag field name.
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_ctf_field_type_variant_set_tag_name(
+               struct bt_ctf_field_type *variant, const char *name);
+
 /*
  * bt_ctf_field_type_variant_add_field: add a field to a variant.
  *
@@ -686,7 +697,8 @@ extern int bt_ctf_field_type_string_set_encoding(
  *
  * @param type Field type.
  *
- * Returns the field type's alignment on success, a negative value on error.
+ * Returns the field type's alignment on success, a negative value on error and
+ * 0 if the alignment is undefined (as in the case of a variant).
  */
 extern int bt_ctf_field_type_get_alignment(struct bt_ctf_field_type *type);
 
@@ -739,25 +751,12 @@ extern int bt_ctf_field_type_set_byte_order(struct bt_ctf_field_type *type,
 extern enum ctf_type_id bt_ctf_field_type_get_type_id(
                struct bt_ctf_field_type *type);
 
-/*
- * bt_ctf_field_type_get_alias_nameL get a field type's alias name
- *
- * A type's alias name is set if it was resolved from a typedef or
- * typealias. Note that types that are resolved from a ypealias or
- * typedef are distinct from the underlying type and can't be compared
- * pointer-wise.
- *
- * @param type Field type.
- *
- * Returns a field type's alias name, NULL on error.
- */
-extern const char *bt_ctf_field_type_get_alias_name(
-               struct bt_ctf_field_type *type);
-
 /*
  * 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_get() and bt_ctf_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
This page took 0.036901 seconds and 4 git commands to generate.