Fix: CTF writer: bt_ctf_field_unsigned_integer_set_value() -> *get_value()
[babeltrace.git] / include / babeltrace2-ctf-writer / fields.h
CommitLineData
924dc299
PP
1#ifndef BABELTRACE2_CTF_WRITER_FIELDS_H
2#define BABELTRACE2_CTF_WRITER_FIELDS_H
3dca2276
PP
3
4/*
bbb7b5f0 5 * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
3dca2276
PP
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
3dca2276
PP
24 */
25
26#include <stdint.h>
27#include <stddef.h>
28
3dca2276
PP
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33struct bt_ctf_field;
34struct bt_ctf_event_class;
35struct bt_ctf_event;
36struct bt_ctf_field_type;
37struct bt_ctf_field_type_enumeration_mapping_iterator;
38
39extern struct bt_ctf_field *bt_ctf_field_create(
40 struct bt_ctf_field_type *field_type);
41
42extern struct bt_ctf_field_type *bt_ctf_field_get_type(
43 struct bt_ctf_field *field);
44
45extern enum bt_ctf_field_type_id bt_ctf_field_get_type_id(
46 struct bt_ctf_field *field);
47
48extern struct bt_ctf_field *bt_ctf_field_copy(struct bt_ctf_field *field);
49
50extern int bt_ctf_field_integer_signed_get_value(
51 struct bt_ctf_field *integer_field, int64_t *value);
52
53/* Pre-2.0 CTF writer compatibility */
54static inline
55int bt_ctf_field_signed_integer_set_value(
56 struct bt_ctf_field *integer_field, int64_t *value)
57{
58 return bt_ctf_field_integer_signed_get_value(integer_field, value);
59}
60
61extern int bt_ctf_field_integer_signed_set_value(
62 struct bt_ctf_field *integer_field, int64_t value);
63
64extern int bt_ctf_field_integer_unsigned_get_value(
65 struct bt_ctf_field *integer_field, uint64_t *value);
66
67extern int bt_ctf_field_integer_unsigned_set_value(
68 struct bt_ctf_field *integer_field, uint64_t value);
69
70/* Pre-2.0 CTF writer compatibility */
71static inline
16b589f8 72int bt_ctf_field_unsigned_integer_get_value(
3dca2276
PP
73 struct bt_ctf_field *integer_field, uint64_t *value)
74{
75 return bt_ctf_field_integer_unsigned_get_value(integer_field, value);
76}
77
78extern int bt_ctf_field_floating_point_get_value(
79 struct bt_ctf_field *float_field, double *value);
80
81extern int bt_ctf_field_floating_point_set_value(
82 struct bt_ctf_field *float_field, double value);
83
84extern struct bt_ctf_field *bt_ctf_field_enumeration_get_container(
85 struct bt_ctf_field *enum_field);
86
3dca2276
PP
87extern const char *bt_ctf_field_string_get_value(
88 struct bt_ctf_field *string_field);
89
90extern int bt_ctf_field_string_set_value(struct bt_ctf_field *string_field,
91 const char *value);
92
93extern int bt_ctf_field_string_append(struct bt_ctf_field *string_field,
94 const char *value);
95
96extern int bt_ctf_field_string_append_len(
97 struct bt_ctf_field *string_field, const char *value,
98 unsigned int length);
99
100extern struct bt_ctf_field *bt_ctf_field_structure_get_field_by_name(
101 struct bt_ctf_field *struct_field, const char *name);
102
103/* Pre-2.0 CTF writer compatibility */
104static inline
105struct bt_ctf_field *bt_ctf_field_structure_get_field(
106 struct bt_ctf_field *structure, const char *name)
107{
108 return bt_ctf_field_structure_get_field_by_name(structure, name);
109}
110
111extern struct bt_ctf_field *bt_ctf_field_structure_get_field_by_index(
112 struct bt_ctf_field *struct_field, uint64_t index);
113
3dca2276
PP
114extern struct bt_ctf_field *bt_ctf_field_array_get_field(
115 struct bt_ctf_field *array_field, uint64_t index);
116
117extern struct bt_ctf_field *bt_ctf_field_sequence_get_field(
118 struct bt_ctf_field *sequence_field, uint64_t index);
119
3dca2276
PP
120extern int bt_ctf_field_sequence_set_length(struct bt_ctf_field *sequence_field,
121 struct bt_ctf_field *length_field);
122
123extern struct bt_ctf_field *bt_ctf_field_variant_get_field(
124 struct bt_ctf_field *variant_field,
125 struct bt_ctf_field *tag_field);
126
127extern struct bt_ctf_field *bt_ctf_field_variant_get_current_field(
128 struct bt_ctf_field *variant_field);
129
3dca2276
PP
130#ifdef __cplusplus
131}
132#endif
133
924dc299 134#endif /* BABELTRACE2_CTF_WRITER_FIELDS_H */
This page took 0.037311 seconds and 4 git commands to generate.