X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Flibctfcopytrace%2Fctfcopytrace.h;h=c57f488b06e93186a3999e283d6aae228a9b6449;hb=40f4ba76dd6f9508ca51b6220eaed57632281a07;hp=004e330a00ac40dd55baf042a513ba9ce35d40c4;hpb=b2f1f465086eb82ac6b1a57538b643fdced00ac5;p=babeltrace.git diff --git a/plugins/libctfcopytrace/ctfcopytrace.h b/plugins/libctfcopytrace/ctfcopytrace.h index 004e330a..c57f488b 100644 --- a/plugins/libctfcopytrace/ctfcopytrace.h +++ b/plugins/libctfcopytrace/ctfcopytrace.h @@ -29,8 +29,7 @@ #include #include -#include -#include +#include #ifdef __cplusplus extern "C" { @@ -41,8 +40,8 @@ extern "C" { * * Returns NULL on error. */ -struct bt_ctf_clock_class *ctf_copy_clock_class(FILE *err, - struct bt_ctf_clock_class *clock_class); +const struct bt_clock_class *ctf_copy_clock_class(FILE *err, + const struct bt_clock_class *clock_class); /* * Copy all the clock classes from the input trace and add them to the writer @@ -51,18 +50,21 @@ struct bt_ctf_clock_class *ctf_copy_clock_class(FILE *err, * Returns BT_COMPONENT_STATUS_OK on success, and BT_COMPONENT_STATUS_ERROR on * error. */ +BT_HIDDEN enum bt_component_status ctf_copy_clock_classes(FILE *err, - struct bt_ctf_trace *writer_trace, - struct bt_ctf_stream_class *writer_stream_class, - struct bt_ctf_trace *trace); + const struct bt_trace *writer_trace, + const struct bt_stream_class *writer_stream_class, + const struct bt_trace *trace); /* - * Create a copy of the event class passed in paramater. + * Create a copy of the event class passed in parameter. * * Returns NULL on error. */ -struct bt_ctf_event_class *ctf_copy_event_class(FILE *err, - struct bt_ctf_event_class *event_class); +BT_HIDDEN +const struct bt_event_class *ctf_copy_event_class(FILE *err, + const struct bt_trace *trace_copy, + const struct bt_event_class *event_class); /* * Copy all the event classes from the input stream class and add them to the @@ -71,18 +73,20 @@ struct bt_ctf_event_class *ctf_copy_event_class(FILE *err, * Returns BT_COMPONENT_STATUS_OK on success, and BT_COMPONENT_STATUS_ERROR on * error. */ +BT_HIDDEN enum bt_component_status ctf_copy_event_classes(FILE *err, - struct bt_ctf_stream_class *stream_class, - struct bt_ctf_stream_class *writer_stream_class); + const struct bt_stream_class *stream_class, + const struct bt_stream_class *writer_stream_class); /* * Create a copy of the stream class passed in parameter. * * Returns NULL or error. */ -struct bt_ctf_stream_class *ctf_copy_stream_class(FILE *err, - struct bt_ctf_stream_class *stream_class, - struct bt_ctf_trace *writer_trace, +BT_HIDDEN +const struct bt_stream_class *ctf_copy_stream_class(FILE *err, + const struct bt_stream_class *stream_class, + const struct bt_trace *writer_trace, bool override_ts64); /* @@ -92,23 +96,53 @@ struct bt_ctf_stream_class *ctf_copy_stream_class(FILE *err, * Returns BT_COMPONENT_STATUS_OK on success, and BT_COMPONENT_STATUS_ERROR on * error. */ +BT_HIDDEN enum bt_component_status ctf_copy_packet_context_field(FILE *err, - struct bt_ctf_field *field, const char *field_name, - struct bt_ctf_field *writer_packet_context, - struct bt_ctf_field_type *writer_packet_context_type); + const struct bt_field *field, const char *field_name, + const struct bt_field *writer_packet_context, + struct bt_field_type *writer_packet_context_type); + + +/* + * Copy the packet_header from the packet passed in parameter and assign it + * to the writer_stream. + * + * Returns 0 on success or -1 on error. + */ +BT_HIDDEN +int ctf_stream_copy_packet_header(FILE *err, const struct bt_packet *packet, + const struct bt_stream *writer_stream); + +/* + * Copy the packet_header from the packet passed in parameter and assign it + * to the writer_packet. + * + * Returns 0 on success or -1 on error. + */ +BT_HIDDEN +int ctf_packet_copy_header(FILE *err, const struct bt_packet *packet, + const struct bt_packet *writer_packet); /* * Copy all the field values of the packet context from the packet passed in - * parameter and set it to the current packet in the writer stream. - * The content_size and packet_size fields are not copied since they are - * already handled by the ctf_writer library. + * parameter and set it to the writer_stream. * - * Returns BT_COMPONENT_STATUS_OK on success, and BT_COMPONENT_STATUS_ERROR on - * error. + * Returns 0 on success or -1 on error. + */ +BT_HIDDEN +int ctf_stream_copy_packet_context(FILE *err, const struct bt_packet *packet, + const struct bt_stream *writer_stream); + +/* + * Copy all the field values of the packet context from the packet passed in + * parameter and set it to the writer_packet. + * + * Returns 0 on success or -1 on error. */ -struct bt_ctf_field *ctf_copy_packet_context(FILE *err, - struct bt_ctf_packet *packet, - struct bt_ctf_stream *writer_stream); +BT_HIDDEN +int ctf_packet_copy_context(FILE *err, const struct bt_packet *packet, + const struct bt_stream *writer_stream, + const struct bt_packet *writer_packet); /* * Create and return a copy of the event passed in parameter. The caller has to @@ -116,10 +150,22 @@ struct bt_ctf_field *ctf_copy_packet_context(FILE *err, * * Returns NULL on error. */ -struct bt_ctf_event *ctf_copy_event(FILE *err, struct bt_ctf_event *event, - struct bt_ctf_event_class *writer_event_class, +BT_HIDDEN +const struct bt_event *ctf_copy_event(FILE *err, const struct bt_event *event, + const struct bt_event_class *writer_event_class, bool override_ts64); +/* + * Copies the content of the event header to writer_event_header. + * + * Returns 0 on success, -1 on error. + */ +BT_HIDDEN +int ctf_copy_event_header(FILE *err, const struct bt_event *event, + const struct bt_event_class *writer_event_class, + const struct bt_event *writer_event, + const struct bt_field *event_header); + /* * Copy the environment and the packet header from the input trace to the * writer_trace. @@ -127,8 +173,9 @@ struct bt_ctf_event *ctf_copy_event(FILE *err, struct bt_ctf_event *event, * Returns BT_COMPONENT_STATUS_OK on success, and BT_COMPONENT_STATUS_ERROR on * error. */ -enum bt_component_status ctf_copy_trace(FILE *err, struct bt_ctf_trace *trace, - struct bt_ctf_trace *writer_trace); +BT_HIDDEN +enum bt_component_status ctf_copy_trace(FILE *err, const struct bt_trace *trace, + const struct bt_trace *writer_trace); #ifdef __cplusplus }