Typo: paramater -> parameter
[babeltrace.git] / plugins / libctfcopytrace / ctfcopytrace.h
CommitLineData
91b73004
JD
1#ifndef BABELTRACE_LIB_COPY_TRACE_H
2#define BABELTRACE_LIB_COPY_TRACE_H
3
4/*
5 * BabelTrace - Library to create a copy of a CTF trace
6 *
7 * Copyright 2017 Julien Desfossez <jdesfossez@efficios.com>
8 *
9 * Author: Julien Desfossez <jdesfossez@efficios.com>
10 *
11 * Permission is hereby granted, free of charge, to any person obtaining a copy
12 * of this software and associated documentation files (the "Software"), to deal
13 * in the Software without restriction, including without limitation the rights
14 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 * copies of the Software, and to permit persons to whom the Software is
16 * furnished to do so, subject to the following conditions:
17 *
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 * SOFTWARE.
28 */
29
30#include <stdbool.h>
31#include <babeltrace/babeltrace-internal.h>
9d408fca 32#include <babeltrace/babeltrace.h>
91b73004
JD
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38/*
39 * Create a copy of the clock_class passed in parameter.
40 *
41 * Returns NULL on error.
42 */
50842bdc
PP
43struct bt_clock_class *ctf_copy_clock_class(FILE *err,
44 struct bt_clock_class *clock_class);
91b73004
JD
45
46/*
47 * Copy all the clock classes from the input trace and add them to the writer
48 * object.
49 *
50 * Returns BT_COMPONENT_STATUS_OK on success, and BT_COMPONENT_STATUS_ERROR on
51 * error.
52 */
9ac68eb1 53BT_HIDDEN
91b73004 54enum bt_component_status ctf_copy_clock_classes(FILE *err,
50842bdc
PP
55 struct bt_trace *writer_trace,
56 struct bt_stream_class *writer_stream_class,
57 struct bt_trace *trace);
91b73004
JD
58
59/*
54b8d024 60 * Create a copy of the event class passed in parameter.
91b73004
JD
61 *
62 * Returns NULL on error.
63 */
9ac68eb1 64BT_HIDDEN
50842bdc
PP
65struct bt_event_class *ctf_copy_event_class(FILE *err,
66 struct bt_event_class *event_class);
91b73004
JD
67
68/*
69 * Copy all the event classes from the input stream class and add them to the
70 * writer_stream_class.
71 *
72 * Returns BT_COMPONENT_STATUS_OK on success, and BT_COMPONENT_STATUS_ERROR on
73 * error.
74 */
9ac68eb1 75BT_HIDDEN
91b73004 76enum bt_component_status ctf_copy_event_classes(FILE *err,
50842bdc
PP
77 struct bt_stream_class *stream_class,
78 struct bt_stream_class *writer_stream_class);
91b73004
JD
79
80/*
81 * Create a copy of the stream class passed in parameter.
82 *
83 * Returns NULL or error.
84 */
9ac68eb1 85BT_HIDDEN
50842bdc
PP
86struct bt_stream_class *ctf_copy_stream_class(FILE *err,
87 struct bt_stream_class *stream_class,
88 struct bt_trace *writer_trace,
b2f1f465 89 bool override_ts64);
91b73004
JD
90
91/*
92 * Copy the value of a packet context field and add it to the
93 * writer_packet_context. Only supports unsigned integers for now.
94 *
95 * Returns BT_COMPONENT_STATUS_OK on success, and BT_COMPONENT_STATUS_ERROR on
96 * error.
97 */
9ac68eb1 98BT_HIDDEN
91b73004 99enum bt_component_status ctf_copy_packet_context_field(FILE *err,
50842bdc
PP
100 struct bt_field *field, const char *field_name,
101 struct bt_field *writer_packet_context,
102 struct bt_field_type *writer_packet_context_type);
91b73004 103
387483fc
JD
104
105/*
106 * Copy the packet_header from the packet passed in parameter and assign it
107 * to the writer_stream.
108 *
109 * Returns 0 on success or -1 on error.
110 */
111BT_HIDDEN
50842bdc
PP
112int ctf_stream_copy_packet_header(FILE *err, struct bt_packet *packet,
113 struct bt_stream *writer_stream);
387483fc
JD
114
115/*
116 * Copy the packet_header from the packet passed in parameter and assign it
117 * to the writer_packet.
118 *
119 * Returns 0 on success or -1 on error.
120 */
121BT_HIDDEN
50842bdc
PP
122int ctf_packet_copy_header(FILE *err, struct bt_packet *packet,
123 struct bt_packet *writer_packet);
387483fc 124
91b73004
JD
125/*
126 * Copy all the field values of the packet context from the packet passed in
9877e1aa 127 * parameter and set it to the writer_stream.
91b73004 128 *
9877e1aa 129 * Returns 0 on success or -1 on error.
91b73004 130 */
9ac68eb1 131BT_HIDDEN
50842bdc
PP
132int ctf_stream_copy_packet_context(FILE *err, struct bt_packet *packet,
133 struct bt_stream *writer_stream);
91b73004 134
9877e1aa
JD
135/*
136 * Copy all the field values of the packet context from the packet passed in
137 * parameter and set it to the writer_packet.
138 *
139 * Returns 0 on success or -1 on error.
140 */
141BT_HIDDEN
50842bdc
PP
142int ctf_packet_copy_context(FILE *err, struct bt_packet *packet,
143 struct bt_stream *writer_stream,
144 struct bt_packet *writer_packet);
9877e1aa 145
91b73004
JD
146/*
147 * Create and return a copy of the event passed in parameter. The caller has to
148 * append it to the writer_stream.
149 *
150 * Returns NULL on error.
151 */
9ac68eb1 152BT_HIDDEN
50842bdc
PP
153struct bt_event *ctf_copy_event(FILE *err, struct bt_event *event,
154 struct bt_event_class *writer_event_class,
b2f1f465 155 bool override_ts64);
91b73004 156
0f29db56
JD
157/*
158 * Copies the content of the event header to writer_event_header.
159 *
160 * Returns 0 on success, -1 on error.
161 */
9ac68eb1 162BT_HIDDEN
50842bdc
PP
163int ctf_copy_event_header(FILE *err, struct bt_event *event,
164 struct bt_event_class *writer_event_class,
165 struct bt_event *writer_event,
166 struct bt_field *event_header);
0f29db56 167
91b73004
JD
168/*
169 * Copy the environment and the packet header from the input trace to the
170 * writer_trace.
171 *
172 * Returns BT_COMPONENT_STATUS_OK on success, and BT_COMPONENT_STATUS_ERROR on
173 * error.
174 */
9ac68eb1 175BT_HIDDEN
50842bdc
PP
176enum bt_component_status ctf_copy_trace(FILE *err, struct bt_trace *trace,
177 struct bt_trace *writer_trace);
91b73004
JD
178
179#ifdef __cplusplus
180}
181#endif
182
183#endif /* BABELTRACE_LIB_COPY_TRACE_H */
This page took 0.038623 seconds and 4 git commands to generate.