bt_clock_class_create(): accept mandatory trace class
[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
b19ff26f 30/* For bt_bool, bt_field_class */
5cd6d0e5
PP
31#include <babeltrace/types.h>
32
4295b9e0 33/*
4cdfc5e8
PP
34 * For bt_field_class_status,
35 * bt_field_class_integer_preferred_display_base
4295b9e0 36 */
c6bd8523 37#include <babeltrace/trace-ir/field-class-const.h>
40f4ba76 38
5cd6d0e5
PP
39#include <stdint.h>
40#include <stddef.h>
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
b19ff26f 46extern bt_field_class *bt_field_class_unsigned_integer_create(void);
5cd6d0e5 47
b19ff26f 48extern bt_field_class *bt_field_class_signed_integer_create(void);
40f4ba76
PP
49
50extern void bt_field_class_integer_set_field_value_range(
b19ff26f 51 bt_field_class *field_class, uint64_t size);
40f4ba76
PP
52
53extern void bt_field_class_integer_set_preferred_display_base(
b19ff26f 54 bt_field_class *field_class,
4cdfc5e8 55 bt_field_class_integer_preferred_display_base base);
40f4ba76 56
b19ff26f 57extern bt_field_class *bt_field_class_real_create(void);
40f4ba76
PP
58
59extern void bt_field_class_real_set_is_single_precision(
b19ff26f 60 bt_field_class *field_class,
40f4ba76
PP
61 bt_bool is_single_precision);
62
b19ff26f 63extern bt_field_class *bt_field_class_unsigned_enumeration_create(void);
40f4ba76 64
b19ff26f 65extern bt_field_class *bt_field_class_signed_enumeration_create(void);
40f4ba76 66
4cdfc5e8 67extern bt_field_class_status bt_field_class_unsigned_enumeration_map_range(
b19ff26f 68 bt_field_class *field_class, const char *label,
40f4ba76
PP
69 uint64_t range_lower, uint64_t range_upper);
70
4cdfc5e8 71extern bt_field_class_status bt_field_class_signed_enumeration_map_range(
b19ff26f 72 bt_field_class *field_class, const char *label,
40f4ba76
PP
73 int64_t range_lower, int64_t range_upper);
74
b19ff26f 75extern bt_field_class *bt_field_class_string_create(void);
40f4ba76 76
b19ff26f 77extern bt_field_class *bt_field_class_structure_create(void);
40f4ba76 78
4cdfc5e8 79extern bt_field_class_status bt_field_class_structure_append_member(
b19ff26f
PP
80 bt_field_class *struct_field_class,
81 const char *name, bt_field_class *field_class);
40f4ba76 82
b19ff26f
PP
83extern bt_field_class *bt_field_class_static_array_create(
84 bt_field_class *elem_field_class, uint64_t length);
40f4ba76 85
b19ff26f
PP
86extern bt_field_class *bt_field_class_dynamic_array_create(
87 bt_field_class *elem_field_class);
40f4ba76 88
4cdfc5e8 89extern bt_field_class_status
4295b9e0 90bt_field_class_dynamic_array_set_length_field_class(
b19ff26f
PP
91 bt_field_class *field_class,
92 bt_field_class *length_field_class);
40f4ba76 93
b19ff26f 94extern bt_field_class *bt_field_class_variant_create(void);
40f4ba76 95
4cdfc5e8 96extern bt_field_class_status
4295b9e0 97bt_field_class_variant_set_selector_field_class(bt_field_class *field_class,
b19ff26f 98 bt_field_class *selector_field_class);
40f4ba76 99
4cdfc5e8 100extern bt_field_class_status bt_field_class_variant_append_option(
b19ff26f
PP
101 bt_field_class *var_field_class,
102 const char *name, bt_field_class *field_class);
5cd6d0e5 103
5cd6d0e5
PP
104#ifdef __cplusplus
105}
106#endif
107
108#endif /* BABELTRACE_TRACE_IR_FIELD_CLASSES_H */
This page took 0.031462 seconds and 4 git commands to generate.