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 | /* | |
f2b0325d | 5 | * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com> |
939190b3 PP |
6 | * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
7 | * | |
939190b3 PP |
8 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
9 | * of this software and associated documentation files (the "Software"), to deal | |
10 | * in the Software without restriction, including without limitation the rights | |
11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
12 | * copies of the Software, and to permit persons to whom the Software is | |
13 | * furnished to do so, subject to the following conditions: | |
14 | * | |
15 | * The above copyright notice and this permission notice shall be included in | |
16 | * all copies or substantial portions of the Software. | |
17 | * | |
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
24 | * SOFTWARE. | |
25 | * | |
26 | * The Common Trace Format (CTF) Specification is available at | |
27 | * http://www.efficios.com/ctf | |
28 | */ | |
29 | ||
fb25b9e3 PP |
30 | #include <stdint.h> |
31 | #include <stddef.h> | |
32 | ||
b7396828 | 33 | /* For bt_bool, bt_field_class, bt_trace_class */ |
71c5da58 | 34 | #include <babeltrace2/types.h> |
939190b3 | 35 | |
fb25b9e3 | 36 | /* For bt_field_class_integer_preferred_display_base */ |
71c5da58 | 37 | #include <babeltrace2/trace-ir/field-class-const.h> |
78cf9df6 | 38 | |
fb25b9e3 PP |
39 | /* For __BT_FUNC_STATUS_* */ |
40 | #define __BT_FUNC_STATUS_ENABLE | |
41 | #include <babeltrace2/func-status.h> | |
42 | #undef __BT_FUNC_STATUS_ENABLE | |
939190b3 PP |
43 | |
44 | #ifdef __cplusplus | |
45 | extern "C" { | |
46 | #endif | |
47 | ||
b7396828 PP |
48 | extern bt_field_class *bt_field_class_unsigned_integer_create( |
49 | bt_trace_class *trace_class); | |
939190b3 | 50 | |
b7396828 PP |
51 | extern bt_field_class *bt_field_class_signed_integer_create( |
52 | bt_trace_class *trace_class); | |
78cf9df6 PP |
53 | |
54 | extern void bt_field_class_integer_set_field_value_range( | |
8eee8ea2 | 55 | bt_field_class *field_class, uint64_t size); |
78cf9df6 PP |
56 | |
57 | extern void bt_field_class_integer_set_preferred_display_base( | |
8eee8ea2 | 58 | bt_field_class *field_class, |
ee78f405 | 59 | bt_field_class_integer_preferred_display_base base); |
78cf9df6 | 60 | |
b7396828 | 61 | extern bt_field_class *bt_field_class_real_create(bt_trace_class *trace_class); |
78cf9df6 PP |
62 | |
63 | extern void bt_field_class_real_set_is_single_precision( | |
8eee8ea2 | 64 | bt_field_class *field_class, |
78cf9df6 PP |
65 | bt_bool is_single_precision); |
66 | ||
b7396828 PP |
67 | extern bt_field_class *bt_field_class_unsigned_enumeration_create( |
68 | bt_trace_class *trace_class); | |
78cf9df6 | 69 | |
b7396828 PP |
70 | extern bt_field_class *bt_field_class_signed_enumeration_create( |
71 | bt_trace_class *trace_class); | |
78cf9df6 | 72 | |
fb25b9e3 PP |
73 | typedef enum bt_field_class_enumeration_map_range_status { |
74 | BT_FIELD_CLASS_ENUMERATION_MAP_RANGE_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
75 | BT_FIELD_CLASS_ENUMERATION_MAP_RANGE_STATUS_OK = __BT_FUNC_STATUS_OK, | |
76 | } bt_field_class_enumeration_map_range_status; | |
77 | ||
78 | extern bt_field_class_enumeration_map_range_status | |
79 | bt_field_class_unsigned_enumeration_map_range( | |
8eee8ea2 | 80 | bt_field_class *field_class, const char *label, |
78cf9df6 PP |
81 | uint64_t range_lower, uint64_t range_upper); |
82 | ||
fb25b9e3 PP |
83 | extern bt_field_class_enumeration_map_range_status |
84 | bt_field_class_signed_enumeration_map_range( | |
8eee8ea2 | 85 | bt_field_class *field_class, const char *label, |
78cf9df6 PP |
86 | int64_t range_lower, int64_t range_upper); |
87 | ||
b7396828 PP |
88 | extern bt_field_class *bt_field_class_string_create( |
89 | bt_trace_class *trace_class); | |
78cf9df6 | 90 | |
b7396828 PP |
91 | extern bt_field_class *bt_field_class_structure_create( |
92 | bt_trace_class *trace_class); | |
78cf9df6 | 93 | |
fb25b9e3 PP |
94 | typedef enum bt_field_class_structure_append_member_status { |
95 | BT_FIELD_CLASS_STRUCTURE_APPEND_MEMBER_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
96 | BT_FIELD_CLASS_STRUCTURE_APPEND_MEMBER_STATUS_OK = __BT_FUNC_STATUS_OK, | |
97 | } bt_field_class_structure_append_member_status; | |
98 | ||
99 | extern bt_field_class_structure_append_member_status | |
100 | bt_field_class_structure_append_member( | |
8eee8ea2 PP |
101 | bt_field_class *struct_field_class, |
102 | const char *name, bt_field_class *field_class); | |
78cf9df6 | 103 | |
e24f271a PP |
104 | extern bt_field_class_structure_member * |
105 | bt_field_class_structure_borrow_member_by_index( | |
106 | bt_field_class *field_class, uint64_t index); | |
909d0a89 | 107 | |
e24f271a PP |
108 | extern bt_field_class_structure_member * |
109 | bt_field_class_structure_borrow_member_by_name( | |
909d0a89 PP |
110 | bt_field_class *field_class, const char *name); |
111 | ||
8eee8ea2 | 112 | extern bt_field_class *bt_field_class_static_array_create( |
b7396828 | 113 | bt_trace_class *trace_class, |
8eee8ea2 | 114 | bt_field_class *elem_field_class, uint64_t length); |
78cf9df6 | 115 | |
8eee8ea2 | 116 | extern bt_field_class *bt_field_class_dynamic_array_create( |
b7396828 | 117 | bt_trace_class *trace_class, |
8eee8ea2 | 118 | bt_field_class *elem_field_class); |
78cf9df6 | 119 | |
909d0a89 PP |
120 | extern bt_field_class *bt_field_class_array_borrow_element_field_class( |
121 | bt_field_class *field_class); | |
122 | ||
fb25b9e3 PP |
123 | typedef enum bt_field_class_dynamic_array_set_length_field_class_status { |
124 | BT_FIELD_CLASS_DYNAMIC_ARRAY_SET_LENGTH_FIELD_CLASS_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
125 | BT_FIELD_CLASS_DYNAMIC_ARRAY_SET_LENGTH_FIELD_CLASS_STATUS_OK = __BT_FUNC_STATUS_OK, | |
126 | } bt_field_class_dynamic_array_set_length_field_class_status; | |
127 | ||
128 | extern bt_field_class_dynamic_array_set_length_field_class_status | |
4b514ab3 | 129 | bt_field_class_dynamic_array_set_length_field_class( |
8eee8ea2 PP |
130 | bt_field_class *field_class, |
131 | bt_field_class *length_field_class); | |
78cf9df6 | 132 | |
b7396828 PP |
133 | extern bt_field_class *bt_field_class_variant_create( |
134 | bt_trace_class *trace_class); | |
78cf9df6 | 135 | |
fb25b9e3 PP |
136 | typedef enum bt_field_class_variant_set_selector_field_class_status { |
137 | BT_FIELD_CLASS_VARIANT_SET_SELECTOR_FIELD_CLASS_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
138 | BT_FIELD_CLASS_VARIANT_SET_SELECTOR_FIELD_CLASS_STATUS_OK = __BT_FUNC_STATUS_OK, | |
139 | } bt_field_class_variant_set_selector_field_class_status; | |
140 | ||
141 | extern bt_field_class_variant_set_selector_field_class_status | |
4b514ab3 | 142 | bt_field_class_variant_set_selector_field_class(bt_field_class *field_class, |
8eee8ea2 | 143 | bt_field_class *selector_field_class); |
78cf9df6 | 144 | |
fb25b9e3 PP |
145 | typedef enum bt_field_class_variant_append_option_status { |
146 | BT_FIELD_CLASS_VARIANT_APPEND_OPTION_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
147 | BT_FIELD_CLASS_VARIANT_APPEND_OPTION_STATUS_OK = __BT_FUNC_STATUS_OK, | |
148 | } bt_field_class_variant_append_option_status; | |
149 | ||
150 | extern bt_field_class_variant_append_option_status | |
151 | bt_field_class_variant_append_option( | |
8eee8ea2 PP |
152 | bt_field_class *var_field_class, |
153 | const char *name, bt_field_class *field_class); | |
939190b3 | 154 | |
e24f271a PP |
155 | extern bt_field_class_variant_option * |
156 | bt_field_class_variant_borrow_option_by_index( | |
157 | bt_field_class *field_class, uint64_t index); | |
909d0a89 | 158 | |
e24f271a PP |
159 | extern bt_field_class_variant_option * |
160 | bt_field_class_variant_borrow_option_by_name( | |
c0db9072 | 161 | bt_field_class *field_class, const char *name); |
e24f271a PP |
162 | |
163 | extern bt_field_class *bt_field_class_variant_option_borrow_field_class( | |
164 | bt_field_class_variant_option *option); | |
909d0a89 | 165 | |
939190b3 PP |
166 | #ifdef __cplusplus |
167 | } | |
168 | #endif | |
169 | ||
fb25b9e3 PP |
170 | #include <babeltrace2/undef-func-status.h> |
171 | ||
3fd40f46 | 172 | #endif /* BABELTRACE2_TRACE_IR_FIELD_CLASS_H */ |