Babeltrace 2 C API  2.0.6
Open-source trace manipulation framework
field.h
1 #ifndef BABELTRACE2_TRACE_IR_FIELD_H
2 #define BABELTRACE2_TRACE_IR_FIELD_H
3 
4 /*
5  * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a copy
8  * of this software and associated documentation files (the "Software"), to deal
9  * in the Software without restriction, including without limitation the rights
10  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11  * copies of the Software, and to permit persons to whom the Software is
12  * furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in
15  * all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23  * SOFTWARE.
24  */
25 
26 #ifndef __BT_IN_BABELTRACE_H
27 # error "Please include <babeltrace2/babeltrace.h> instead."
28 #endif
29 
30 #include <stdint.h>
31 
32 #include <babeltrace2/types.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
461  const bt_field *field);
462 
486 
495  const bt_field *field);
496 
521 extern void bt_field_bool_set_value(bt_field *field, bt_bool value);
522 
539 extern bt_bool bt_field_bool_get_value(const bt_field *field);
540 
570  uint64_t bits);
571 
594  const bt_field *field);
595 
625  uint64_t value);
626 
644  const bt_field *field);
645 
668  int64_t value);
669 
686 extern int64_t bt_field_integer_signed_get_value(const bt_field *field);
687 
707 
714 
756  uint64_t *count);
757 
799  uint64_t *count);
800 
827  float value);
828 
845 extern float bt_field_real_single_precision_get_value(const bt_field *field);
846 
866  double value);
867 
884 extern double bt_field_real_double_precision_get_value(const bt_field *field);
885 
902  BT_FIELD_STRING_SET_VALUE_STATUS_OK = __BT_FUNC_STATUS_OK,
903 
908  BT_FIELD_STRING_SET_VALUE_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
910 
939  bt_field *field, const char *value);
940 
954 extern uint64_t bt_field_string_get_length(const bt_field *field);
955 
976 extern const char *bt_field_string_get_value(const bt_field *field);
977 
988  BT_FIELD_STRING_APPEND_STATUS_OK = __BT_FUNC_STATUS_OK,
989 
994  BT_FIELD_STRING_APPEND_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
996 
1027  bt_field *field, const char *value);
1028 
1064  bt_field *field, const char *value, uint64_t length);
1065 
1081 extern void bt_field_string_clear(bt_field *field);
1082 
1103 extern uint64_t bt_field_array_get_length(const bt_field *field);
1104 
1138  bt_field *field, uint64_t index);
1139 
1147 extern const bt_field *
1149  const bt_field *field, uint64_t index);
1150 
1161 
1168 
1188 bt_field_array_dynamic_set_length(bt_field *field, uint64_t length);
1189 
1228  bt_field *field, uint64_t index);
1229 
1237 extern const bt_field *
1239  const bt_field *field, uint64_t index);
1240 
1272  bt_field *field, const char *name);
1273 
1281 extern const bt_field *
1283  const bt_field *field, const char *name);
1284 
1305 extern void bt_field_option_set_has_field(bt_field *field, bt_bool has_field);
1306 
1337 
1345 extern const bt_field *
1347 
1366 
1389  bt_field *field, uint64_t index);
1390 
1422  bt_field *field);
1423 
1431 extern const bt_field *
1433  const bt_field *field);
1434 
1453  const bt_field *field);
1454 
1476 extern const bt_field_class_variant_option *
1478  const bt_field *field);
1479 
1503  const bt_field *field);
1504 
1528  const bt_field *field);
1529 
1534 #ifdef __cplusplus
1535 }
1536 #endif
1537 
1538 #endif /* BABELTRACE2_TRACE_IR_FIELD_H */
bt_field * bt_field_array_borrow_element_field_by_index(bt_field *field, uint64_t index)
Borrows the field at index index from the array field field.
bt_field_enumeration_get_mapping_labels_status bt_field_enumeration_signed_get_mapping_labels(const bt_field *field, bt_field_class_enumeration_mapping_label_array *labels, uint64_t *count)
Returns an array of all the labels of the mappings of the class of the signed enumeration field field...
bt_bool bt_field_bool_get_value(const bt_field *field)
Returns the value of the boolean field field.
void bt_field_real_single_precision_set_value(bt_field *field, float value)
Sets the value of the single-precision real field field to value.
bt_field_string_set_value_status
Status codes for bt_field_string_set_value().
Definition: field.h:897
const bt_field * bt_field_option_borrow_field_const(const bt_field *field)
Borrows the field of the option field field (const version).
const bt_field_class_variant_with_selector_field_integer_signed_option * bt_field_variant_with_selector_field_integer_signed_borrow_selected_option_class_const(const bt_field *field)
Borrows the class of the selected option of the variant field (with a signed integer selector field) ...
bt_field * bt_field_structure_borrow_member_field_by_name(bt_field *field, const char *name)
Borrows the field of the member having the name name from the structure field field.
bt_field_array_dynamic_set_length_status
Status codes for bt_field_array_dynamic_set_length().
Definition: field.h:1155
struct bt_field_class_variant_with_selector_field_integer_signed_option bt_field_class_variant_with_selector_field_integer_signed_option
Variant field class (with a signed integer selector field) option.
Definition: types.h:60
bt_field_class * bt_field_borrow_class(bt_field *field)
Borrows the class of the field field.
void bt_field_option_set_has_field(bt_field *field, bt_bool has_field)
Sets whether or not the option field field has a field.
Success.
Definition: field.h:1364
void bt_field_integer_signed_set_value(bt_field *field, int64_t value)
Sets the value of the signed integer field field to value.
uint64_t bt_field_integer_unsigned_get_value(const bt_field *field)
Returns the value of the unsigned integer field field.
struct bt_field_class bt_field_class
Field class.
Definition: types.h:54
Out of memory.
Definition: field.h:994
const char * bt_field_string_get_value(const bt_field *field)
Returns the value of the string field field.
bt_field_enumeration_get_mapping_labels_status bt_field_enumeration_unsigned_get_mapping_labels(const bt_field *field, bt_field_class_enumeration_mapping_label_array *labels, uint64_t *count)
Returns an array of all the labels of the mappings of the class of the unsigned enumeration field fie...
bt_field_string_append_status bt_field_string_append(bt_field *field, const char *value)
Appends a copy of the string value to the current value of the string field field.
Success.
Definition: field.h:902
Success.
Definition: field.h:988
bt_field_class_type
Field class type enumerators.
Definition: field-class.h:1216
uint64_t bt_field_variant_get_selected_option_index(const bt_field *field)
Returns the index of the selected option of the variant field field.
bt_field_string_set_value_status bt_field_string_set_value(bt_field *field, const char *value)
Sets the value of the string field field to a copy of value.
const bt_field * bt_field_structure_borrow_member_field_by_index_const(const bt_field *field, uint64_t index)
Borrows the field of the member at index index from the structure field field (const version)...
uint64_t bt_field_array_get_length(const bt_field *field)
Returns the length of the array field field.
bt_field_enumeration_get_mapping_labels_status
Status codes for bt_field_enumeration_unsigned_get_mapping_labels() and bt_field_enumeration_signed_g...
Definition: field.h:701
bt_field_variant_select_option_by_index_status
Status code for bt_field_variant_select_option_by_index().
Definition: field.h:1359
void bt_field_real_double_precision_set_value(bt_field *field, double value)
Sets the value of the double-precision real field field to value.
const bt_field_class_variant_with_selector_field_integer_unsigned_option * bt_field_variant_with_selector_field_integer_unsigned_borrow_selected_option_class_const(const bt_field *field)
Borrows the class of the selected option of the variant field (with an unsigned integer selector fiel...
struct bt_field_class_variant_option bt_field_class_variant_option
Variant field class option.
Definition: types.h:59
double bt_field_real_double_precision_get_value(const bt_field *field)
Returns the value of the double-precision real field field.
bt_field_array_dynamic_set_length_status bt_field_array_dynamic_set_length(bt_field *field, uint64_t length)
Sets the length of the dynamic array field field.
Out of memory.
Definition: field.h:908
const bt_field_class * bt_field_borrow_class_const(const bt_field *field)
Borrows the class of the field field (const version).
int bt_bool
Babeltrace 2 boolean type.
Definition: types.h:140
void bt_field_integer_unsigned_set_value(bt_field *field, uint64_t value)
Sets the value of the unsigned integer field field to value.
bt_field_string_append_status bt_field_string_append_with_length(bt_field *field, const char *value, uint64_t length)
Appends a copy of the first length bytes of the string value to the current value of the string field...
bt_field_class_type bt_field_get_class_type(const bt_field *field)
Returns the type enumerator of the class of the field field.
Success.
Definition: field.h:1160
Out of memory.
Definition: field.h:1166
void bt_field_bit_array_set_value_as_integer(bt_field *field, uint64_t bits)
Sets the bits of the bit array field field to the bits of bits.
uint64_t bt_field_string_get_length(const bt_field *field)
Returns the length of the string field field.
const bt_field * bt_field_array_borrow_element_field_by_index_const(const bt_field *field, uint64_t index)
Borrows the field at index index from the array field field (const version).
char const *const * bt_field_class_enumeration_mapping_label_array
Array of const enumeration field class labels.
Definition: field-class.h:2046
struct bt_field_class_variant_with_selector_field_integer_unsigned_option bt_field_class_variant_with_selector_field_integer_unsigned_option
Variant field class (with an unsigned integer selector field) option.
Definition: types.h:61
bt_field * bt_field_variant_borrow_selected_option_field(bt_field *field)
Borrows the field of the selected option of the variant field field.
float bt_field_real_single_precision_get_value(const bt_field *field)
Returns the value of the single-precision real field field.
int64_t bt_field_integer_signed_get_value(const bt_field *field)
Returns the value of the signed integer field field.
struct bt_field bt_field
Field.
Definition: types.h:53
void bt_field_string_clear(bt_field *field)
Clears the string field field, making its value an empty string.
bt_field_variant_select_option_by_index_status bt_field_variant_select_option_by_index(bt_field *field, uint64_t index)
Sets the selected option of the variant field field to the option at index index. ...
const bt_field_class_variant_option * bt_field_variant_borrow_selected_option_class_const(const bt_field *field)
Borrows the class of the selected option of the variant field field.
const bt_field * bt_field_variant_borrow_selected_option_field_const(const bt_field *field)
Borrows the field of the selected option of the variant field field (const version).
uint64_t bt_field_bit_array_get_value_as_integer(const bt_field *field)
Returns the bits of the bit array field field as an unsigned integer.
bt_field * bt_field_structure_borrow_member_field_by_index(bt_field *field, uint64_t index)
Borrows the field of the member at index index from the structure field field.
bt_field * bt_field_option_borrow_field(bt_field *field)
Borrows the field of the option field field.
void bt_field_bool_set_value(bt_field *field, bt_bool value)
Sets the value of the boolean field field to value.
const bt_field * bt_field_structure_borrow_member_field_by_name_const(const bt_field *field, const char *name)
Borrows the field of the member having the name name from the structure field field (const version)...
bt_field_string_append_status
Status codes for bt_field_string_append() and bt_field_string_append_with_length().
Definition: field.h:983