1 #ifndef BABELTRACE_TRACE_IR_FIELD_CLASSES_CONST_H
2 #define BABELTRACE_TRACE_IR_FIELD_CLASSES_CONST_H
5 * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 * Permission is hereby granted, free of charge, to any person obtaining a copy
10 * of this software and associated documentation files (the "Software"), to deal
11 * in the Software without restriction, including without limitation the rights
12 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 * copies of the Software, and to permit persons to whom the Software is
14 * furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 * The Common Trace Format (CTF) Specification is available at
28 * http://www.efficios.com/ctf
32 #include <babeltrace/types.h>
41 struct bt_field_class
;
43 struct bt_field_class_signed_enumeration_mapping_ranges
;
44 struct bt_field_class_unsigned_enumeration_mapping_ranges
;
46 typedef const char * const *bt_field_class_enumeration_mapping_label_array
;
48 enum bt_field_class_type
{
49 BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER
,
50 BT_FIELD_CLASS_TYPE_SIGNED_INTEGER
,
51 BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION
,
52 BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION
,
53 BT_FIELD_CLASS_TYPE_REAL
,
54 BT_FIELD_CLASS_TYPE_STRING
,
55 BT_FIELD_CLASS_TYPE_STRUCTURE
,
56 BT_FIELD_CLASS_TYPE_STATIC_ARRAY
,
57 BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY
,
58 BT_FIELD_CLASS_TYPE_VARIANT
,
61 enum bt_field_class_integer_preferred_display_base
{
62 BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_BINARY
,
63 BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_OCTAL
,
64 BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_DECIMAL
,
65 BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_HEXADECIMAL
,
68 extern enum bt_field_class_type
bt_field_class_get_type(
69 const struct bt_field_class
*field_class
);
71 extern uint64_t bt_field_class_integer_get_field_value_range(
72 const struct bt_field_class
*field_class
);
74 extern enum bt_field_class_integer_preferred_display_base
75 bt_field_class_integer_get_preferred_display_base(
76 const struct bt_field_class
*field_class
);
78 extern bt_bool
bt_field_class_real_is_single_precision(
79 const struct bt_field_class
*field_class
);
81 extern uint64_t bt_field_class_enumeration_get_mapping_count(
82 const struct bt_field_class
*field_class
);
84 extern void bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const(
85 const struct bt_field_class
*field_class
, uint64_t index
,
87 const struct bt_field_class_unsigned_enumeration_mapping_ranges
**ranges
);
89 extern void bt_field_class_signed_enumeration_borrow_mapping_by_index_const(
90 const struct bt_field_class
*field_class
, uint64_t index
,
92 const struct bt_field_class_signed_enumeration_mapping_ranges
**ranges
);
95 bt_field_class_unsigned_enumeration_mapping_ranges_get_range_count(
96 const struct bt_field_class_unsigned_enumeration_mapping_ranges
*ranges
);
99 bt_field_class_signed_enumeration_mapping_ranges_get_range_count(
100 const struct bt_field_class_signed_enumeration_mapping_ranges
*ranges
);
103 bt_field_class_unsigned_enumeration_mapping_ranges_get_range_by_index(
104 const struct bt_field_class_unsigned_enumeration_mapping_ranges
*ranges
,
105 uint64_t index
, uint64_t *lower
, uint64_t *upper
);
108 bt_field_class_signed_enumeration_mapping_ranges_get_range_by_index(
109 const struct bt_field_class_unsigned_enumeration_mapping_ranges
*ranges
,
110 uint64_t index
, int64_t *lower
, int64_t *upper
);
112 extern int bt_field_class_unsigned_enumeration_get_mapping_labels_by_value(
113 const struct bt_field_class
*field_class
, uint64_t value
,
114 bt_field_class_enumeration_mapping_label_array
*label_array
,
117 extern int bt_field_class_signed_enumeration_get_mapping_labels_by_value(
118 const struct bt_field_class
*field_class
, int64_t value
,
119 bt_field_class_enumeration_mapping_label_array
*label_array
,
122 extern uint64_t bt_field_class_structure_get_member_count(
123 const struct bt_field_class
*field_class
);
125 extern void bt_field_class_structure_borrow_member_by_index_const(
126 const struct bt_field_class
*struct_field_class
, uint64_t index
,
127 const char **name
, const struct bt_field_class
**field_class
);
130 const struct bt_field_class
*
131 bt_field_class_structure_borrow_member_field_class_by_name_const(
132 const struct bt_field_class
*field_class
, const char *name
);
134 extern const struct bt_field_class
*
135 bt_field_class_array_borrow_element_field_class_const(
136 const struct bt_field_class
*field_class
);
138 extern uint64_t bt_field_class_static_array_get_length(
139 const struct bt_field_class
*field_class
);
141 extern const struct bt_field_path
*
142 bt_field_class_dynamic_array_borrow_length_field_path_const(
143 const struct bt_field_class
*field_class
);
145 extern const struct bt_field_path
*
146 bt_field_class_variant_borrow_selector_field_path_const(
147 const struct bt_field_class
*field_class
);
149 extern uint64_t bt_field_class_variant_get_option_count(
150 const struct bt_field_class
*field_class
);
152 extern void bt_field_class_variant_borrow_option_by_index_const(
153 const struct bt_field_class
*variant_field_class
, uint64_t index
,
154 const char **name
, const struct bt_field_class
**field_class
);
157 const struct bt_field_class
*
158 bt_field_class_variant_borrow_option_field_class_by_name_const(
159 const struct bt_field_class
*field_class
,
166 #endif /* BABELTRACE_TRACE_IR_FIELD_CLASSES_CONST_H */