Commit | Line | Data |
---|---|---|
6fa6bfa1 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 | ||
27 | typedef enum bt_field_status { | |
28 | BT_FIELD_STATUS_OK = 0, | |
29 | BT_FIELD_STATUS_NOMEM = -12, | |
30 | } bt_field_status; | |
31 | ||
32 | extern const bt_field_class *bt_field_borrow_class_const( | |
33 | const bt_field *field); | |
34 | ||
35 | extern bt_field_class_type bt_field_get_class_type( | |
36 | const bt_field *field); | |
37 | ||
38 | extern int64_t bt_field_signed_integer_get_value(const bt_field *field); | |
39 | ||
40 | extern uint64_t bt_field_unsigned_integer_get_value( | |
41 | const bt_field *field); | |
42 | ||
43 | extern double bt_field_real_get_value(const bt_field *field); | |
44 | ||
45 | extern 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 | ||
50 | extern 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 | ||
55 | extern const char *bt_field_string_get_value(const bt_field *field); | |
56 | ||
57 | extern uint64_t bt_field_string_get_length(const bt_field *field); | |
58 | ||
59 | extern const bt_field * | |
60 | bt_field_structure_borrow_member_field_by_index_const( | |
61 | const bt_field *field, uint64_t index); | |
62 | ||
63 | extern const bt_field * | |
64 | bt_field_structure_borrow_member_field_by_name_const( | |
65 | const bt_field *field, const char *name); | |
66 | ||
67 | extern uint64_t bt_field_array_get_length(const bt_field *field); | |
68 | ||
69 | extern const bt_field * | |
70 | bt_field_array_borrow_element_field_by_index_const( | |
71 | const bt_field *field, uint64_t index); | |
72 | ||
73 | extern uint64_t bt_field_variant_get_selected_option_field_index( | |
74 | const bt_field *field); | |
75 | ||
76 | extern const bt_field * | |
77 | bt_field_variant_borrow_selected_option_field_const( | |
78 | const bt_field *field); | |
79 | ||
80 | /* From field.h */ | |
81 | ||
82 | extern void bt_field_signed_integer_set_value(bt_field *field, | |
83 | int64_t value); | |
84 | ||
85 | extern void bt_field_unsigned_integer_set_value(bt_field *field, | |
86 | uint64_t value); | |
87 | ||
88 | extern void bt_field_real_set_value(bt_field *field, double value); | |
89 | ||
90 | extern bt_field_status bt_field_string_set_value(bt_field *field, | |
91 | const char *value); | |
92 | ||
93 | extern bt_field_status bt_field_string_append(bt_field *field, | |
94 | const char *value); | |
95 | ||
96 | extern bt_field_status bt_field_string_append_with_length(bt_field *field, | |
97 | const char *value, uint64_t length); | |
98 | ||
99 | extern bt_field_status bt_field_string_clear(bt_field *field); | |
100 | ||
101 | extern bt_field *bt_field_structure_borrow_member_field_by_index( | |
102 | bt_field *field, uint64_t index); | |
103 | ||
104 | extern bt_field *bt_field_structure_borrow_member_field_by_name( | |
105 | bt_field *field, const char *name); | |
106 | ||
107 | extern bt_field *bt_field_array_borrow_element_field_by_index( | |
108 | bt_field *field, uint64_t index); | |
109 | ||
110 | extern bt_field_status bt_field_dynamic_array_set_length(bt_field *field, | |
111 | uint64_t length); | |
112 | ||
113 | extern bt_field_status bt_field_variant_select_option_field( | |
114 | bt_field *field, uint64_t index); | |
115 | ||
116 | extern bt_field *bt_field_variant_borrow_selected_option_field( | |
117 | bt_field *field); |