From 8c18d80b69a10f94980d33e6f1c1bdb26b447487 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Fri, 19 Feb 2016 18:07:25 -0500 Subject: [PATCH] ir: move writer-specific declarations to writer header 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 --- include/babeltrace/ctf-ir/clock.h | 19 --- include/babeltrace/ctf-ir/event-class.h | 19 --- include/babeltrace/ctf-ir/event.h | 19 --- include/babeltrace/ctf-ir/field-types.h | 19 --- include/babeltrace/ctf-ir/fields.h | 19 --- include/babeltrace/ctf-ir/stream-class.h | 19 --- include/babeltrace/ctf-ir/stream.h | 134 ----------------- include/babeltrace/ctf-writer/clock.h | 32 ++++ include/babeltrace/ctf-writer/event-fields.h | 32 ++++ include/babeltrace/ctf-writer/event-types.h | 32 ++++ include/babeltrace/ctf-writer/event.h | 51 +++++++ include/babeltrace/ctf-writer/stream-class.h | 32 ++++ include/babeltrace/ctf-writer/stream.h | 148 +++++++++++++++++++ 13 files changed, 327 insertions(+), 248 deletions(-) diff --git a/include/babeltrace/ctf-ir/clock.h b/include/babeltrace/ctf-ir/clock.h index a9ba7134..1b7a004d 100644 --- a/include/babeltrace/ctf-ir/clock.h +++ b/include/babeltrace/ctf-ir/clock.h @@ -267,25 +267,6 @@ 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, 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 diff --git a/include/babeltrace/ctf-ir/event-class.h b/include/babeltrace/ctf-ir/event-class.h index 5144b77c..314260a5 100644 --- a/include/babeltrace/ctf-ir/event-class.h +++ b/include/babeltrace/ctf-ir/event-class.h @@ -302,25 +302,6 @@ extern int bt_ctf_event_class_set_context_type( struct bt_ctf_event_class *event_class, struct bt_ctf_field_type *context); -/* - * bt_ctf_event_class_get and bt_ctf_event_class_put: increment and decrement - * the event class' reference count. - * - * You may also use bt_ctf_get() and bt_ctf_put() with event class objects. - * - * These functions ensure that the event class won't be destroyed while 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 - * destroy an event class. - * - * When the event class' reference count is decremented to 0 by a - * bt_ctf_event_class_put, the event class is freed. - * - * @param event_class Event class. - */ -extern void bt_ctf_event_class_get(struct bt_ctf_event_class *event_class); -extern void bt_ctf_event_class_put(struct bt_ctf_event_class *event_class); - #ifdef __cplusplus } #endif diff --git a/include/babeltrace/ctf-ir/event.h b/include/babeltrace/ctf-ir/event.h index 4770f5ea..f2e809e9 100644 --- a/include/babeltrace/ctf-ir/event.h +++ b/include/babeltrace/ctf-ir/event.h @@ -258,25 +258,6 @@ extern struct bt_ctf_event *bt_ctf_event_copy(struct bt_ctf_event *event); extern int bt_ctf_event_set_packet(struct bt_ctf_event *event, struct bt_ctf_packet *packet); -/* - * bt_ctf_event_get and bt_ctf_event_put: increment and decrement - * the event's reference count. - * - * You may also use bt_ctf_get() and bt_ctf_put() with event objects. - * - * These functions ensure that the event won't be destroyed while 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 - * destroy an event. - * - * When the event's reference count is decremented to 0 by a - * bt_ctf_event_put, the event is freed. - * - * @param event Event instance. - */ -extern void bt_ctf_event_get(struct bt_ctf_event *event); -extern void bt_ctf_event_put(struct bt_ctf_event *event); - #ifdef __cplusplus } #endif diff --git a/include/babeltrace/ctf-ir/field-types.h b/include/babeltrace/ctf-ir/field-types.h index ce9ca72f..3be4a5a0 100644 --- a/include/babeltrace/ctf-ir/field-types.h +++ b/include/babeltrace/ctf-ir/field-types.h @@ -941,25 +941,6 @@ extern int bt_ctf_field_type_is_sequence(struct bt_ctf_field_type *type); */ extern int bt_ctf_field_type_is_variant(struct bt_ctf_field_type *type); -/* - * bt_ctf_field_type_get and bt_ctf_field_type_put: increment and decrement - * the field type's reference count. - * - * You may also use bt_ctf_get() and bt_ctf_put() with field type objects. - * - * These functions ensure that the field type won't be destroyed while 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 - * destroy a field type. - * - * When the field type's reference count is decremented to 0 by a - * bt_ctf_field_type_put, the field type is freed. - * - * @param type Field type. - */ -extern void bt_ctf_field_type_get(struct bt_ctf_field_type *type); -extern void bt_ctf_field_type_put(struct bt_ctf_field_type *type); - #ifdef __cplusplus } #endif diff --git a/include/babeltrace/ctf-ir/fields.h b/include/babeltrace/ctf-ir/fields.h index 1b1ac8c2..cbed745a 100644 --- a/include/babeltrace/ctf-ir/fields.h +++ b/include/babeltrace/ctf-ir/fields.h @@ -460,25 +460,6 @@ extern int bt_ctf_field_is_variant(struct bt_ctf_field *field); */ 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 - * destroy a field. - * - * When the field's reference count is decremented to 0 by a bt_ctf_field_put, - * the field is freed. - * - * @param field Field instance. - */ -extern void bt_ctf_field_get(struct bt_ctf_field *field); -extern void bt_ctf_field_put(struct bt_ctf_field *field); - #ifdef __cplusplus } #endif diff --git a/include/babeltrace/ctf-ir/stream-class.h b/include/babeltrace/ctf-ir/stream-class.h index 75be6b67..ca929afb 100644 --- a/include/babeltrace/ctf-ir/stream-class.h +++ b/include/babeltrace/ctf-ir/stream-class.h @@ -286,25 +286,6 @@ extern int bt_ctf_stream_class_set_event_context_type( struct bt_ctf_stream_class *stream_class, struct bt_ctf_field_type *event_context_type); -/* - * bt_ctf_stream_class_get and bt_ctf_stream_class_put: increment and - * decrement the stream class' reference count. - * - * You may also use bt_ctf_get() and bt_ctf_put() with stream class objects. - * - * These functions ensure that the stream class won't be destroyed while 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 - * destroy a stream class. - * - * When the stream class' reference count is decremented to 0 by a - * bt_ctf_stream_class_put, the stream class is freed. - * - * @param stream_class Stream class. - */ -extern void bt_ctf_stream_class_get(struct bt_ctf_stream_class *stream_class); -extern void bt_ctf_stream_class_put(struct bt_ctf_stream_class *stream_class); - #ifdef __cplusplus } #endif diff --git a/include/babeltrace/ctf-ir/stream.h b/include/babeltrace/ctf-ir/stream.h index ddb890b7..410aba7c 100644 --- a/include/babeltrace/ctf-ir/stream.h +++ b/include/babeltrace/ctf-ir/stream.h @@ -50,140 +50,6 @@ struct bt_ctf_stream; extern struct bt_ctf_stream_class *bt_ctf_stream_get_class( struct bt_ctf_stream *stream); -/* - * bt_ctf_stream_get_discarded_events_count: get the number of discarded - * events associated with this stream. - * - * Note that discarded events are not stored if the stream's packet - * context has no "events_discarded" field. An error will be returned - * in that case. - * - * @param stream Stream instance. - * - * Returns the number of discarded events, a negative value on error. - */ -extern int bt_ctf_stream_get_discarded_events_count( - struct bt_ctf_stream *stream, uint64_t *count); - -/* - * bt_ctf_stream_append_discarded_events: increment discarded events count. - * - * Increase the current packet's discarded event count. Has no effect if the - * stream class' packet context has no "events_discarded" field. - * - * @param stream Stream instance. - * @param event_count Number of discarded events to add to the stream's current - * packet. - */ -extern void bt_ctf_stream_append_discarded_events(struct bt_ctf_stream *stream, - uint64_t event_count); - -/* - * bt_ctf_stream_append_event: append an event to the stream. - * - * Append "event" to the stream's current packet. The stream's associated clock - * will be sampled during this call. The event shall not be modified after - * being appended to a stream. The stream will share the event's ownership by - * incrementing its reference count. The current packet is not flushed to disk - * until the next call to bt_ctf_stream_flush. - * - * The stream event context will be sampled for every appended event if - * a stream event context was defined. - * - * @param stream Stream instance. - * @param event Event instance to append to the stream's current packet. - * - * Returns 0 on success, a negative value on error. - */ -extern int bt_ctf_stream_append_event(struct bt_ctf_stream *stream, - struct bt_ctf_event *event); - -/* - * bt_ctf_stream_get_packet_header: get a stream's packet header. - * - * @param stream Stream instance. - * - * Returns a field instance on success, NULL on error. - */ -extern struct bt_ctf_field *bt_ctf_stream_get_packet_header( - struct bt_ctf_stream *stream); - -/* - * bt_ctf_stream_set_packet_header: set a stream's packet header. - * - * The packet header's type must match the trace's packet header - * type. - * - * @param stream Stream instance. - * @param packet_header Packet header instance. - * - * Returns a field instance on success, NULL on error. - */ -extern int bt_ctf_stream_set_packet_header( - struct bt_ctf_stream *stream, - struct bt_ctf_field *packet_header); - -/* - * bt_ctf_stream_get_packet_context: get a stream's packet context. - * - * @param stream Stream instance. - * - * Returns a field instance on success, NULL on error. - */ -extern struct bt_ctf_field *bt_ctf_stream_get_packet_context( - struct bt_ctf_stream *stream); - -/* - * bt_ctf_stream_set_packet_context: set a stream's packet context. - * - * The packet context's type must match the stream class' packet - * context type. - * - * @param stream Stream instance. - * @param packet_context Packet context field instance. - * - * Returns a field instance on success, NULL on error. - */ -extern int bt_ctf_stream_set_packet_context( - struct bt_ctf_stream *stream, - struct bt_ctf_field *packet_context); - -/* - * bt_ctf_stream_flush: flush a stream. - * - * The stream's current packet's events will be flushed, thus closing the - * current packet. Events subsequently appended to the stream will be - * added to a new packet. - * - * Flushing will also set the packet context's default attributes if - * they remained unset while populating the current packet. These default - * attributes, along with their expected types, are detailed in stream-class.h. - * - * @param stream Stream instance. - * - * Returns 0 on success, a negative value on error. - */ -extern int bt_ctf_stream_flush(struct bt_ctf_stream *stream); - -/* - * bt_ctf_stream_get and bt_ctf_stream_put: increment and decrement the - * stream's reference count. - * - * You may also use bt_ctf_get() and bt_ctf_put() with stream objects. - * - * These functions ensure that the stream won't be destroyed while 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 - * destroy a stream. - * - * When the stream's reference count is decremented to 0 by a - * bt_ctf_stream_put, the stream is freed. - * - * @param stream Stream instance. - */ -extern void bt_ctf_stream_get(struct bt_ctf_stream *stream); -extern void bt_ctf_stream_put(struct bt_ctf_stream *stream); - #ifdef __cplusplus } #endif diff --git a/include/babeltrace/ctf-writer/clock.h b/include/babeltrace/ctf-writer/clock.h index 507739b0..cb17ca2b 100644 --- a/include/babeltrace/ctf-writer/clock.h +++ b/include/babeltrace/ctf-writer/clock.h @@ -1,3 +1,6 @@ +#ifndef BABELTRACE_CTF_WRITER_CLOCK_H +#define BABELTRACE_CTF_WRITER_CLOCK_H + /* * BabelTrace - CTF Writer: Clock * @@ -28,3 +31,32 @@ */ #include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * 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 + +#endif /* BABELTRACE_CTF_WRITER_CLOCK_H */ diff --git a/include/babeltrace/ctf-writer/event-fields.h b/include/babeltrace/ctf-writer/event-fields.h index 3ab3e39f..ce13907a 100644 --- a/include/babeltrace/ctf-writer/event-fields.h +++ b/include/babeltrace/ctf-writer/event-fields.h @@ -1,3 +1,6 @@ +#ifndef BABELTRACE_CTF_WRITER_EVENT_FIELDS_H +#define BABELTRACE_CTF_WRITER_EVENT_FIELDS_H + /* * BabelTrace - CTF Writer: Event Fields * @@ -28,3 +31,32 @@ */ #include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * 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 + * destroy a field. + * + * When the field's reference count is decremented to 0 by a bt_ctf_field_put, + * the field is freed. + * + * @param field Field instance. + */ +extern void bt_ctf_field_get(struct bt_ctf_field *field); +extern void bt_ctf_field_put(struct bt_ctf_field *field); + +#ifdef __cplusplus +} +#endif + +#endif /* BABELTRACE_CTF_WRITER_EVENT_FIELDS_H */ diff --git a/include/babeltrace/ctf-writer/event-types.h b/include/babeltrace/ctf-writer/event-types.h index ac00f7e3..e19c9cde 100644 --- a/include/babeltrace/ctf-writer/event-types.h +++ b/include/babeltrace/ctf-writer/event-types.h @@ -1,3 +1,6 @@ +#ifndef BABELTRACE_CTF_WRITER_EVENT_TYPES_H +#define BABELTRACE_CTF_WRITER_EVENT_TYPES_H + /* * BabelTrace - CTF Writer: Event Types * @@ -28,3 +31,32 @@ */ #include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * bt_ctf_field_type_get and bt_ctf_field_type_put: increment and decrement + * the field type's reference count. + * + * You may also use bt_ctf_get() and bt_ctf_put() with field type objects. + * + * These functions ensure that the field type won't be destroyed while 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 + * destroy a field type. + * + * When the field type's reference count is decremented to 0 by a + * bt_ctf_field_type_put, the field type is freed. + * + * @param type Field type. + */ +extern void bt_ctf_field_type_get(struct bt_ctf_field_type *type); +extern void bt_ctf_field_type_put(struct bt_ctf_field_type *type); + +#ifdef __cplusplus +} +#endif + +#endif /* BABELTRACE_CTF_WRITER_EVENT_TYPES_H */ diff --git a/include/babeltrace/ctf-writer/event.h b/include/babeltrace/ctf-writer/event.h index fc7ec5d5..0928e083 100644 --- a/include/babeltrace/ctf-writer/event.h +++ b/include/babeltrace/ctf-writer/event.h @@ -1,3 +1,6 @@ +#ifndef BABELTRACE_CTF_WRITER_EVENT_H +#define BABELTRACE_CTF_WRITER_EVENT_H + /* * BabelTrace - CTF Writer: Event * @@ -29,3 +32,51 @@ #include #include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * bt_ctf_event_get and bt_ctf_event_put: increment and decrement + * the event's reference count. + * + * You may also use bt_ctf_get() and bt_ctf_put() with event objects. + * + * These functions ensure that the event won't be destroyed while 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 + * destroy an event. + * + * When the event's reference count is decremented to 0 by a + * bt_ctf_event_put, the event is freed. + * + * @param event Event instance. + */ +extern void bt_ctf_event_get(struct bt_ctf_event *event); +extern void bt_ctf_event_put(struct bt_ctf_event *event); + +/* + * bt_ctf_event_class_get and bt_ctf_event_class_put: increment and decrement + * the event class' reference count. + * + * You may also use bt_ctf_get() and bt_ctf_put() with event class objects. + * + * These functions ensure that the event class won't be destroyed while 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 + * destroy an event class. + * + * When the event class' reference count is decremented to 0 by a + * bt_ctf_event_class_put, the event class is freed. + * + * @param event_class Event class. + */ +extern void bt_ctf_event_class_get(struct bt_ctf_event_class *event_class); +extern void bt_ctf_event_class_put(struct bt_ctf_event_class *event_class); + +#ifdef __cplusplus +} +#endif + +#endif /* BABELTRACE_CTF_WRITER_EVENT_H */ diff --git a/include/babeltrace/ctf-writer/stream-class.h b/include/babeltrace/ctf-writer/stream-class.h index 2f6c8bdb..32096086 100644 --- a/include/babeltrace/ctf-writer/stream-class.h +++ b/include/babeltrace/ctf-writer/stream-class.h @@ -1,3 +1,6 @@ +#ifndef BABELTRACE_CTF_WRITER_STREAM_CLASS_H +#define BABELTRACE_CTF_WRITER_STREAM_CLASS_H + /* * BabelTrace - CTF Writer: Stream Class * @@ -28,3 +31,32 @@ */ #include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * bt_ctf_stream_class_get and bt_ctf_stream_class_put: increment and + * decrement the stream class' reference count. + * + * You may also use bt_ctf_get() and bt_ctf_put() with stream class objects. + * + * These functions ensure that the stream class won't be destroyed while 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 + * destroy a stream class. + * + * When the stream class' reference count is decremented to 0 by a + * bt_ctf_stream_class_put, the stream class is freed. + * + * @param stream_class Stream class. + */ +extern void bt_ctf_stream_class_get(struct bt_ctf_stream_class *stream_class); +extern void bt_ctf_stream_class_put(struct bt_ctf_stream_class *stream_class); + +#ifdef __cplusplus +} +#endif + +#endif /* BABELTRACE_CTF_WRITER_STREAM_CLASS_H */ diff --git a/include/babeltrace/ctf-writer/stream.h b/include/babeltrace/ctf-writer/stream.h index a878cae6..f8ad7b83 100644 --- a/include/babeltrace/ctf-writer/stream.h +++ b/include/babeltrace/ctf-writer/stream.h @@ -1,3 +1,6 @@ +#ifndef BABELTRACE_CTF_WRITER_STREAM_H +#define BABELTRACE_CTF_WRITER_STREAM_H + /* * BabelTrace - CTF Writer: Stream * @@ -28,3 +31,148 @@ */ #include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * bt_ctf_stream_get_discarded_events_count: get the number of discarded + * events associated with this stream. + * + * Note that discarded events are not stored if the stream's packet + * context has no "events_discarded" field. An error will be returned + * in that case. + * + * @param stream Stream instance. + * + * Returns the number of discarded events, a negative value on error. + */ +extern int bt_ctf_stream_get_discarded_events_count( + struct bt_ctf_stream *stream, uint64_t *count); + +/* + * bt_ctf_stream_append_discarded_events: increment discarded events count. + * + * Increase the current packet's discarded event count. Has no effect if the + * stream class' packet context has no "events_discarded" field. + * + * @param stream Stream instance. + * @param event_count Number of discarded events to add to the stream's current + * packet. + */ +extern void bt_ctf_stream_append_discarded_events(struct bt_ctf_stream *stream, + uint64_t event_count); + +/* + * bt_ctf_stream_append_event: append an event to the stream. + * + * Append "event" to the stream's current packet. The stream's associated clock + * will be sampled during this call. The event shall not be modified after + * being appended to a stream. The stream will share the event's ownership by + * incrementing its reference count. The current packet is not flushed to disk + * until the next call to bt_ctf_stream_flush. + * + * The stream event context will be sampled for every appended event if + * a stream event context was defined. + * + * @param stream Stream instance. + * @param event Event instance to append to the stream's current packet. + * + * Returns 0 on success, a negative value on error. + */ +extern int bt_ctf_stream_append_event(struct bt_ctf_stream *stream, + struct bt_ctf_event *event); + +/* + * bt_ctf_stream_get_packet_header: get a stream's packet header. + * + * @param stream Stream instance. + * + * Returns a field instance on success, NULL on error. + */ +extern struct bt_ctf_field *bt_ctf_stream_get_packet_header( + struct bt_ctf_stream *stream); + +/* + * bt_ctf_stream_set_packet_header: set a stream's packet header. + * + * The packet header's type must match the trace's packet header + * type. + * + * @param stream Stream instance. + * @param packet_header Packet header instance. + * + * Returns a field instance on success, NULL on error. + */ +extern int bt_ctf_stream_set_packet_header( + struct bt_ctf_stream *stream, + struct bt_ctf_field *packet_header); + +/* + * bt_ctf_stream_get_packet_context: get a stream's packet context. + * + * @param stream Stream instance. + * + * Returns a field instance on success, NULL on error. + */ +extern struct bt_ctf_field *bt_ctf_stream_get_packet_context( + struct bt_ctf_stream *stream); + +/* + * bt_ctf_stream_set_packet_context: set a stream's packet context. + * + * The packet context's type must match the stream class' packet + * context type. + * + * @param stream Stream instance. + * @param packet_context Packet context field instance. + * + * Returns a field instance on success, NULL on error. + */ +extern int bt_ctf_stream_set_packet_context( + struct bt_ctf_stream *stream, + struct bt_ctf_field *packet_context); + +/* + * bt_ctf_stream_flush: flush a stream. + * + * The stream's current packet's events will be flushed, thus closing the + * current packet. Events subsequently appended to the stream will be + * added to a new packet. + * + * Flushing will also set the packet context's default attributes if + * they remained unset while populating the current packet. These default + * attributes, along with their expected types, are detailed in stream-class.h. + * + * @param stream Stream instance. + * + * Returns 0 on success, a negative value on error. + */ +extern int bt_ctf_stream_flush(struct bt_ctf_stream *stream); + +/* + * bt_ctf_stream_get and bt_ctf_stream_put: increment and decrement the + * stream's reference count. + * + * You may also use bt_ctf_get() and bt_ctf_put() with stream objects. + * + * These functions ensure that the stream won't be destroyed while 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 + * destroy a stream. + * + * When the stream's reference count is decremented to 0 by a + * bt_ctf_stream_put, the stream is freed. + * + * @param stream Stream instance. + */ +extern void bt_ctf_stream_get(struct bt_ctf_stream *stream); +extern void bt_ctf_stream_put(struct bt_ctf_stream *stream); + +#ifdef __cplusplus +} +#endif + +#endif /* BABELTRACE_CTF_WRITER_STREAM_H */ -- 2.34.1