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); | |
d4bf905a JG |
34 | bt_bool bt_ctf_field_is_set(struct bt_ctf_field *field); |
35 | int bt_ctf_field_reset(struct bt_ctf_field *field); | |
81447b5b PP |
36 | |
37 | /* Integer field functions */ | |
38 | int bt_ctf_field_signed_integer_get_value(struct bt_ctf_field *integer, | |
39 | int64_t *OUTPUT); | |
40 | int bt_ctf_field_signed_integer_set_value(struct bt_ctf_field *integer, | |
41 | int64_t value); | |
42 | int bt_ctf_field_unsigned_integer_get_value(struct bt_ctf_field *integer, | |
43 | uint64_t *OUTPUT); | |
44 | int bt_ctf_field_unsigned_integer_set_value(struct bt_ctf_field *integer, | |
45 | uint64_t value); | |
46 | ||
47 | /* Floating point number field functions */ | |
48 | int bt_ctf_field_floating_point_get_value( | |
49 | struct bt_ctf_field *floating_point, double *OUTPUT); | |
50 | int bt_ctf_field_floating_point_set_value( | |
51 | struct bt_ctf_field *floating_point, | |
52 | double value); | |
53 | ||
54 | /* Enumeration field functions */ | |
55 | struct bt_ctf_field *bt_ctf_field_enumeration_get_container( | |
56 | struct bt_ctf_field *enumeration); | |
57 | struct bt_ctf_field_type_enumeration_mapping_iterator * | |
58 | bt_ctf_field_enumeration_get_mappings(struct bt_ctf_field *enum_field); | |
59 | ||
60 | /* String field functions */ | |
61 | const char *bt_ctf_field_string_get_value( | |
62 | struct bt_ctf_field *string_field); | |
63 | int bt_ctf_field_string_set_value(struct bt_ctf_field *string_field, | |
64 | const char *value); | |
65 | int bt_ctf_field_string_append(struct bt_ctf_field *string_field, | |
66 | const char *value); | |
67 | int 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 */ | |
72 | struct bt_ctf_field *bt_ctf_field_structure_get_field_by_index( | |
73 | struct bt_ctf_field *structure, int index); | |
811644b8 PP |
74 | struct bt_ctf_field *bt_ctf_field_structure_get_field_by_name( |
75 | struct bt_ctf_field *struct_field, const char *name); | |
76 | int 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 */ | |
80 | struct bt_ctf_field *bt_ctf_field_array_get_field( | |
81 | struct bt_ctf_field *array, uint64_t index); | |
82 | ||
83 | /* Sequence field functions */ | |
84 | struct bt_ctf_field *bt_ctf_field_sequence_get_length( | |
85 | struct bt_ctf_field *sequence); | |
86 | int bt_ctf_field_sequence_set_length(struct bt_ctf_field *sequence, | |
87 | struct bt_ctf_field *length_field); | |
88 | struct bt_ctf_field *bt_ctf_field_sequence_get_field( | |
89 | struct bt_ctf_field *sequence, uint64_t index); | |
90 | ||
91 | /* Variant field functions */ | |
92 | struct bt_ctf_field *bt_ctf_field_variant_get_field( | |
93 | struct bt_ctf_field *variant, struct bt_ctf_field *tag); | |
94 | struct bt_ctf_field *bt_ctf_field_variant_get_current_field( | |
95 | struct bt_ctf_field *variant); | |
96 | struct bt_ctf_field *bt_ctf_field_variant_get_tag( | |
97 | struct bt_ctf_field *variant); |