Make API CTF-agnostic
[babeltrace.git] / include / babeltrace / ctf-ir / trace.h
CommitLineData
bc37ae52
JG
1#ifndef BABELTRACE_CTF_IR_TRACE_H
2#define BABELTRACE_CTF_IR_TRACE_H
3
4/*
5 * BabelTrace - CTF IR: Trace
6 *
7 * Copyright 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 *
9 * Author: Jérémie Galarneau <jeremie.galarneau@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 * The Common Trace Format (CTF) Specification is available at
30 * http://www.efficios.com/ctf
31 */
32
7b33a0e0 33/* For bt_bool, bt_uuid */
c55a9f58 34#include <babeltrace/types.h>
7b33a0e0 35
410d0373 36#include <stdint.h>
bc37ae52
JG
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
839d52a5
PP
42struct bt_trace;
43struct bt_stream;
44struct bt_stream_class;
a6918753
PP
45struct bt_field_type;
46struct bt_value;
47struct bt_packet_header_field;
bc37ae52 48
839d52a5 49typedef void (* bt_trace_is_static_listener)(
7b33a0e0 50 struct bt_trace *trace, void *data);
9962ad4b 51
839d52a5 52typedef void (* bt_trace_listener_removed)(
7b33a0e0 53 struct bt_trace *trace, void *data);
06300316 54
839d52a5 55extern struct bt_trace *bt_trace_create(void);
bc37ae52 56
7b33a0e0
PP
57extern bt_bool bt_trace_assigns_automatic_stream_class_id(
58 struct bt_trace *trace);
06300316 59
7b33a0e0
PP
60extern int bt_trace_set_assigns_automatic_stream_class_id(
61 struct bt_trace *trace, bt_bool value);
06300316 62
7b33a0e0 63extern const char *bt_trace_get_name(struct bt_trace *trace);
06300316 64
7b33a0e0 65extern int bt_trace_set_name(struct bt_trace *trace, const char *name);
06300316 66
7b33a0e0 67extern bt_uuid bt_trace_get_uuid(struct bt_trace *trace);
bc37ae52 68
7b33a0e0 69extern int bt_trace_set_uuid(struct bt_trace *trace, bt_uuid uuid);
06300316 70
7b33a0e0 71extern uint64_t bt_trace_get_environment_entry_count(struct bt_trace *trace);
06300316 72
7b33a0e0
PP
73extern void bt_trace_borrow_environment_entry_by_index(
74 struct bt_trace *trace, uint64_t index,
75 const char **name, struct bt_value **value);
06300316 76
7b33a0e0
PP
77extern struct bt_value *bt_trace_borrow_environment_entry_value_by_name(
78 struct bt_trace *trace, const char *name);
06300316 79
7b33a0e0
PP
80extern int bt_trace_set_environment_entry_integer(
81 struct bt_trace *trace, const char *name,
06300316 82 int64_t value);
884cd6c3 83
7b33a0e0
PP
84extern int bt_trace_set_environment_entry_string(
85 struct bt_trace *trace, const char *name,
06300316
PP
86 const char *value);
87
5fe68922 88extern struct bt_field_type *bt_trace_borrow_packet_header_field_type(
a6918753
PP
89 struct bt_trace *trace);
90
7b33a0e0 91extern int bt_trace_set_packet_header_field_type(struct bt_trace *trace,
839d52a5 92 struct bt_field_type *packet_header_type);
06300316 93
7b33a0e0 94extern uint64_t bt_trace_get_stream_class_count(struct bt_trace *trace);
06300316 95
5fe68922 96extern struct bt_stream_class *bt_trace_borrow_stream_class_by_index(
7b33a0e0 97 struct bt_trace *trace, uint64_t index);
5fe68922
PP
98
99extern struct bt_stream_class *bt_trace_borrow_stream_class_by_id(
7b33a0e0 100 struct bt_trace *trace, uint64_t id);
06300316 101
7b33a0e0 102extern uint64_t bt_trace_get_stream_count(struct bt_trace *trace);
c1e730fe 103
5fe68922 104extern struct bt_stream *bt_trace_borrow_stream_by_index(
7b33a0e0 105 struct bt_trace *trace, uint64_t index);
5acf2ae6 106
7b33a0e0
PP
107extern struct bt_stream *bt_trace_borrow_stream_by_id(
108 struct bt_trace *trace, uint64_t id);
5acf2ae6 109
7b33a0e0 110extern bt_bool bt_trace_is_static(struct bt_trace *trace);
5acf2ae6 111
7b33a0e0 112extern int bt_trace_make_static(struct bt_trace *trace);
5acf2ae6 113
839d52a5 114extern int bt_trace_add_is_static_listener(
7b33a0e0 115 struct bt_trace *trace,
839d52a5 116 bt_trace_is_static_listener listener,
7b33a0e0
PP
117 bt_trace_listener_removed listener_removed, void *data,
118 uint64_t *listener_id);
3602afb0 119
839d52a5 120extern int bt_trace_remove_is_static_listener(
7b33a0e0 121 struct bt_trace *trace, uint64_t listener_id);
35827558 122
bc37ae52
JG
123#ifdef __cplusplus
124}
125#endif
126
127#endif /* BABELTRACE_CTF_IR_TRACE_H */
This page took 0.052608 seconds and 4 git commands to generate.