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