Rename: field type -> field class
[babeltrace.git] / include / babeltrace / trace-ir / trace.h
CommitLineData
56e18c4c
PP
1#ifndef BABELTRACE_TRACE_IR_TRACE_H
2#define BABELTRACE_TRACE_IR_TRACE_H
3
4/*
5 * BabelTrace - Trace 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
33/* For bt_bool, bt_uuid */
34#include <babeltrace/types.h>
35
36#include <stdint.h>
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42struct bt_trace;
43struct bt_stream;
44struct bt_stream_class;
5cd6d0e5 45struct bt_field_class;
56e18c4c
PP
46struct bt_value;
47struct bt_packet_header_field;
48
49typedef void (* bt_trace_is_static_listener)(
50 struct bt_trace *trace, void *data);
51
52typedef void (* bt_trace_listener_removed)(
53 struct bt_trace *trace, void *data);
54
55extern struct bt_trace *bt_trace_create(void);
56
57extern bt_bool bt_trace_assigns_automatic_stream_class_id(
58 struct bt_trace *trace);
59
60extern int bt_trace_set_assigns_automatic_stream_class_id(
61 struct bt_trace *trace, bt_bool value);
62
63extern const char *bt_trace_get_name(struct bt_trace *trace);
64
65extern int bt_trace_set_name(struct bt_trace *trace, const char *name);
66
67extern bt_uuid bt_trace_get_uuid(struct bt_trace *trace);
68
69extern int bt_trace_set_uuid(struct bt_trace *trace, bt_uuid uuid);
70
71extern uint64_t bt_trace_get_environment_entry_count(struct bt_trace *trace);
72
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);
76
77extern struct bt_value *bt_trace_borrow_environment_entry_value_by_name(
78 struct bt_trace *trace, const char *name);
79
80extern int bt_trace_set_environment_entry_integer(
81 struct bt_trace *trace, const char *name,
82 int64_t value);
83
84extern int bt_trace_set_environment_entry_string(
85 struct bt_trace *trace, const char *name,
86 const char *value);
87
5cd6d0e5 88extern struct bt_field_class *bt_trace_borrow_packet_header_field_class(
56e18c4c
PP
89 struct bt_trace *trace);
90
5cd6d0e5
PP
91extern int bt_trace_set_packet_header_field_class(struct bt_trace *trace,
92 struct bt_field_class *packet_header_field_class);
56e18c4c
PP
93
94extern uint64_t bt_trace_get_stream_class_count(struct bt_trace *trace);
95
96extern struct bt_stream_class *bt_trace_borrow_stream_class_by_index(
97 struct bt_trace *trace, uint64_t index);
98
99extern struct bt_stream_class *bt_trace_borrow_stream_class_by_id(
100 struct bt_trace *trace, uint64_t id);
101
102extern uint64_t bt_trace_get_stream_count(struct bt_trace *trace);
103
104extern struct bt_stream *bt_trace_borrow_stream_by_index(
105 struct bt_trace *trace, uint64_t index);
106
107extern struct bt_stream *bt_trace_borrow_stream_by_id(
108 struct bt_trace *trace, uint64_t id);
109
110extern bt_bool bt_trace_is_static(struct bt_trace *trace);
111
112extern int bt_trace_make_static(struct bt_trace *trace);
113
114extern int bt_trace_add_is_static_listener(
115 struct bt_trace *trace,
116 bt_trace_is_static_listener listener,
117 bt_trace_listener_removed listener_removed, void *data,
118 uint64_t *listener_id);
119
120extern int bt_trace_remove_is_static_listener(
121 struct bt_trace *trace, uint64_t listener_id);
122
123#ifdef __cplusplus
124}
125#endif
126
127#endif /* BABELTRACE_TRACE_IR_TRACE_H */
This page took 0.029174 seconds and 4 git commands to generate.