From: Philippe Proulx Date: Mon, 8 Feb 2016 07:11:20 +0000 (-0500) Subject: ir: add internal bt_ctf_field_path_clear() X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=7073124e5d99f6b6cf7d8cc31e99fb41efc987fe;p=deliverable%2Fbabeltrace.git ir: add internal bt_ctf_field_path_clear() Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/formats/ctf/ir/event-types.c b/formats/ctf/ir/event-types.c index 9b6b10464..37a0d14f8 100644 --- a/formats/ctf/ir/event-types.c +++ b/formats/ctf/ir/event-types.c @@ -2380,6 +2380,14 @@ end: return field_path; } +BT_HIDDEN +void bt_ctf_field_path_clear(struct bt_ctf_field_path *field_path) +{ + if (field_path->path_indexes->len > 0) { + g_array_remove_range(field_path->path_indexes, 0, + field_path->path_indexes->len); + } +} BT_HIDDEN struct bt_ctf_field_path *bt_ctf_field_path_copy( diff --git a/include/babeltrace/ctf-ir/event-types-internal.h b/include/babeltrace/ctf-ir/event-types-internal.h index 5a8538f4a..ba979682e 100644 --- a/include/babeltrace/ctf-ir/event-types-internal.h +++ b/include/babeltrace/ctf-ir/event-types-internal.h @@ -219,6 +219,9 @@ struct bt_ctf_field_type *bt_ctf_field_type_copy( BT_HIDDEN struct bt_ctf_field_path *bt_ctf_field_path_create(void); +BT_HIDDEN +void bt_ctf_field_path_clear(struct bt_ctf_field_path *field_path); + BT_HIDDEN struct bt_ctf_field_path *bt_ctf_field_path_copy( struct bt_ctf_field_path *path);