X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fctf-ir%2Fevent-fields.h;h=2b682bb649d90c28e53f7c21d507b49628cbb31a;hb=de3dd40e6fcad56e227f5fc8a8290fbaa88b4e07;hp=1d8f6439e3a761f1cf0efba5d0548ff73a90a1a8;hpb=a39fe52e530cc40ae74194f885e80246bea47f90;p=babeltrace.git diff --git a/include/babeltrace/ctf-ir/event-fields.h b/include/babeltrace/ctf-ir/event-fields.h index 1d8f6439..2b682bb6 100644 --- a/include/babeltrace/ctf-ir/event-fields.h +++ b/include/babeltrace/ctf-ir/event-fields.h @@ -154,6 +154,22 @@ extern struct bt_ctf_field *bt_ctf_field_sequence_get_field( extern struct bt_ctf_field *bt_ctf_field_variant_get_field( struct bt_ctf_field *variant, struct bt_ctf_field *tag); +/* + * bt_ctf_field_variant_get_current_field: get the current selected field of a + * variant. + * + * Return the variant's current selected 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. + * + * @param variant Variant field instance. + * + * Returns a field instance on success, NULL on error or when there's no + * current selected field. + */ +extern struct bt_ctf_field *bt_ctf_field_variant_get_current_field( + struct bt_ctf_field *variant); + /* * bt_ctf_field_enumeration_get_container: get an enumeration field's container. * @@ -354,6 +370,8 @@ 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