Commit | Line | Data |
---|---|---|
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 |
37 | extern "C" { | |
38 | #endif | |
39 | ||
5cebbe7f PP |
40 | extern bt_field_class *bt_field_class_bool_create( |
41 | bt_trace_class *trace_class); | |
42 | ||
9c08c816 | 43 | extern bt_field_class *bt_field_class_integer_unsigned_create( |
1122a43a | 44 | bt_trace_class *trace_class); |
5cd6d0e5 | 45 | |
9c08c816 | 46 | extern bt_field_class *bt_field_class_integer_signed_create( |
1122a43a | 47 | bt_trace_class *trace_class); |
40f4ba76 PP |
48 | |
49 | extern void bt_field_class_integer_set_field_value_range( | |
b19ff26f | 50 | bt_field_class *field_class, uint64_t size); |
40f4ba76 PP |
51 | |
52 | extern void bt_field_class_integer_set_preferred_display_base( | |
b19ff26f | 53 | bt_field_class *field_class, |
4cdfc5e8 | 54 | bt_field_class_integer_preferred_display_base base); |
40f4ba76 | 55 | |
1122a43a | 56 | extern bt_field_class *bt_field_class_real_create(bt_trace_class *trace_class); |
40f4ba76 PP |
57 | |
58 | extern void bt_field_class_real_set_is_single_precision( | |
b19ff26f | 59 | bt_field_class *field_class, |
40f4ba76 PP |
60 | bt_bool is_single_precision); |
61 | ||
9c08c816 | 62 | extern bt_field_class *bt_field_class_enumeration_unsigned_create( |
1122a43a | 63 | bt_trace_class *trace_class); |
40f4ba76 | 64 | |
9c08c816 | 65 | extern bt_field_class *bt_field_class_enumeration_signed_create( |
1122a43a | 66 | bt_trace_class *trace_class); |
40f4ba76 | 67 | |
45c51519 PP |
68 | typedef enum bt_field_class_enumeration_add_mapping_status { |
69 | BT_FIELD_CLASS_ENUMERATION_ADD_MAPPING_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
70 | BT_FIELD_CLASS_ENUMERATION_ADD_MAPPING_STATUS_OK = __BT_FUNC_STATUS_OK, | |
71 | } bt_field_class_enumeration_add_mapping_status; | |
d24d5663 | 72 | |
45c51519 | 73 | extern bt_field_class_enumeration_add_mapping_status |
9c08c816 | 74 | bt_field_class_enumeration_unsigned_add_mapping( |
b19ff26f | 75 | bt_field_class *field_class, const char *label, |
45c51519 | 76 | const bt_integer_range_set_unsigned *range_set); |
40f4ba76 | 77 | |
45c51519 | 78 | extern bt_field_class_enumeration_add_mapping_status |
9c08c816 | 79 | bt_field_class_enumeration_signed_add_mapping( |
b19ff26f | 80 | bt_field_class *field_class, const char *label, |
45c51519 | 81 | const bt_integer_range_set_signed *range_set); |
40f4ba76 | 82 | |
1122a43a PP |
83 | extern bt_field_class *bt_field_class_string_create( |
84 | bt_trace_class *trace_class); | |
40f4ba76 | 85 | |
1122a43a PP |
86 | extern bt_field_class *bt_field_class_structure_create( |
87 | bt_trace_class *trace_class); | |
40f4ba76 | 88 | |
d24d5663 PP |
89 | typedef enum bt_field_class_structure_append_member_status { |
90 | BT_FIELD_CLASS_STRUCTURE_APPEND_MEMBER_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
91 | BT_FIELD_CLASS_STRUCTURE_APPEND_MEMBER_STATUS_OK = __BT_FUNC_STATUS_OK, | |
92 | } bt_field_class_structure_append_member_status; | |
93 | ||
94 | extern bt_field_class_structure_append_member_status | |
95 | bt_field_class_structure_append_member( | |
b19ff26f PP |
96 | bt_field_class *struct_field_class, |
97 | const char *name, bt_field_class *field_class); | |
40f4ba76 | 98 | |
1e6fd1d7 PP |
99 | extern bt_field_class_structure_member * |
100 | bt_field_class_structure_borrow_member_by_index( | |
101 | bt_field_class *field_class, uint64_t index); | |
740faaf4 | 102 | |
1e6fd1d7 PP |
103 | extern bt_field_class_structure_member * |
104 | bt_field_class_structure_borrow_member_by_name( | |
740faaf4 PP |
105 | bt_field_class *field_class, const char *name); |
106 | ||
9c08c816 | 107 | extern bt_field_class *bt_field_class_array_static_create( |
1122a43a | 108 | bt_trace_class *trace_class, |
b19ff26f | 109 | bt_field_class *elem_field_class, uint64_t length); |
40f4ba76 | 110 | |
9c08c816 | 111 | extern bt_field_class *bt_field_class_array_dynamic_create( |
1122a43a | 112 | bt_trace_class *trace_class, |
1367bc7c PP |
113 | bt_field_class *elem_field_class, |
114 | bt_field_class *length_field_class); | |
40f4ba76 | 115 | |
740faaf4 PP |
116 | extern bt_field_class *bt_field_class_array_borrow_element_field_class( |
117 | bt_field_class *field_class); | |
118 | ||
b38aea74 PP |
119 | extern bt_field_class *bt_field_class_option_create( |
120 | bt_trace_class *trace_class, | |
121 | bt_field_class *content_field_class, | |
122 | bt_field_class *selector_field_class); | |
123 | ||
1122a43a | 124 | extern bt_field_class *bt_field_class_variant_create( |
45c51519 | 125 | bt_trace_class *trace_class, |
b19ff26f | 126 | bt_field_class *selector_field_class); |
40f4ba76 | 127 | |
45c51519 PP |
128 | typedef enum bt_field_class_variant_without_selector_append_option_status { |
129 | BT_FIELD_CLASS_VARIANT_WITHOUT_SELECTOR_APPEND_OPTION_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
130 | BT_FIELD_CLASS_VARIANT_WITHOUT_SELECTOR_APPEND_OPTION_STATUS_OK = __BT_FUNC_STATUS_OK, | |
131 | } bt_field_class_variant_without_selector_append_option_status; | |
d24d5663 | 132 | |
45c51519 PP |
133 | extern bt_field_class_variant_without_selector_append_option_status |
134 | bt_field_class_variant_without_selector_append_option( | |
135 | bt_field_class *var_field_class, const char *name, | |
136 | bt_field_class *field_class); | |
5cd6d0e5 | 137 | |
45c51519 PP |
138 | typedef enum bt_field_class_variant_with_selector_append_option_status { |
139 | BT_FIELD_CLASS_VARIANT_WITH_SELECTOR_APPEND_OPTION_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
140 | BT_FIELD_CLASS_VARIANT_WITH_SELECTOR_APPEND_OPTION_STATUS_OK = __BT_FUNC_STATUS_OK, | |
141 | } bt_field_class_variant_with_selector_append_option_status; | |
740faaf4 | 142 | |
45c51519 | 143 | extern bt_field_class_variant_with_selector_append_option_status |
9c08c816 | 144 | bt_field_class_variant_with_selector_unsigned_append_option( |
45c51519 PP |
145 | bt_field_class *var_field_class, const char *name, |
146 | bt_field_class *field_class, | |
147 | const bt_integer_range_set_unsigned *range_set); | |
1e6fd1d7 | 148 | |
45c51519 | 149 | extern bt_field_class_variant_with_selector_append_option_status |
9c08c816 | 150 | bt_field_class_variant_with_selector_signed_append_option( |
45c51519 PP |
151 | bt_field_class *var_field_class, const char *name, |
152 | bt_field_class *field_class, | |
153 | const bt_integer_range_set_signed *range_set); | |
740faaf4 | 154 | |
5cd6d0e5 PP |
155 | #ifdef __cplusplus |
156 | } | |
157 | #endif | |
158 | ||
924dc299 | 159 | #endif /* BABELTRACE2_TRACE_IR_FIELD_CLASS_H */ |