Python bt2: add reset and is_set to fields
[babeltrace.git] / bindings / python / bt2 / bt2 / native_btfields.i
CommitLineData
81447b5b
PP
1/*
2 * The MIT License (MIT)
3 *
4 * Copyright (c) 2016 Philippe Proulx <pproulx@efficios.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE.
23 */
24
81447b5b
PP
25/* Type */
26struct bt_ctf_field;
27
28/* Common functions */
29struct bt_ctf_field *bt_ctf_field_create(
30 struct bt_ctf_field_type *type);
31struct bt_ctf_field_type *bt_ctf_field_get_type(
32 struct bt_ctf_field *field);
33struct bt_ctf_field *bt_ctf_field_copy(struct bt_ctf_field *field);
742e4747
JG
34bt_bool bt_ctf_field_value_is_set(struct bt_ctf_field *field);
35int bt_ctf_field_reset_value(struct bt_ctf_field *field);
81447b5b
PP
36
37/* Integer field functions */
38int bt_ctf_field_signed_integer_get_value(struct bt_ctf_field *integer,
39 int64_t *OUTPUT);
40int bt_ctf_field_signed_integer_set_value(struct bt_ctf_field *integer,
41 int64_t value);
42int bt_ctf_field_unsigned_integer_get_value(struct bt_ctf_field *integer,
43 uint64_t *OUTPUT);
44int bt_ctf_field_unsigned_integer_set_value(struct bt_ctf_field *integer,
45 uint64_t value);
46
47/* Floating point number field functions */
48int bt_ctf_field_floating_point_get_value(
49 struct bt_ctf_field *floating_point, double *OUTPUT);
50int bt_ctf_field_floating_point_set_value(
51 struct bt_ctf_field *floating_point,
52 double value);
53
54/* Enumeration field functions */
55struct bt_ctf_field *bt_ctf_field_enumeration_get_container(
56 struct bt_ctf_field *enumeration);
57struct bt_ctf_field_type_enumeration_mapping_iterator *
58bt_ctf_field_enumeration_get_mappings(struct bt_ctf_field *enum_field);
59
60/* String field functions */
61const char *bt_ctf_field_string_get_value(
62 struct bt_ctf_field *string_field);
63int bt_ctf_field_string_set_value(struct bt_ctf_field *string_field,
64 const char *value);
65int bt_ctf_field_string_append(struct bt_ctf_field *string_field,
66 const char *value);
67int bt_ctf_field_string_append_len(
68 struct bt_ctf_field *string_field, const char *value,
69 unsigned int length);
70
71/* Structure field functions */
72struct bt_ctf_field *bt_ctf_field_structure_get_field_by_index(
73 struct bt_ctf_field *structure, int index);
811644b8
PP
74struct bt_ctf_field *bt_ctf_field_structure_get_field_by_name(
75 struct bt_ctf_field *struct_field, const char *name);
76int bt_ctf_field_structure_set_field_by_name(struct bt_ctf_field *struct_field,
77 const char *name, struct bt_ctf_field *field);
81447b5b
PP
78
79/* Array field functions */
80struct bt_ctf_field *bt_ctf_field_array_get_field(
81 struct bt_ctf_field *array, uint64_t index);
82
83/* Sequence field functions */
84struct bt_ctf_field *bt_ctf_field_sequence_get_length(
85 struct bt_ctf_field *sequence);
86int bt_ctf_field_sequence_set_length(struct bt_ctf_field *sequence,
87 struct bt_ctf_field *length_field);
88struct bt_ctf_field *bt_ctf_field_sequence_get_field(
89 struct bt_ctf_field *sequence, uint64_t index);
90
91/* Variant field functions */
92struct bt_ctf_field *bt_ctf_field_variant_get_field(
93 struct bt_ctf_field *variant, struct bt_ctf_field *tag);
94struct bt_ctf_field *bt_ctf_field_variant_get_current_field(
95 struct bt_ctf_field *variant);
96struct bt_ctf_field *bt_ctf_field_variant_get_tag(
97 struct bt_ctf_field *variant);
This page took 0.03225 seconds and 4 git commands to generate.