Commit | Line | Data |
---|---|---|
3fd40f46 PP |
1 | #ifndef BABELTRACE2_TRACE_IR_FIELD_CLASS_H |
2 | #define BABELTRACE2_TRACE_IR_FIELD_CLASS_H | |
939190b3 PP |
3 | |
4 | /* | |
0dcb770f | 5 | * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation |
939190b3 | 6 | * |
939190b3 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. | |
939190b3 PP |
24 | */ |
25 | ||
9df34b44 PP |
26 | #ifndef __BT_IN_BABELTRACE_H |
27 | # error "Please include <babeltrace2/babeltrace.h> instead." | |
28 | #endif | |
29 | ||
fb25b9e3 PP |
30 | #include <stdint.h> |
31 | #include <stddef.h> | |
32 | ||
71c5da58 | 33 | #include <babeltrace2/types.h> |
71c5da58 | 34 | #include <babeltrace2/trace-ir/field-class-const.h> |
78cf9df6 | 35 | |
939190b3 PP |
36 | #ifdef __cplusplus |
37 | extern "C" { | |
38 | #endif | |
39 | ||
9414b439 PP |
40 | extern bt_field_class *bt_field_class_bool_create( |
41 | bt_trace_class *trace_class); | |
42 | ||
6943da6a PP |
43 | extern bt_field_class *bt_field_class_bit_array_create( |
44 | bt_trace_class *trace_class, uint64_t length); | |
45 | ||
60bbfc7c | 46 | extern bt_field_class *bt_field_class_integer_unsigned_create( |
b7396828 | 47 | bt_trace_class *trace_class); |
939190b3 | 48 | |
60bbfc7c | 49 | extern bt_field_class *bt_field_class_integer_signed_create( |
b7396828 | 50 | bt_trace_class *trace_class); |
78cf9df6 PP |
51 | |
52 | extern void bt_field_class_integer_set_field_value_range( | |
8eee8ea2 | 53 | bt_field_class *field_class, uint64_t size); |
78cf9df6 PP |
54 | |
55 | extern void bt_field_class_integer_set_preferred_display_base( | |
8eee8ea2 | 56 | bt_field_class *field_class, |
ee78f405 | 57 | bt_field_class_integer_preferred_display_base base); |
78cf9df6 | 58 | |
b7396828 | 59 | extern bt_field_class *bt_field_class_real_create(bt_trace_class *trace_class); |
78cf9df6 PP |
60 | |
61 | extern void bt_field_class_real_set_is_single_precision( | |
8eee8ea2 | 62 | bt_field_class *field_class, |
78cf9df6 PP |
63 | bt_bool is_single_precision); |
64 | ||
60bbfc7c | 65 | extern bt_field_class *bt_field_class_enumeration_unsigned_create( |
b7396828 | 66 | bt_trace_class *trace_class); |
78cf9df6 | 67 | |
60bbfc7c | 68 | extern bt_field_class *bt_field_class_enumeration_signed_create( |
b7396828 | 69 | bt_trace_class *trace_class); |
78cf9df6 | 70 | |
02b61fe0 PP |
71 | typedef enum bt_field_class_enumeration_add_mapping_status { |
72 | BT_FIELD_CLASS_ENUMERATION_ADD_MAPPING_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
73 | BT_FIELD_CLASS_ENUMERATION_ADD_MAPPING_STATUS_OK = __BT_FUNC_STATUS_OK, | |
74 | } bt_field_class_enumeration_add_mapping_status; | |
fb25b9e3 | 75 | |
02b61fe0 | 76 | extern bt_field_class_enumeration_add_mapping_status |
60bbfc7c | 77 | bt_field_class_enumeration_unsigned_add_mapping( |
8eee8ea2 | 78 | bt_field_class *field_class, const char *label, |
02b61fe0 | 79 | const bt_integer_range_set_unsigned *range_set); |
78cf9df6 | 80 | |
02b61fe0 | 81 | extern bt_field_class_enumeration_add_mapping_status |
60bbfc7c | 82 | bt_field_class_enumeration_signed_add_mapping( |
8eee8ea2 | 83 | bt_field_class *field_class, const char *label, |
02b61fe0 | 84 | const bt_integer_range_set_signed *range_set); |
78cf9df6 | 85 | |
b7396828 PP |
86 | extern bt_field_class *bt_field_class_string_create( |
87 | bt_trace_class *trace_class); | |
78cf9df6 | 88 | |
b7396828 PP |
89 | extern bt_field_class *bt_field_class_structure_create( |
90 | bt_trace_class *trace_class); | |
78cf9df6 | 91 | |
fb25b9e3 PP |
92 | typedef enum bt_field_class_structure_append_member_status { |
93 | BT_FIELD_CLASS_STRUCTURE_APPEND_MEMBER_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
94 | BT_FIELD_CLASS_STRUCTURE_APPEND_MEMBER_STATUS_OK = __BT_FUNC_STATUS_OK, | |
95 | } bt_field_class_structure_append_member_status; | |
96 | ||
97 | extern bt_field_class_structure_append_member_status | |
98 | bt_field_class_structure_append_member( | |
8eee8ea2 PP |
99 | bt_field_class *struct_field_class, |
100 | const char *name, bt_field_class *field_class); | |
78cf9df6 | 101 | |
e24f271a PP |
102 | extern bt_field_class_structure_member * |
103 | bt_field_class_structure_borrow_member_by_index( | |
104 | bt_field_class *field_class, uint64_t index); | |
909d0a89 | 105 | |
e24f271a PP |
106 | extern bt_field_class_structure_member * |
107 | bt_field_class_structure_borrow_member_by_name( | |
909d0a89 PP |
108 | bt_field_class *field_class, const char *name); |
109 | ||
60bbfc7c | 110 | extern bt_field_class *bt_field_class_array_static_create( |
b7396828 | 111 | bt_trace_class *trace_class, |
8eee8ea2 | 112 | bt_field_class *elem_field_class, uint64_t length); |
78cf9df6 | 113 | |
60bbfc7c | 114 | extern bt_field_class *bt_field_class_array_dynamic_create( |
b7396828 | 115 | bt_trace_class *trace_class, |
93d7d5d1 PP |
116 | bt_field_class *elem_field_class, |
117 | bt_field_class *length_field_class); | |
78cf9df6 | 118 | |
909d0a89 PP |
119 | extern bt_field_class *bt_field_class_array_borrow_element_field_class( |
120 | bt_field_class *field_class); | |
121 | ||
247fa9e3 PP |
122 | extern bt_field_class *bt_field_class_option_create( |
123 | bt_trace_class *trace_class, | |
124 | bt_field_class *content_field_class, | |
125 | bt_field_class *selector_field_class); | |
126 | ||
b7396828 | 127 | extern bt_field_class *bt_field_class_variant_create( |
02b61fe0 | 128 | bt_trace_class *trace_class, |
8eee8ea2 | 129 | bt_field_class *selector_field_class); |
78cf9df6 | 130 | |
02b61fe0 PP |
131 | typedef enum bt_field_class_variant_without_selector_append_option_status { |
132 | BT_FIELD_CLASS_VARIANT_WITHOUT_SELECTOR_APPEND_OPTION_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
133 | BT_FIELD_CLASS_VARIANT_WITHOUT_SELECTOR_APPEND_OPTION_STATUS_OK = __BT_FUNC_STATUS_OK, | |
134 | } bt_field_class_variant_without_selector_append_option_status; | |
fb25b9e3 | 135 | |
02b61fe0 PP |
136 | extern bt_field_class_variant_without_selector_append_option_status |
137 | bt_field_class_variant_without_selector_append_option( | |
138 | bt_field_class *var_field_class, const char *name, | |
139 | bt_field_class *field_class); | |
939190b3 | 140 | |
02b61fe0 PP |
141 | typedef enum bt_field_class_variant_with_selector_append_option_status { |
142 | BT_FIELD_CLASS_VARIANT_WITH_SELECTOR_APPEND_OPTION_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
143 | BT_FIELD_CLASS_VARIANT_WITH_SELECTOR_APPEND_OPTION_STATUS_OK = __BT_FUNC_STATUS_OK, | |
144 | } bt_field_class_variant_with_selector_append_option_status; | |
909d0a89 | 145 | |
02b61fe0 | 146 | extern bt_field_class_variant_with_selector_append_option_status |
60bbfc7c | 147 | bt_field_class_variant_with_selector_unsigned_append_option( |
02b61fe0 PP |
148 | bt_field_class *var_field_class, const char *name, |
149 | bt_field_class *field_class, | |
150 | const bt_integer_range_set_unsigned *range_set); | |
e24f271a | 151 | |
02b61fe0 | 152 | extern bt_field_class_variant_with_selector_append_option_status |
60bbfc7c | 153 | bt_field_class_variant_with_selector_signed_append_option( |
02b61fe0 PP |
154 | bt_field_class *var_field_class, const char *name, |
155 | bt_field_class *field_class, | |
156 | const bt_integer_range_set_signed *range_set); | |
909d0a89 | 157 | |
939190b3 PP |
158 | #ifdef __cplusplus |
159 | } | |
160 | #endif | |
161 | ||
3fd40f46 | 162 | #endif /* BABELTRACE2_TRACE_IR_FIELD_CLASS_H */ |