Commit | Line | Data |
---|---|---|
c82deff2 PP |
1 | #ifndef BABELTRACE_TRACE_IR_FIELD_CLASSES_H |
2 | #define BABELTRACE_TRACE_IR_FIELD_CLASSES_H | |
3 | ||
4 | /* | |
0554db57 | 5 | * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com> |
c82deff2 PP |
6 | * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
7 | * | |
c82deff2 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 | ||
b9879703 | 30 | /* For bt_bool, bt_field_class */ |
c82deff2 PP |
31 | #include <babeltrace/types.h> |
32 | ||
dadf29b9 | 33 | /* For enum bt_field_class_integer_preferred_display_base */ |
c319d0ae | 34 | #include <babeltrace/trace-ir/field-class-const.h> |
dadf29b9 | 35 | |
c82deff2 PP |
36 | #include <stdint.h> |
37 | #include <stddef.h> | |
38 | ||
39 | #ifdef __cplusplus | |
40 | extern "C" { | |
41 | #endif | |
42 | ||
b9879703 | 43 | extern bt_field_class *bt_field_class_unsigned_integer_create(void); |
c82deff2 | 44 | |
b9879703 | 45 | extern bt_field_class *bt_field_class_signed_integer_create(void); |
dadf29b9 PP |
46 | |
47 | extern void bt_field_class_integer_set_field_value_range( | |
b9879703 | 48 | bt_field_class *field_class, uint64_t size); |
dadf29b9 PP |
49 | |
50 | extern void bt_field_class_integer_set_preferred_display_base( | |
b9879703 | 51 | bt_field_class *field_class, |
dadf29b9 PP |
52 | enum bt_field_class_integer_preferred_display_base base); |
53 | ||
b9879703 | 54 | extern bt_field_class *bt_field_class_real_create(void); |
dadf29b9 PP |
55 | |
56 | extern void bt_field_class_real_set_is_single_precision( | |
b9879703 | 57 | bt_field_class *field_class, |
dadf29b9 PP |
58 | bt_bool is_single_precision); |
59 | ||
b9879703 | 60 | extern bt_field_class *bt_field_class_unsigned_enumeration_create(void); |
dadf29b9 | 61 | |
b9879703 | 62 | extern bt_field_class *bt_field_class_signed_enumeration_create(void); |
dadf29b9 PP |
63 | |
64 | extern int bt_field_class_unsigned_enumeration_map_range( | |
b9879703 | 65 | bt_field_class *field_class, const char *label, |
dadf29b9 PP |
66 | uint64_t range_lower, uint64_t range_upper); |
67 | ||
68 | extern int bt_field_class_signed_enumeration_map_range( | |
b9879703 | 69 | bt_field_class *field_class, const char *label, |
dadf29b9 PP |
70 | int64_t range_lower, int64_t range_upper); |
71 | ||
b9879703 | 72 | extern bt_field_class *bt_field_class_string_create(void); |
dadf29b9 | 73 | |
b9879703 | 74 | extern bt_field_class *bt_field_class_structure_create(void); |
dadf29b9 PP |
75 | |
76 | extern int bt_field_class_structure_append_member( | |
b9879703 PP |
77 | bt_field_class *struct_field_class, |
78 | const char *name, bt_field_class *field_class); | |
dadf29b9 | 79 | |
b9879703 PP |
80 | extern bt_field_class *bt_field_class_static_array_create( |
81 | bt_field_class *elem_field_class, uint64_t length); | |
dadf29b9 | 82 | |
b9879703 PP |
83 | extern bt_field_class *bt_field_class_dynamic_array_create( |
84 | bt_field_class *elem_field_class); | |
dadf29b9 PP |
85 | |
86 | extern int bt_field_class_dynamic_array_set_length_field_class( | |
b9879703 PP |
87 | bt_field_class *field_class, |
88 | bt_field_class *length_field_class); | |
dadf29b9 | 89 | |
b9879703 | 90 | extern bt_field_class *bt_field_class_variant_create(void); |
dadf29b9 PP |
91 | |
92 | extern int bt_field_class_variant_set_selector_field_class( | |
b9879703 PP |
93 | bt_field_class *field_class, |
94 | bt_field_class *selector_field_class); | |
dadf29b9 PP |
95 | |
96 | extern int bt_field_class_variant_append_option( | |
b9879703 PP |
97 | bt_field_class *var_field_class, |
98 | const char *name, bt_field_class *field_class); | |
c82deff2 | 99 | |
c82deff2 PP |
100 | #ifdef __cplusplus |
101 | } | |
102 | #endif | |
103 | ||
104 | #endif /* BABELTRACE_TRACE_IR_FIELD_CLASSES_H */ |