Commit | Line | Data |
---|---|---|
78cf9df6 PP |
1 | #ifndef BABELTRACE_TRACE_IR_FIELD_CLASSES_CONST_H |
2 | #define BABELTRACE_TRACE_IR_FIELD_CLASSES_CONST_H | |
3 | ||
4 | /* | |
f2b0325d | 5 | * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com> |
78cf9df6 PP |
6 | * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
7 | * | |
78cf9df6 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 | ||
30 | /* For bt_bool */ | |
31 | #include <babeltrace/types.h> | |
32 | ||
33 | #include <stdint.h> | |
34 | #include <stddef.h> | |
35 | ||
36 | #ifdef __cplusplus | |
37 | extern "C" { | |
38 | #endif | |
39 | ||
40 | struct bt_field_class; | |
41 | struct bt_field_path; | |
42 | struct bt_field_class_signed_enumeration_mapping_ranges; | |
43 | struct bt_field_class_unsigned_enumeration_mapping_ranges; | |
44 | ||
45 | typedef const char * const *bt_field_class_enumeration_mapping_label_array; | |
46 | ||
47 | enum bt_field_class_type { | |
48 | BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER, | |
49 | BT_FIELD_CLASS_TYPE_SIGNED_INTEGER, | |
50 | BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, | |
51 | BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, | |
52 | BT_FIELD_CLASS_TYPE_REAL, | |
53 | BT_FIELD_CLASS_TYPE_STRING, | |
54 | BT_FIELD_CLASS_TYPE_STRUCTURE, | |
55 | BT_FIELD_CLASS_TYPE_STATIC_ARRAY, | |
56 | BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY, | |
57 | BT_FIELD_CLASS_TYPE_VARIANT, | |
58 | }; | |
59 | ||
60 | enum bt_field_class_integer_preferred_display_base { | |
61 | BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_BINARY, | |
62 | BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_OCTAL, | |
63 | BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_DECIMAL, | |
64 | BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_HEXADECIMAL, | |
65 | }; | |
66 | ||
67 | extern enum bt_field_class_type bt_field_class_get_type( | |
68 | const struct bt_field_class *field_class); | |
69 | ||
70 | extern uint64_t bt_field_class_integer_get_field_value_range( | |
71 | const struct bt_field_class *field_class); | |
72 | ||
73 | extern enum bt_field_class_integer_preferred_display_base | |
74 | bt_field_class_integer_get_preferred_display_base( | |
75 | const struct bt_field_class *field_class); | |
76 | ||
77 | extern bt_bool bt_field_class_real_is_single_precision( | |
78 | const struct bt_field_class *field_class); | |
79 | ||
80 | extern uint64_t bt_field_class_enumeration_get_mapping_count( | |
81 | const struct bt_field_class *field_class); | |
82 | ||
83 | extern void bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const( | |
84 | const struct bt_field_class *field_class, uint64_t index, | |
85 | const char **label, | |
86 | const struct bt_field_class_unsigned_enumeration_mapping_ranges **ranges); | |
87 | ||
88 | extern void bt_field_class_signed_enumeration_borrow_mapping_by_index_const( | |
89 | const struct bt_field_class *field_class, uint64_t index, | |
90 | const char **label, | |
91 | const struct bt_field_class_signed_enumeration_mapping_ranges **ranges); | |
92 | ||
93 | extern uint64_t | |
94 | bt_field_class_unsigned_enumeration_mapping_ranges_get_range_count( | |
95 | const struct bt_field_class_unsigned_enumeration_mapping_ranges *ranges); | |
96 | ||
97 | extern uint64_t | |
98 | bt_field_class_signed_enumeration_mapping_ranges_get_range_count( | |
99 | const struct bt_field_class_signed_enumeration_mapping_ranges *ranges); | |
100 | ||
101 | extern void | |
102 | bt_field_class_unsigned_enumeration_mapping_ranges_get_range_by_index( | |
103 | const struct bt_field_class_unsigned_enumeration_mapping_ranges *ranges, | |
104 | uint64_t index, uint64_t *lower, uint64_t *upper); | |
105 | ||
106 | extern void | |
107 | bt_field_class_signed_enumeration_mapping_ranges_get_range_by_index( | |
108 | const struct bt_field_class_unsigned_enumeration_mapping_ranges *ranges, | |
109 | uint64_t index, int64_t *lower, int64_t *upper); | |
110 | ||
111 | extern int bt_field_class_unsigned_enumeration_get_mapping_labels_by_value( | |
112 | const struct bt_field_class *field_class, uint64_t value, | |
113 | bt_field_class_enumeration_mapping_label_array *label_array, | |
114 | uint64_t *count); | |
115 | ||
116 | extern int bt_field_class_signed_enumeration_get_mapping_labels_by_value( | |
117 | const struct bt_field_class *field_class, int64_t value, | |
118 | bt_field_class_enumeration_mapping_label_array *label_array, | |
119 | uint64_t *count); | |
120 | ||
121 | extern uint64_t bt_field_class_structure_get_member_count( | |
122 | const struct bt_field_class *field_class); | |
123 | ||
124 | extern void bt_field_class_structure_borrow_member_by_index_const( | |
125 | const struct bt_field_class *struct_field_class, uint64_t index, | |
126 | const char **name, const struct bt_field_class **field_class); | |
127 | ||
128 | extern | |
129 | const struct bt_field_class * | |
130 | bt_field_class_structure_borrow_member_field_class_by_name_const( | |
131 | const struct bt_field_class *field_class, const char *name); | |
132 | ||
133 | extern const struct bt_field_class * | |
134 | bt_field_class_array_borrow_element_field_class_const( | |
135 | const struct bt_field_class *field_class); | |
136 | ||
137 | extern uint64_t bt_field_class_static_array_get_length( | |
138 | const struct bt_field_class *field_class); | |
139 | ||
140 | extern const struct bt_field_path * | |
141 | bt_field_class_dynamic_array_borrow_length_field_path_const( | |
142 | const struct bt_field_class *field_class); | |
143 | ||
144 | extern const struct bt_field_path * | |
145 | bt_field_class_variant_borrow_selector_field_path_const( | |
146 | const struct bt_field_class *field_class); | |
147 | ||
148 | extern uint64_t bt_field_class_variant_get_option_count( | |
149 | const struct bt_field_class *field_class); | |
150 | ||
151 | extern void bt_field_class_variant_borrow_option_by_index_const( | |
152 | const struct bt_field_class *variant_field_class, uint64_t index, | |
153 | const char **name, const struct bt_field_class **field_class); | |
154 | ||
155 | extern | |
156 | const struct bt_field_class * | |
157 | bt_field_class_variant_borrow_option_field_class_by_name_const( | |
158 | const struct bt_field_class *field_class, | |
159 | const char *name); | |
160 | ||
161 | #ifdef __cplusplus | |
162 | } | |
163 | #endif | |
164 | ||
165 | #endif /* BABELTRACE_TRACE_IR_FIELD_CLASSES_CONST_H */ |