From: Philippe Proulx Date: Sat, 4 Feb 2017 08:18:06 +0000 (-0500) Subject: Add bt_ctf_clock_value_get_class() X-Git-Tag: v2.0.0-pre1~510 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=6f57e4587c51b2927b70142537c9a6d31fb3a693 Add bt_ctf_clock_value_get_class() Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/formats/ctf/ir/clock-class.c b/formats/ctf/ir/clock-class.c index c51b5aab..66f7f440 100644 --- a/formats/ctf/ir/clock-class.c +++ b/formats/ctf/ir/clock-class.c @@ -480,3 +480,18 @@ int bt_ctf_clock_value_get_value_ns_from_epoch(struct bt_ctf_clock_value *value, end: return ret; } + +struct bt_ctf_clock_class *bt_ctf_clock_value_get_class( + struct bt_ctf_clock_value *clock_value) +{ + struct bt_ctf_clock_class *clock_class = NULL; + + if (!clock_value) { + goto end; + } + + clock_class = bt_get(clock_value->clock_class); + +end: + return clock_class; +} diff --git a/include/babeltrace/ctf-ir/clock-class.h b/include/babeltrace/ctf-ir/clock-class.h index c2b90173..d9c704d2 100644 --- a/include/babeltrace/ctf-ir/clock-class.h +++ b/include/babeltrace/ctf-ir/clock-class.h @@ -76,6 +76,8 @@ extern int bt_ctf_clock_class_set_uuid(struct bt_ctf_clock_class *clock_class, const unsigned char *uuid); extern struct bt_ctf_clock_value *bt_ctf_clock_value_create( struct bt_ctf_clock_class *clock_class, uint64_t value); +extern struct bt_ctf_clock_class *bt_ctf_clock_value_get_class( + struct bt_ctf_clock_value *clock_value); extern int bt_ctf_clock_value_get_value( struct bt_ctf_clock_value *clock_value, uint64_t *raw_value); extern int bt_ctf_clock_value_get_value_ns_from_epoch(