bt2: Adapt test_field_class.py and make it pass
[babeltrace.git] / bindings / python / bt2 / bt2 / native_bt_field.i
CommitLineData
6945df9a
SM
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
25/* From field-const.h */
26
27typedef enum bt_field_status {
28 BT_FIELD_STATUS_OK = 0,
29 BT_FIELD_STATUS_NOMEM = -12,
30} bt_field_status;
31
32extern const bt_field_class *bt_field_borrow_class_const(
33 const bt_field *field);
34
35extern bt_field_class_type bt_field_get_class_type(
36 const bt_field *field);
37
38extern int64_t bt_field_signed_integer_get_value(const bt_field *field);
39
40extern uint64_t bt_field_unsigned_integer_get_value(
41 const bt_field *field);
42
43extern double bt_field_real_get_value(const bt_field *field);
44
45extern bt_field_status bt_field_unsigned_enumeration_get_mapping_labels(
46 const bt_field *field,
47 bt_field_class_enumeration_mapping_label_array *label_array,
48 uint64_t *count);
49
50extern bt_field_status bt_field_signed_enumeration_get_mapping_labels(
51 const bt_field *field,
52 bt_field_class_enumeration_mapping_label_array *label_array,
53 uint64_t *count);
54
55extern const char *bt_field_string_get_value(const bt_field *field);
56
57extern uint64_t bt_field_string_get_length(const bt_field *field);
58
59extern const bt_field *
60bt_field_structure_borrow_member_field_by_index_const(
61 const bt_field *field, uint64_t index);
62
63extern const bt_field *
64bt_field_structure_borrow_member_field_by_name_const(
65 const bt_field *field, const char *name);
66
67extern uint64_t bt_field_array_get_length(const bt_field *field);
68
69extern const bt_field *
70bt_field_array_borrow_element_field_by_index_const(
71 const bt_field *field, uint64_t index);
72
73extern uint64_t bt_field_variant_get_selected_option_field_index(
74 const bt_field *field);
75
76extern const bt_field *
77bt_field_variant_borrow_selected_option_field_const(
78 const bt_field *field);
79
80/* From field.h */
81
82extern void bt_field_signed_integer_set_value(bt_field *field,
83 int64_t value);
84
85extern void bt_field_unsigned_integer_set_value(bt_field *field,
86 uint64_t value);
87
88extern void bt_field_real_set_value(bt_field *field, double value);
89
90extern bt_field_status bt_field_string_set_value(bt_field *field,
91 const char *value);
92
93extern bt_field_status bt_field_string_append(bt_field *field,
94 const char *value);
95
96extern bt_field_status bt_field_string_append_with_length(bt_field *field,
97 const char *value, uint64_t length);
98
99extern bt_field_status bt_field_string_clear(bt_field *field);
100
101extern bt_field *bt_field_structure_borrow_member_field_by_index(
102 bt_field *field, uint64_t index);
103
104extern bt_field *bt_field_structure_borrow_member_field_by_name(
105 bt_field *field, const char *name);
106
107extern bt_field *bt_field_array_borrow_element_field_by_index(
108 bt_field *field, uint64_t index);
109
110extern bt_field_status bt_field_dynamic_array_set_length(bt_field *field,
111 uint64_t length);
112
113extern bt_field_status bt_field_variant_select_option_field(
114 bt_field *field, uint64_t index);
115
116extern bt_field *bt_field_variant_borrow_selected_option_field(
117 bt_field *field);
This page took 0.028978 seconds and 4 git commands to generate.