lib: make values API const-correct
[babeltrace.git] / include / babeltrace / trace-ir / private-field-classes.h
CommitLineData
e5be10ef
PP
1#ifndef BABELTRACE_TRACE_IR_PRIVATE_FIELD_CLASSES_H
2#define BABELTRACE_TRACE_IR_PRIVATE_FIELD_CLASSES_H
3
4/*
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
31/* For bt_bool */
32#include <babeltrace/types.h>
33
34/* For enum bt_field_class_integer_preferred_display_base */
35#include <babeltrace/trace-ir/field-classes.h>
36
37#include <stdint.h>
38#include <stddef.h>
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44struct bt_field_class;
45struct bt_private_field_class;
46struct bt_private_field_path;
47struct bt_private_field_class_signed_enumeration_mapping_ranges;
48struct bt_private_field_class_unsigned_enumeration_mapping_ranges;
49
d94d92ac 50static inline
707b7d35 51struct bt_field_class *bt_private_field_class_as_field_class(
d94d92ac
PP
52 struct bt_private_field_class *priv_field_class)
53{
54 return (void *) priv_field_class;
55}
e5be10ef
PP
56
57extern struct bt_private_field_class *
58bt_private_field_class_unsigned_integer_create(void);
59
60extern struct bt_private_field_class *
61bt_private_field_class_signed_integer_create(void);
62
140e6d94 63extern void bt_private_field_class_integer_set_field_value_range(
e5be10ef
PP
64 struct bt_private_field_class *field_class, uint64_t size);
65
140e6d94 66extern void bt_private_field_class_integer_set_preferred_display_base(
e5be10ef
PP
67 struct bt_private_field_class *field_class,
68 enum bt_field_class_integer_preferred_display_base base);
69
70extern struct bt_private_field_class *bt_private_field_class_real_create(void);
71
140e6d94 72extern void bt_private_field_class_real_set_is_single_precision(
e5be10ef
PP
73 struct bt_private_field_class *field_class,
74 bt_bool is_single_precision);
75
76extern struct bt_private_field_class *
77bt_private_field_class_unsigned_enumeration_create(void);
78
79extern struct bt_private_field_class *
80bt_private_field_class_signed_enumeration_create(void);
81
82extern uint64_t bt_private_field_class_enumeration_get_mapping_count(
83 struct bt_private_field_class *field_class);
84
85extern int bt_private_field_class_unsigned_enumeration_map_range(
86 struct bt_private_field_class *field_class, const char *label,
87 uint64_t range_lower, uint64_t range_upper);
88
89extern int bt_private_field_class_signed_enumeration_map_range(
90 struct bt_private_field_class *field_class, const char *label,
91 int64_t range_lower, int64_t range_upper);
92
93extern struct bt_private_field_class *
94bt_private_field_class_string_create(void);
95
96extern struct bt_private_field_class *
97bt_private_field_class_structure_create(void);
98
28e6ca8b 99extern void bt_private_field_class_structure_borrow_member_by_index(
e5be10ef
PP
100 struct bt_private_field_class *struct_field_class,
101 uint64_t index, const char **name,
102 struct bt_private_field_class **field_class);
103
104extern
105struct bt_private_field_class *
28e6ca8b 106bt_private_field_class_structure_borrow_member_field_class_by_name(
e5be10ef
PP
107 struct bt_private_field_class *field_class, const char *name);
108
28e6ca8b 109extern int bt_private_field_class_structure_append_member(
e5be10ef
PP
110 struct bt_private_field_class *struct_field_class,
111 const char *name, struct bt_private_field_class *field_class);
112
113extern struct bt_private_field_class *
114bt_private_field_class_static_array_create(
115 struct bt_private_field_class *elem_field_class,
116 uint64_t length);
117
118extern struct bt_private_field_class *
119bt_private_field_class_dynamic_array_create(
120 struct bt_private_field_class *elem_field_class);
121
122extern struct bt_private_field_class *
28e6ca8b 123bt_private_field_class_array_borrow_element_field_class(
e5be10ef
PP
124 struct bt_private_field_class *field_class);
125
28e6ca8b 126extern int bt_private_field_class_dynamic_array_set_length_field_class(
e5be10ef
PP
127 struct bt_private_field_class *field_class,
128 struct bt_private_field_class *length_field_class);
129
130extern struct bt_private_field_class *
131bt_private_field_class_variant_create(void);
132
28e6ca8b 133extern int bt_private_field_class_variant_set_selector_field_class(
e5be10ef
PP
134 struct bt_private_field_class *field_class,
135 struct bt_private_field_class *selector_field_class);
136
28e6ca8b 137extern void bt_private_field_class_variant_borrow_option_by_index(
e5be10ef
PP
138 struct bt_private_field_class *variant_field_class,
139 uint64_t index, const char **name,
140 struct bt_private_field_class **field_class);
141
142extern
143struct bt_private_field_class *
28e6ca8b 144bt_private_field_class_variant_borrow_option_field_class_by_name(
e5be10ef
PP
145 struct bt_private_field_class *field_class, const char *name);
146
147extern int bt_private_field_class_variant_append_private_option(
148 struct bt_private_field_class *var_field_class,
149 const char *name, struct bt_private_field_class *field_class);
150
151#ifdef __cplusplus
152}
153#endif
154
155#endif /* BABELTRACE_TRACE_IR_PRIVATE_FIELD_CLASSES_H */
This page took 0.028969 seconds and 4 git commands to generate.