Commit | Line | Data |
---|---|---|
c82deff2 PP |
1 | #ifndef BABELTRACE_TRACE_IR_FIELD_CLASSES_H |
2 | #define BABELTRACE_TRACE_IR_FIELD_CLASSES_H | |
3 | ||
4 | /* | |
c82deff2 PP |
5 | * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
6 | * | |
7 | * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com> | |
8 | * | |
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: | |
15 | * | |
16 | * The above copyright notice and this permission notice shall be included in | |
17 | * all copies or substantial portions of the Software. | |
18 | * | |
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 | |
25 | * SOFTWARE. | |
26 | * | |
27 | * The Common Trace Format (CTF) Specification is available at | |
28 | * http://www.efficios.com/ctf | |
29 | */ | |
30 | ||
c82deff2 PP |
31 | /* For bt_bool */ |
32 | #include <babeltrace/types.h> | |
33 | ||
dadf29b9 PP |
34 | /* For enum bt_field_class_integer_preferred_display_base */ |
35 | #include <babeltrace/trace-ir/field-classes-const.h> | |
36 | ||
c82deff2 PP |
37 | #include <stdint.h> |
38 | #include <stddef.h> | |
39 | ||
40 | #ifdef __cplusplus | |
41 | extern "C" { | |
42 | #endif | |
43 | ||
44 | struct bt_field_class; | |
c82deff2 | 45 | |
dadf29b9 PP |
46 | extern struct bt_field_class *bt_field_class_unsigned_integer_create(void); |
47 | ||
48 | extern struct bt_field_class *bt_field_class_signed_integer_create(void); | |
49 | ||
50 | extern void bt_field_class_integer_set_field_value_range( | |
51 | struct bt_field_class *field_class, uint64_t size); | |
52 | ||
53 | extern void bt_field_class_integer_set_preferred_display_base( | |
54 | struct bt_field_class *field_class, | |
55 | enum bt_field_class_integer_preferred_display_base base); | |
56 | ||
57 | extern struct bt_field_class *bt_field_class_real_create(void); | |
58 | ||
59 | extern void bt_field_class_real_set_is_single_precision( | |
60 | struct bt_field_class *field_class, | |
61 | bt_bool is_single_precision); | |
62 | ||
63 | extern struct bt_field_class *bt_field_class_unsigned_enumeration_create(void); | |
64 | ||
65 | extern struct bt_field_class *bt_field_class_signed_enumeration_create(void); | |
66 | ||
67 | extern int bt_field_class_unsigned_enumeration_map_range( | |
68 | struct bt_field_class *field_class, const char *label, | |
69 | uint64_t range_lower, uint64_t range_upper); | |
70 | ||
71 | extern int bt_field_class_signed_enumeration_map_range( | |
72 | struct bt_field_class *field_class, const char *label, | |
73 | int64_t range_lower, int64_t range_upper); | |
74 | ||
75 | extern struct bt_field_class *bt_field_class_string_create(void); | |
76 | ||
77 | extern struct bt_field_class *bt_field_class_structure_create(void); | |
78 | ||
79 | extern int bt_field_class_structure_append_member( | |
80 | struct bt_field_class *struct_field_class, | |
81 | const char *name, struct bt_field_class *field_class); | |
82 | ||
83 | extern struct bt_field_class *bt_field_class_static_array_create( | |
84 | struct bt_field_class *elem_field_class, uint64_t length); | |
85 | ||
86 | extern struct bt_field_class *bt_field_class_dynamic_array_create( | |
87 | struct bt_field_class *elem_field_class); | |
88 | ||
89 | extern int bt_field_class_dynamic_array_set_length_field_class( | |
c82deff2 | 90 | struct bt_field_class *field_class, |
dadf29b9 PP |
91 | struct bt_field_class *length_field_class); |
92 | ||
93 | extern struct bt_field_class *bt_field_class_variant_create(void); | |
94 | ||
95 | extern int bt_field_class_variant_set_selector_field_class( | |
96 | struct bt_field_class *field_class, | |
97 | struct bt_field_class *selector_field_class); | |
98 | ||
99 | extern int bt_field_class_variant_append_option( | |
100 | struct bt_field_class *var_field_class, | |
101 | const char *name, struct bt_field_class *field_class); | |
c82deff2 | 102 | |
c82deff2 PP |
103 | #ifdef __cplusplus |
104 | } | |
105 | #endif | |
106 | ||
107 | #endif /* BABELTRACE_TRACE_IR_FIELD_CLASSES_H */ |