lib: split real FC/field into single and double prec FC/field
[babeltrace.git] / include / babeltrace2 / trace-ir / field-class.h
CommitLineData
924dc299
PP
1#ifndef BABELTRACE2_TRACE_IR_FIELD_CLASS_H
2#define BABELTRACE2_TRACE_IR_FIELD_CLASS_H
5cd6d0e5
PP
3
4/*
bbb7b5f0 5 * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
5cd6d0e5 6 *
5cd6d0e5
PP
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
5cd6d0e5
PP
24 */
25
4fa90f32
PP
26#ifndef __BT_IN_BABELTRACE_H
27# error "Please include <babeltrace2/babeltrace.h> instead."
28#endif
29
d24d5663
PP
30#include <stdint.h>
31#include <stddef.h>
32
3fadfbc0 33#include <babeltrace2/types.h>
3fadfbc0 34#include <babeltrace2/trace-ir/field-class-const.h>
40f4ba76 35
5cd6d0e5
PP
36#ifdef __cplusplus
37extern "C" {
38#endif
39
c6962c96
PP
40extern void bt_field_class_set_user_attributes(
41 bt_field_class *field_class, const bt_value *user_attributes);
42
43extern bt_value *bt_field_class_borrow_user_attributes(
44 bt_field_class *field_class);
45
5cebbe7f
PP
46extern bt_field_class *bt_field_class_bool_create(
47 bt_trace_class *trace_class);
48
1094efa4
PP
49extern bt_field_class *bt_field_class_bit_array_create(
50 bt_trace_class *trace_class, uint64_t length);
51
9c08c816 52extern bt_field_class *bt_field_class_integer_unsigned_create(
1122a43a 53 bt_trace_class *trace_class);
5cd6d0e5 54
9c08c816 55extern bt_field_class *bt_field_class_integer_signed_create(
1122a43a 56 bt_trace_class *trace_class);
40f4ba76
PP
57
58extern void bt_field_class_integer_set_field_value_range(
b19ff26f 59 bt_field_class *field_class, uint64_t size);
40f4ba76
PP
60
61extern void bt_field_class_integer_set_preferred_display_base(
b19ff26f 62 bt_field_class *field_class,
4cdfc5e8 63 bt_field_class_integer_preferred_display_base base);
40f4ba76 64
fe4df857
FD
65extern bt_field_class *bt_field_class_real_single_precision_create(
66 bt_trace_class *trace_class);
40f4ba76 67
fe4df857
FD
68extern bt_field_class *bt_field_class_real_double_precision_create(
69 bt_trace_class *trace_class);
40f4ba76 70
9c08c816 71extern bt_field_class *bt_field_class_enumeration_unsigned_create(
1122a43a 72 bt_trace_class *trace_class);
40f4ba76 73
9c08c816 74extern bt_field_class *bt_field_class_enumeration_signed_create(
1122a43a 75 bt_trace_class *trace_class);
40f4ba76 76
45c51519
PP
77typedef enum bt_field_class_enumeration_add_mapping_status {
78 BT_FIELD_CLASS_ENUMERATION_ADD_MAPPING_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
79 BT_FIELD_CLASS_ENUMERATION_ADD_MAPPING_STATUS_OK = __BT_FUNC_STATUS_OK,
80} bt_field_class_enumeration_add_mapping_status;
d24d5663 81
45c51519 82extern bt_field_class_enumeration_add_mapping_status
9c08c816 83bt_field_class_enumeration_unsigned_add_mapping(
b19ff26f 84 bt_field_class *field_class, const char *label,
45c51519 85 const bt_integer_range_set_unsigned *range_set);
40f4ba76 86
45c51519 87extern bt_field_class_enumeration_add_mapping_status
9c08c816 88bt_field_class_enumeration_signed_add_mapping(
b19ff26f 89 bt_field_class *field_class, const char *label,
45c51519 90 const bt_integer_range_set_signed *range_set);
40f4ba76 91
1122a43a
PP
92extern bt_field_class *bt_field_class_string_create(
93 bt_trace_class *trace_class);
40f4ba76 94
1122a43a
PP
95extern bt_field_class *bt_field_class_structure_create(
96 bt_trace_class *trace_class);
40f4ba76 97
d24d5663
PP
98typedef enum bt_field_class_structure_append_member_status {
99 BT_FIELD_CLASS_STRUCTURE_APPEND_MEMBER_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
100 BT_FIELD_CLASS_STRUCTURE_APPEND_MEMBER_STATUS_OK = __BT_FUNC_STATUS_OK,
101} bt_field_class_structure_append_member_status;
102
103extern bt_field_class_structure_append_member_status
104bt_field_class_structure_append_member(
b19ff26f
PP
105 bt_field_class *struct_field_class,
106 const char *name, bt_field_class *field_class);
40f4ba76 107
1e6fd1d7
PP
108extern bt_field_class_structure_member *
109bt_field_class_structure_borrow_member_by_index(
110 bt_field_class *field_class, uint64_t index);
740faaf4 111
1e6fd1d7
PP
112extern bt_field_class_structure_member *
113bt_field_class_structure_borrow_member_by_name(
740faaf4
PP
114 bt_field_class *field_class, const char *name);
115
bcd7ef6f
FD
116extern bt_field_class *
117bt_field_class_structure_member_borrow_field_class(
118 bt_field_class_structure_member *member);
119
c6962c96
PP
120extern bt_value *bt_field_class_structure_member_borrow_user_attributes(
121 bt_field_class_structure_member *member);
122
123extern void bt_field_class_structure_member_set_user_attributes(
124 bt_field_class_structure_member *member,
125 const bt_value *user_attributes);
126
9c08c816 127extern bt_field_class *bt_field_class_array_static_create(
1122a43a 128 bt_trace_class *trace_class,
b19ff26f 129 bt_field_class *elem_field_class, uint64_t length);
40f4ba76 130
9c08c816 131extern bt_field_class *bt_field_class_array_dynamic_create(
1122a43a 132 bt_trace_class *trace_class,
1367bc7c
PP
133 bt_field_class *elem_field_class,
134 bt_field_class *length_field_class);
40f4ba76 135
740faaf4
PP
136extern bt_field_class *bt_field_class_array_borrow_element_field_class(
137 bt_field_class *field_class);
138
b38aea74
PP
139extern bt_field_class *bt_field_class_option_create(
140 bt_trace_class *trace_class,
141 bt_field_class *content_field_class,
142 bt_field_class *selector_field_class);
143
bcd7ef6f
FD
144extern bt_field_class *bt_field_class_option_borrow_field_class(
145 bt_field_class *field_class);
146
1122a43a 147extern bt_field_class *bt_field_class_variant_create(
45c51519 148 bt_trace_class *trace_class,
b19ff26f 149 bt_field_class *selector_field_class);
40f4ba76 150
45c51519
PP
151typedef enum bt_field_class_variant_without_selector_append_option_status {
152 BT_FIELD_CLASS_VARIANT_WITHOUT_SELECTOR_APPEND_OPTION_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
153 BT_FIELD_CLASS_VARIANT_WITHOUT_SELECTOR_APPEND_OPTION_STATUS_OK = __BT_FUNC_STATUS_OK,
154} bt_field_class_variant_without_selector_append_option_status;
d24d5663 155
45c51519
PP
156extern bt_field_class_variant_without_selector_append_option_status
157bt_field_class_variant_without_selector_append_option(
158 bt_field_class *var_field_class, const char *name,
159 bt_field_class *field_class);
5cd6d0e5 160
45c51519
PP
161typedef enum bt_field_class_variant_with_selector_append_option_status {
162 BT_FIELD_CLASS_VARIANT_WITH_SELECTOR_APPEND_OPTION_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
163 BT_FIELD_CLASS_VARIANT_WITH_SELECTOR_APPEND_OPTION_STATUS_OK = __BT_FUNC_STATUS_OK,
164} bt_field_class_variant_with_selector_append_option_status;
740faaf4 165
45c51519 166extern bt_field_class_variant_with_selector_append_option_status
9c08c816 167bt_field_class_variant_with_selector_unsigned_append_option(
45c51519
PP
168 bt_field_class *var_field_class, const char *name,
169 bt_field_class *field_class,
170 const bt_integer_range_set_unsigned *range_set);
1e6fd1d7 171
45c51519 172extern bt_field_class_variant_with_selector_append_option_status
9c08c816 173bt_field_class_variant_with_selector_signed_append_option(
45c51519
PP
174 bt_field_class *var_field_class, const char *name,
175 bt_field_class *field_class,
176 const bt_integer_range_set_signed *range_set);
740faaf4 177
c6fe8c40
PP
178extern bt_field_class_variant_option *
179bt_field_class_variant_borrow_option_by_index(
180 bt_field_class *field_class, uint64_t index);
181
182extern bt_field_class_variant_option *
183bt_field_class_variant_borrow_option_by_name(
184 bt_field_class *field_class, const char *name);
185
bcd7ef6f
FD
186extern bt_field_class *bt_field_class_variant_option_borrow_field_class(
187 bt_field_class_variant_option *option);
188
c6962c96
PP
189extern bt_value *bt_field_class_variant_option_borrow_user_attributes(
190 bt_field_class_variant_option *option);
191
192extern void bt_field_class_variant_option_set_user_attributes(
193 bt_field_class_variant_option *option,
194 const bt_value *user_attributes);
195
5cd6d0e5
PP
196#ifdef __cplusplus
197}
198#endif
199
924dc299 200#endif /* BABELTRACE2_TRACE_IR_FIELD_CLASS_H */
This page took 0.048057 seconds and 4 git commands to generate.