Fix copytrace: copy packet_context
[babeltrace.git] / plugins / libctfcopytrace / ctfcopytrace.h
index 748addf79a8369e85f4c7f283022c274f74ab4c2..785f8a4711b98459f7b0f248594c6bb81ea7933d 100644 (file)
@@ -29,7 +29,7 @@
 
 #include <stdbool.h>
 #include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/component/component.h>
+#include <babeltrace/graph/component.h>
 #include <babeltrace/ctf-writer/writer.h>
 
 #ifdef __cplusplus
@@ -51,6 +51,7 @@ 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,
@@ -61,6 +62,7 @@ enum bt_component_status ctf_copy_clock_classes(FILE *err,
  *
  * Returns NULL on error.
  */
+BT_HIDDEN
 struct bt_ctf_event_class *ctf_copy_event_class(FILE *err,
                struct bt_ctf_event_class *event_class);
 
@@ -71,6 +73,7 @@ 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);
@@ -80,6 +83,7 @@ enum bt_component_status ctf_copy_event_classes(FILE *err,
  *
  * Returns NULL or error.
  */
+BT_HIDDEN
 struct bt_ctf_stream_class *ctf_copy_stream_class(FILE *err,
                struct bt_ctf_stream_class *stream_class,
                struct bt_ctf_trace *writer_trace,
@@ -92,6 +96,7 @@ 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,
@@ -99,23 +104,32 @@ enum bt_component_status ctf_copy_packet_context_field(FILE *err,
 
 /*
  * 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.
  */
-struct bt_ctf_field *ctf_copy_packet_context(FILE *err,
-               struct bt_ctf_packet *packet,
+BT_HIDDEN
+int ctf_stream_copy_packet_context(FILE *err, struct bt_ctf_packet *packet,
                struct bt_ctf_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.
+ */
+BT_HIDDEN
+int ctf_packet_copy_context(FILE *err, struct bt_ctf_packet *packet,
+               struct bt_ctf_stream *writer_stream,
+               struct bt_ctf_packet *writer_packet);
+
 /*
  * Create and return a copy of the event passed in parameter. The caller has to
  * append it to the writer_stream.
  *
  * Returns NULL on error.
  */
+BT_HIDDEN
 struct bt_ctf_event *ctf_copy_event(FILE *err, struct bt_ctf_event *event,
                struct bt_ctf_event_class *writer_event_class,
                bool override_ts64);
@@ -125,6 +139,7 @@ struct bt_ctf_event *ctf_copy_event(FILE *err, struct bt_ctf_event *event,
  *
  * Returns 0 on success, -1 on error.
  */
+BT_HIDDEN
 int ctf_copy_event_header(FILE *err, struct bt_ctf_event *event,
                struct bt_ctf_event_class *writer_event_class,
                struct bt_ctf_event *writer_event,
@@ -137,6 +152,7 @@ int ctf_copy_event_header(FILE *err, struct bt_ctf_event *event,
  * Returns BT_COMPONENT_STATUS_OK on success, and BT_COMPONENT_STATUS_ERROR on
  * error.
  */
+BT_HIDDEN
 enum bt_component_status ctf_copy_trace(FILE *err, struct bt_ctf_trace *trace,
                struct bt_ctf_trace *writer_trace);
 
This page took 0.024251 seconds and 4 git commands to generate.