X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fctf-ir%2Fclock.h;h=5858a711ef7b0c00e0f02d8c95f2eea662794c46;hb=c06116f32e056500c8c64364d65d04665a77644b;hp=a9ba7134be0c45937d88c669bb5347546303031d;hpb=e1e30a8c4db03e39b614e97479a3f0aeb1ceadc7;p=babeltrace.git diff --git a/include/babeltrace/ctf-ir/clock.h b/include/babeltrace/ctf-ir/clock.h index a9ba7134..5858a711 100644 --- a/include/babeltrace/ctf-ir/clock.h +++ b/include/babeltrace/ctf-ir/clock.h @@ -49,6 +49,10 @@ struct bt_ctf_clock; */ extern struct bt_ctf_clock *bt_ctf_clock_create(const char *name); +extern struct bt_ctf_clock *bt_ctf_clock_create_empty(void); + +extern int bt_ctf_clock_set_name(struct bt_ctf_clock *clock, const char *name); + /* * bt_ctf_clock_get_name: get a clock's name. * @@ -237,55 +241,9 @@ extern const unsigned char *bt_ctf_clock_get_uuid(struct bt_ctf_clock *clock); extern int bt_ctf_clock_set_uuid(struct bt_ctf_clock *clock, const unsigned char *uuid); -/* - * bt_ctf_clock_get_time: get a clock's current time value. - * - * Get the current time in nanoseconds since the clock's origin (offset and - * offset_s attributes). - * - * @param clock Clock instance. - * @param time Clock current time value (output). - * - * Returns 0 on success, a negative value on error. - */ -extern int bt_ctf_clock_get_time(struct bt_ctf_clock *clock, - int64_t *time); - -/* - * bt_ctf_clock_set_time: set a clock's current time value. - * - * Set the current time in nanoseconds since the clock's origin (offset and - * offset_s attributes). Defaults to 0. - * - * Returns 0 on success, a negative value on error. - */ -extern int bt_ctf_clock_set_time(struct bt_ctf_clock *clock, - int64_t time); - -extern uint64_t bt_ctf_clock_get_value(struct bt_ctf_clock *clock); - -extern int bt_ctf_clock_set_value(struct bt_ctf_clock *clock, +extern int64_t bt_ctf_clock_ns_from_value(struct bt_ctf_clock *clock, uint64_t value); -/* - * bt_ctf_clock_get and bt_ctf_clock_put: increment and decrement the - * refcount of the clock - * - * You may also use bt_ctf_get() and bt_ctf_put() with clock objects. - * - * These functions ensure that the clock 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) has to be done to - * destroy a clock. - * - * When the clock refcount is decremented to 0 by a bt_ctf_clock_put, - * the clock is freed. - * - * @param clock Clock instance. - */ -extern void bt_ctf_clock_get(struct bt_ctf_clock *clock); -extern void bt_ctf_clock_put(struct bt_ctf_clock *clock); - #ifdef __cplusplus } #endif