Commit | Line | Data |
---|---|---|
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 */ |
26 | struct bt_ctf_field; | |
27 | ||
28 | /* Common functions */ | |
29 | struct bt_ctf_field *bt_ctf_field_create( | |
30 | struct bt_ctf_field_type *type); | |
31 | struct bt_ctf_field_type *bt_ctf_field_get_type( | |
32 | struct bt_ctf_field *field); | |
33 | struct bt_ctf_field *bt_ctf_field_copy(struct bt_ctf_field *field); | |
34 | ||
35 | /* Integer field functions */ | |
36 | int bt_ctf_field_signed_integer_get_value(struct bt_ctf_field *integer, | |
37 | int64_t *OUTPUT); | |
38 | int bt_ctf_field_signed_integer_set_value(struct bt_ctf_field *integer, | |
39 | int64_t value); | |
40 | int bt_ctf_field_unsigned_integer_get_value(struct bt_ctf_field *integer, | |
41 | uint64_t *OUTPUT); | |
42 | int bt_ctf_field_unsigned_integer_set_value(struct bt_ctf_field *integer, | |
43 | uint64_t value); | |
44 | ||
45 | /* Floating point number field functions */ | |
46 | int bt_ctf_field_floating_point_get_value( | |
47 | struct bt_ctf_field *floating_point, double *OUTPUT); | |
48 | int bt_ctf_field_floating_point_set_value( | |
49 | struct bt_ctf_field *floating_point, | |
50 | double value); | |
51 | ||
52 | /* Enumeration field functions */ | |
53 | struct bt_ctf_field *bt_ctf_field_enumeration_get_container( | |
54 | struct bt_ctf_field *enumeration); | |
55 | struct bt_ctf_field_type_enumeration_mapping_iterator * | |
56 | bt_ctf_field_enumeration_get_mappings(struct bt_ctf_field *enum_field); | |
57 | ||
58 | /* String field functions */ | |
59 | const char *bt_ctf_field_string_get_value( | |
60 | struct bt_ctf_field *string_field); | |
61 | int bt_ctf_field_string_set_value(struct bt_ctf_field *string_field, | |
62 | const char *value); | |
63 | int bt_ctf_field_string_append(struct bt_ctf_field *string_field, | |
64 | const char *value); | |
65 | int bt_ctf_field_string_append_len( | |
66 | struct bt_ctf_field *string_field, const char *value, | |
67 | unsigned int length); | |
68 | ||
69 | /* Structure field functions */ | |
70 | struct bt_ctf_field *bt_ctf_field_structure_get_field_by_index( | |
71 | struct bt_ctf_field *structure, int index); | |
f6a5e476 PP |
72 | struct bt_ctf_field *bt_ctf_field_structure_get_field_by_name( |
73 | struct bt_ctf_field *struct_field, const char *name); | |
74 | int bt_ctf_field_structure_set_field_by_name(struct bt_ctf_field *struct_field, | |
75 | const char *name, struct bt_ctf_field *field); | |
81447b5b PP |
76 | |
77 | /* Array field functions */ | |
78 | struct bt_ctf_field *bt_ctf_field_array_get_field( | |
79 | struct bt_ctf_field *array, uint64_t index); | |
80 | ||
81 | /* Sequence field functions */ | |
82 | struct bt_ctf_field *bt_ctf_field_sequence_get_length( | |
83 | struct bt_ctf_field *sequence); | |
84 | int bt_ctf_field_sequence_set_length(struct bt_ctf_field *sequence, | |
85 | struct bt_ctf_field *length_field); | |
86 | struct bt_ctf_field *bt_ctf_field_sequence_get_field( | |
87 | struct bt_ctf_field *sequence, uint64_t index); | |
88 | ||
89 | /* Variant field functions */ | |
90 | struct bt_ctf_field *bt_ctf_field_variant_get_field( | |
91 | struct bt_ctf_field *variant, struct bt_ctf_field *tag); | |
92 | struct bt_ctf_field *bt_ctf_field_variant_get_current_field( | |
93 | struct bt_ctf_field *variant); | |
94 | struct bt_ctf_field *bt_ctf_field_variant_get_tag( | |
95 | struct bt_ctf_field *variant); |