lib: standardize public header copyright notice
[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
1122a43a
PP
40extern bt_field_class *bt_field_class_unsigned_integer_create(
41 bt_trace_class *trace_class);
5cd6d0e5 42
1122a43a
PP
43extern bt_field_class *bt_field_class_signed_integer_create(
44 bt_trace_class *trace_class);
40f4ba76
PP
45
46extern void bt_field_class_integer_set_field_value_range(
b19ff26f 47 bt_field_class *field_class, uint64_t size);
40f4ba76
PP
48
49extern void bt_field_class_integer_set_preferred_display_base(
b19ff26f 50 bt_field_class *field_class,
4cdfc5e8 51 bt_field_class_integer_preferred_display_base base);
40f4ba76 52
1122a43a 53extern bt_field_class *bt_field_class_real_create(bt_trace_class *trace_class);
40f4ba76
PP
54
55extern void bt_field_class_real_set_is_single_precision(
b19ff26f 56 bt_field_class *field_class,
40f4ba76
PP
57 bt_bool is_single_precision);
58
1122a43a
PP
59extern bt_field_class *bt_field_class_unsigned_enumeration_create(
60 bt_trace_class *trace_class);
40f4ba76 61
1122a43a
PP
62extern bt_field_class *bt_field_class_signed_enumeration_create(
63 bt_trace_class *trace_class);
40f4ba76 64
d24d5663
PP
65typedef enum bt_field_class_enumeration_map_range_status {
66 BT_FIELD_CLASS_ENUMERATION_MAP_RANGE_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
67 BT_FIELD_CLASS_ENUMERATION_MAP_RANGE_STATUS_OK = __BT_FUNC_STATUS_OK,
68} bt_field_class_enumeration_map_range_status;
69
70extern bt_field_class_enumeration_map_range_status
71bt_field_class_unsigned_enumeration_map_range(
b19ff26f 72 bt_field_class *field_class, const char *label,
40f4ba76
PP
73 uint64_t range_lower, uint64_t range_upper);
74
d24d5663
PP
75extern bt_field_class_enumeration_map_range_status
76bt_field_class_signed_enumeration_map_range(
b19ff26f 77 bt_field_class *field_class, const char *label,
40f4ba76
PP
78 int64_t range_lower, int64_t range_upper);
79
1122a43a
PP
80extern bt_field_class *bt_field_class_string_create(
81 bt_trace_class *trace_class);
40f4ba76 82
1122a43a
PP
83extern bt_field_class *bt_field_class_structure_create(
84 bt_trace_class *trace_class);
40f4ba76 85
d24d5663
PP
86typedef enum bt_field_class_structure_append_member_status {
87 BT_FIELD_CLASS_STRUCTURE_APPEND_MEMBER_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
88 BT_FIELD_CLASS_STRUCTURE_APPEND_MEMBER_STATUS_OK = __BT_FUNC_STATUS_OK,
89} bt_field_class_structure_append_member_status;
90
91extern bt_field_class_structure_append_member_status
92bt_field_class_structure_append_member(
b19ff26f
PP
93 bt_field_class *struct_field_class,
94 const char *name, bt_field_class *field_class);
40f4ba76 95
1e6fd1d7
PP
96extern bt_field_class_structure_member *
97bt_field_class_structure_borrow_member_by_index(
98 bt_field_class *field_class, uint64_t index);
740faaf4 99
1e6fd1d7
PP
100extern bt_field_class_structure_member *
101bt_field_class_structure_borrow_member_by_name(
740faaf4
PP
102 bt_field_class *field_class, const char *name);
103
b19ff26f 104extern bt_field_class *bt_field_class_static_array_create(
1122a43a 105 bt_trace_class *trace_class,
b19ff26f 106 bt_field_class *elem_field_class, uint64_t length);
40f4ba76 107
b19ff26f 108extern bt_field_class *bt_field_class_dynamic_array_create(
1122a43a 109 bt_trace_class *trace_class,
b19ff26f 110 bt_field_class *elem_field_class);
40f4ba76 111
740faaf4
PP
112extern bt_field_class *bt_field_class_array_borrow_element_field_class(
113 bt_field_class *field_class);
114
d24d5663
PP
115typedef enum bt_field_class_dynamic_array_set_length_field_class_status {
116 BT_FIELD_CLASS_DYNAMIC_ARRAY_SET_LENGTH_FIELD_CLASS_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
117 BT_FIELD_CLASS_DYNAMIC_ARRAY_SET_LENGTH_FIELD_CLASS_STATUS_OK = __BT_FUNC_STATUS_OK,
118} bt_field_class_dynamic_array_set_length_field_class_status;
119
120extern bt_field_class_dynamic_array_set_length_field_class_status
4295b9e0 121bt_field_class_dynamic_array_set_length_field_class(
b19ff26f
PP
122 bt_field_class *field_class,
123 bt_field_class *length_field_class);
40f4ba76 124
1122a43a
PP
125extern bt_field_class *bt_field_class_variant_create(
126 bt_trace_class *trace_class);
40f4ba76 127
d24d5663
PP
128typedef enum bt_field_class_variant_set_selector_field_class_status {
129 BT_FIELD_CLASS_VARIANT_SET_SELECTOR_FIELD_CLASS_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
130 BT_FIELD_CLASS_VARIANT_SET_SELECTOR_FIELD_CLASS_STATUS_OK = __BT_FUNC_STATUS_OK,
131} bt_field_class_variant_set_selector_field_class_status;
132
133extern bt_field_class_variant_set_selector_field_class_status
4295b9e0 134bt_field_class_variant_set_selector_field_class(bt_field_class *field_class,
b19ff26f 135 bt_field_class *selector_field_class);
40f4ba76 136
d24d5663
PP
137typedef enum bt_field_class_variant_append_option_status {
138 BT_FIELD_CLASS_VARIANT_APPEND_OPTION_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
139 BT_FIELD_CLASS_VARIANT_APPEND_OPTION_STATUS_OK = __BT_FUNC_STATUS_OK,
140} bt_field_class_variant_append_option_status;
141
142extern bt_field_class_variant_append_option_status
143bt_field_class_variant_append_option(
b19ff26f
PP
144 bt_field_class *var_field_class,
145 const char *name, bt_field_class *field_class);
5cd6d0e5 146
1e6fd1d7
PP
147extern bt_field_class_variant_option *
148bt_field_class_variant_borrow_option_by_index(
149 bt_field_class *field_class, uint64_t index);
740faaf4 150
1e6fd1d7
PP
151extern bt_field_class_variant_option *
152bt_field_class_variant_borrow_option_by_name(
7c06e353 153 bt_field_class *field_class, const char *name);
1e6fd1d7
PP
154
155extern bt_field_class *bt_field_class_variant_option_borrow_field_class(
156 bt_field_class_variant_option *option);
740faaf4 157
5cd6d0e5
PP
158#ifdef __cplusplus
159}
160#endif
161
924dc299 162#endif /* BABELTRACE2_TRACE_IR_FIELD_CLASS_H */
This page took 0.039733 seconds and 4 git commands to generate.