bt_field_class_*_create(): accept mandatory trace class
[babeltrace.git] / include / babeltrace / trace-ir / field-class.h
1 #ifndef BABELTRACE_TRACE_IR_FIELD_CLASSES_H
2 #define BABELTRACE_TRACE_IR_FIELD_CLASSES_H
3
4 /*
5 * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
6 * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 *
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, bt_field_class, bt_trace_class */
31 #include <babeltrace/types.h>
32
33 /*
34 * For bt_field_class_status,
35 * bt_field_class_integer_preferred_display_base
36 */
37 #include <babeltrace/trace-ir/field-class-const.h>
38
39 #include <stdint.h>
40 #include <stddef.h>
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
46 extern bt_field_class *bt_field_class_unsigned_integer_create(
47 bt_trace_class *trace_class);
48
49 extern bt_field_class *bt_field_class_signed_integer_create(
50 bt_trace_class *trace_class);
51
52 extern void bt_field_class_integer_set_field_value_range(
53 bt_field_class *field_class, uint64_t size);
54
55 extern void bt_field_class_integer_set_preferred_display_base(
56 bt_field_class *field_class,
57 bt_field_class_integer_preferred_display_base base);
58
59 extern bt_field_class *bt_field_class_real_create(bt_trace_class *trace_class);
60
61 extern void bt_field_class_real_set_is_single_precision(
62 bt_field_class *field_class,
63 bt_bool is_single_precision);
64
65 extern bt_field_class *bt_field_class_unsigned_enumeration_create(
66 bt_trace_class *trace_class);
67
68 extern bt_field_class *bt_field_class_signed_enumeration_create(
69 bt_trace_class *trace_class);
70
71 extern bt_field_class_status bt_field_class_unsigned_enumeration_map_range(
72 bt_field_class *field_class, const char *label,
73 uint64_t range_lower, uint64_t range_upper);
74
75 extern bt_field_class_status bt_field_class_signed_enumeration_map_range(
76 bt_field_class *field_class, const char *label,
77 int64_t range_lower, int64_t range_upper);
78
79 extern bt_field_class *bt_field_class_string_create(
80 bt_trace_class *trace_class);
81
82 extern bt_field_class *bt_field_class_structure_create(
83 bt_trace_class *trace_class);
84
85 extern bt_field_class_status bt_field_class_structure_append_member(
86 bt_field_class *struct_field_class,
87 const char *name, bt_field_class *field_class);
88
89 extern bt_field_class *bt_field_class_static_array_create(
90 bt_trace_class *trace_class,
91 bt_field_class *elem_field_class, uint64_t length);
92
93 extern bt_field_class *bt_field_class_dynamic_array_create(
94 bt_trace_class *trace_class,
95 bt_field_class *elem_field_class);
96
97 extern bt_field_class_status
98 bt_field_class_dynamic_array_set_length_field_class(
99 bt_field_class *field_class,
100 bt_field_class *length_field_class);
101
102 extern bt_field_class *bt_field_class_variant_create(
103 bt_trace_class *trace_class);
104
105 extern bt_field_class_status
106 bt_field_class_variant_set_selector_field_class(bt_field_class *field_class,
107 bt_field_class *selector_field_class);
108
109 extern bt_field_class_status bt_field_class_variant_append_option(
110 bt_field_class *var_field_class,
111 const char *name, bt_field_class *field_class);
112
113 #ifdef __cplusplus
114 }
115 #endif
116
117 #endif /* BABELTRACE_TRACE_IR_FIELD_CLASSES_H */
This page took 0.031304 seconds and 4 git commands to generate.