lib: update copyrights
[babeltrace.git] / include / babeltrace / trace-ir / field-class-const.h
CommitLineData
40f4ba76
PP
1#ifndef BABELTRACE_TRACE_IR_FIELD_CLASSES_CONST_H
2#define BABELTRACE_TRACE_IR_FIELD_CLASSES_CONST_H
3
4/*
e2f7325d 5 * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
40f4ba76
PP
6 * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 *
40f4ba76
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
37extern "C" {
38#endif
39
40struct bt_field_class;
41struct bt_field_path;
42struct bt_field_class_signed_enumeration_mapping_ranges;
43struct bt_field_class_unsigned_enumeration_mapping_ranges;
44
45typedef const char * const *bt_field_class_enumeration_mapping_label_array;
46
47enum 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
60enum 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
67extern enum bt_field_class_type bt_field_class_get_type(
68 const struct bt_field_class *field_class);
69
70extern uint64_t bt_field_class_integer_get_field_value_range(
71 const struct bt_field_class *field_class);
72
73extern enum bt_field_class_integer_preferred_display_base
74bt_field_class_integer_get_preferred_display_base(
75 const struct bt_field_class *field_class);
76
77extern bt_bool bt_field_class_real_is_single_precision(
78 const struct bt_field_class *field_class);
79
80extern uint64_t bt_field_class_enumeration_get_mapping_count(
81 const struct bt_field_class *field_class);
82
83extern 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
88extern 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
93extern uint64_t
94bt_field_class_unsigned_enumeration_mapping_ranges_get_range_count(
95 const struct bt_field_class_unsigned_enumeration_mapping_ranges *ranges);
96
97extern uint64_t
98bt_field_class_signed_enumeration_mapping_ranges_get_range_count(
99 const struct bt_field_class_signed_enumeration_mapping_ranges *ranges);
100
101extern void
102bt_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
106extern void
107bt_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
111extern 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
116extern 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
121extern uint64_t bt_field_class_structure_get_member_count(
122 const struct bt_field_class *field_class);
123
124extern 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
128extern
129const struct bt_field_class *
130bt_field_class_structure_borrow_member_field_class_by_name_const(
131 const struct bt_field_class *field_class, const char *name);
132
133extern const struct bt_field_class *
134bt_field_class_array_borrow_element_field_class_const(
135 const struct bt_field_class *field_class);
136
137extern uint64_t bt_field_class_static_array_get_length(
138 const struct bt_field_class *field_class);
139
140extern const struct bt_field_path *
141bt_field_class_dynamic_array_borrow_length_field_path_const(
142 const struct bt_field_class *field_class);
143
144extern const struct bt_field_path *
145bt_field_class_variant_borrow_selector_field_path_const(
146 const struct bt_field_class *field_class);
147
148extern uint64_t bt_field_class_variant_get_option_count(
149 const struct bt_field_class *field_class);
150
151extern 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
155extern
156const struct bt_field_class *
157bt_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 */
This page took 0.028718 seconds and 4 git commands to generate.