From 7073124e5d99f6b6cf7d8cc31e99fb41efc987fe Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Mon, 8 Feb 2016 02:11:20 -0500 Subject: [PATCH] ir: add internal bt_ctf_field_path_clear() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- formats/ctf/ir/event-types.c | 8 ++++++++ include/babeltrace/ctf-ir/event-types-internal.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/formats/ctf/ir/event-types.c b/formats/ctf/ir/event-types.c index 9b6b1046..37a0d14f 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 5a8538f4..ba979682 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); -- 2.34.1