Babeltrace 2 C API 2.1.0
Open-source trace manipulation framework
Loading...
Searching...
No Matches
field.h
1/*
2 * SPDX-License-Identifier: MIT
3 *
4 * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation
5 */
6
7#ifndef BABELTRACE2_TRACE_IR_FIELD_H
8#define BABELTRACE2_TRACE_IR_FIELD_H
9
10/* IWYU pragma: private, include <babeltrace2/babeltrace.h> */
11
12#ifndef __BT_IN_BABELTRACE_H
13# error "Please include <babeltrace2/babeltrace.h> instead."
14#endif
15
16#include <stdint.h>
17
18#include <babeltrace2/types.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
496 const bt_field *field) __BT_NOEXCEPT;
497
520extern bt_field_class *bt_field_borrow_class(bt_field *field) __BT_NOEXCEPT;
521
530 const bt_field *field) __BT_NOEXCEPT;
531
556extern void bt_field_bool_set_value(bt_field *field, bt_bool value)
557 __BT_NOEXCEPT;
558
575extern bt_bool bt_field_bool_get_value(const bt_field *field) __BT_NOEXCEPT;
576
606 uint64_t bits) __BT_NOEXCEPT;
607
630 const bt_field *field) __BT_NOEXCEPT;
631
652
695 uint64_t *count) __BT_NOEXCEPT;
696
726 uint64_t value) __BT_NOEXCEPT;
727
745 const bt_field *field) __BT_NOEXCEPT;
746
769 int64_t value) __BT_NOEXCEPT;
770
788 const bt_field *field) __BT_NOEXCEPT;
789
816
858 uint64_t *count) __BT_NOEXCEPT;
859
901 uint64_t *count) __BT_NOEXCEPT;
902
929 float value) __BT_NOEXCEPT;
930
948 const bt_field *field) __BT_NOEXCEPT;
949
969 double value) __BT_NOEXCEPT;
970
988 const bt_field *field) __BT_NOEXCEPT;
989
1014
1043 bt_field *field, const char *value) __BT_NOEXCEPT;
1044
1058extern uint64_t bt_field_string_get_length(const bt_field *field) __BT_NOEXCEPT;
1059
1080extern const char *bt_field_string_get_value(
1081 const bt_field *field) __BT_NOEXCEPT;
1082
1101
1132 bt_field *field, const char *value) __BT_NOEXCEPT;
1133
1169 bt_field *field, const char *value, uint64_t length)
1170 __BT_NOEXCEPT;
1171
1187extern void bt_field_string_clear(bt_field *field) __BT_NOEXCEPT;
1188
1212extern uint64_t bt_field_blob_get_length(const bt_field *field);
1213
1243extern uint8_t *bt_field_blob_get_data(bt_field *field);
1244
1268extern const uint8_t *bt_field_blob_get_data_const(const bt_field *field);
1269
1289
1313 bt_field *field, uint64_t length);
1314
1335extern uint64_t bt_field_array_get_length(const bt_field *field) __BT_NOEXCEPT;
1336
1370 bt_field *field, uint64_t index) __BT_NOEXCEPT;
1371
1379extern const bt_field *
1381 const bt_field *field, uint64_t index) __BT_NOEXCEPT;
1382
1400
1421 __BT_NOEXCEPT;
1422
1461 bt_field *field, uint64_t index) __BT_NOEXCEPT;
1462
1470extern const bt_field *
1472 const bt_field *field, uint64_t index) __BT_NOEXCEPT;
1473
1505 bt_field *field, const char *name) __BT_NOEXCEPT;
1506
1514extern const bt_field *
1516 const bt_field *field, const char *name) __BT_NOEXCEPT;
1517
1538extern void bt_field_option_set_has_field(bt_field *field, bt_bool has_field)
1539 __BT_NOEXCEPT;
1540
1570extern bt_field *bt_field_option_borrow_field(bt_field *field) __BT_NOEXCEPT;
1571
1579extern const bt_field *
1581
1600
1623 bt_field *field, uint64_t index) __BT_NOEXCEPT;
1624
1656 bt_field *field) __BT_NOEXCEPT;
1657
1665extern const bt_field *
1667 const bt_field *field) __BT_NOEXCEPT;
1668
1687 const bt_field *field) __BT_NOEXCEPT;
1688
1710extern const bt_field_class_variant_option *
1712 const bt_field *field) __BT_NOEXCEPT;
1713
1737 const bt_field *field) __BT_NOEXCEPT;
1738
1762 const bt_field *field) __BT_NOEXCEPT;
1763
1768#ifdef __cplusplus
1769}
1770#endif
1771
1772#endif /* BABELTRACE2_TRACE_IR_FIELD_H */
int bt_bool
Babeltrace&#160;2 boolean type.
Definition types.h:126
char const *const * bt_field_class_enumeration_mapping_label_array
Array of const enumeration field class mapping labels.
Definition field-class.h:2988
bt_field_class_type
Field class type enumerators.
Definition field-class.h:1633
struct bt_field_class_variant_option bt_field_class_variant_option
Variant field class option.
Definition types.h:45
struct bt_field_class_variant_with_selector_field_integer_unsigned_option bt_field_class_variant_with_selector_field_integer_unsigned_option
Variant field class option (instances with a linked unsigned integer selector field).
Definition types.h:47
struct bt_field_class bt_field_class
Field class.
Definition types.h:39
char const *const * bt_field_class_bit_array_flag_label_array
Array of const bit array field class flag labels.
Definition field-class.h:2403
struct bt_field_class_variant_with_selector_field_integer_signed_option bt_field_class_variant_with_selector_field_integer_signed_option
Variant field class option (instances with a linked signed integer selector field).
Definition types.h:46
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_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...
const bt_field_class * bt_field_borrow_class_const(const bt_field *field)
Borrows the class of the field field (const version).
uint64_t bt_field_string_get_length(const bt_field *field)
Returns the length of the string field field.
bt_field_variant_select_option_by_index_status
Status code for bt_field_variant_select_option_by_index().
Definition field.h:1593
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.
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).
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_blob_dynamic_set_length_status bt_field_blob_dynamic_set_length(bt_field *field, uint64_t length)
Sets the length (number of bytes) of the dynamic BLOB field field.
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...
uint64_t bt_field_integer_unsigned_get_value(const bt_field *field)
Returns the value of the unsigned integer field field.
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_bit_array_get_active_flag_labels_status
Status codes for bt_field_bit_array_get_active_flag_labels().
Definition field.h:639
double bt_field_real_double_precision_get_value(const bt_field *field)
Returns the value of the double-precision real field field.
float bt_field_real_single_precision_get_value(const bt_field *field)
Returns the value of the single-precision real field field.
bt_field_bit_array_get_active_flag_labels_status bt_field_bit_array_get_active_flag_labels(const bt_field *field, bt_field_class_bit_array_flag_label_array *labels, uint64_t *count)
Returns the labels of all the active flags of the class of the bit array field field for the set bits...
uint64_t bt_field_array_get_length(const bt_field *field)
Returns the length of the array 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.
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.
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.
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.
bt_field_string_append_status
Status codes for bt_field_string_append() and bt_field_string_append_with_length().
Definition field.h:1088
uint64_t bt_field_blob_get_length(const bt_field *field)
Returns the length (number of bytes) of the BLOB 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.
bt_field_array_dynamic_set_length_status
Status codes for bt_field_array_dynamic_set_length().
Definition field.h:1387
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.
void bt_field_integer_signed_set_value(bt_field *field, int64_t value)
Sets the value of the signed integer field field to value.
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.
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:803
void bt_field_string_clear(bt_field *field)
Clears the string field field, making its value an empty string.
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_variant_borrow_selected_option_field(bt_field *field)
Borrows the field of the selected option of the variant field field.
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.
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 * bt_field_option_borrow_field(bt_field *field)
Borrows the field of the option field field.
struct bt_field bt_field
Field.
Definition types.h:38
bt_field_class_type bt_field_get_class_type(const bt_field *field)
Returns the type enumerator of the class of the field field.
int64_t bt_field_integer_signed_get_value(const bt_field *field)
Returns the value of the signed integer field field.
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).
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).
bt_field_string_set_value_status
Status codes for bt_field_string_set_value().
Definition field.h:1001
bt_field_class * bt_field_borrow_class(bt_field *field)
Borrows the class of the field field.
uint8_t * bt_field_blob_get_data(bt_field *field)
Returns the writable data of the BLOB field field.
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) ...
const bt_field * bt_field_option_borrow_field_const(const bt_field *field)
Borrows the field of the option field field (const version).
const uint8_t * bt_field_blob_get_data_const(const bt_field *field)
Returns the readable data of the BLOB field field.
const char * bt_field_string_get_value(const bt_field *field)
Returns the value of the string field field.
void bt_field_bool_set_value(bt_field *field, bt_bool value)
Sets the value of the boolean field field to value.
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_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...
bt_field_blob_dynamic_set_length_status
Status codes for bt_field_blob_dynamic_set_length().
Definition field.h:1276
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 * 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).
@ BT_FIELD_VARIANT_SELECT_OPTION_STATUS_OK
Success.
Definition field.h:1598
@ BT_FIELD_BIT_ARRAY_GET_ACTIVE_FLAG_LABELS_STATUS_OK
Success.
Definition field.h:644
@ BT_FIELD_BIT_ARRAY_GET_ACTIVE_FLAG_LABELS_STATUS_MEMORY_ERROR
Out of memory.
Definition field.h:650
@ BT_FIELD_STRING_APPEND_STATUS_MEMORY_ERROR
Out of memory.
Definition field.h:1099
@ BT_FIELD_STRING_APPEND_STATUS_OK
Success.
Definition field.h:1093
@ BT_FIELD_DYNAMIC_ARRAY_SET_LENGTH_STATUS_OK
Success.
Definition field.h:1392
@ BT_FIELD_DYNAMIC_ARRAY_SET_LENGTH_STATUS_MEMORY_ERROR
Out of memory.
Definition field.h:1398
@ BT_FIELD_ENUMERATION_GET_MAPPING_LABELS_STATUS_MEMORY_ERROR
Out of memory.
Definition field.h:814
@ BT_FIELD_ENUMERATION_GET_MAPPING_LABELS_STATUS_OK
Success.
Definition field.h:808
@ BT_FIELD_STRING_SET_VALUE_STATUS_MEMORY_ERROR
Out of memory.
Definition field.h:1012
@ BT_FIELD_STRING_SET_VALUE_STATUS_OK
Success.
Definition field.h:1006
@ BT_FIELD_DYNAMIC_BLOB_SET_LENGTH_STATUS_OK
Success.
Definition field.h:1281
@ BT_FIELD_DYNAMIC_BLOB_SET_LENGTH_STATUS_MEMORY_ERROR
Out of memory.
Definition field.h:1287