X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace2%2Ftrace-ir%2Ffield-class-const.h;h=777e07b0f060c69b518ba92ed9beaca9dd3f1f6a;hb=7b6afccb24b31e2feed787c2ed97809e797c3070;hp=b07ee4b615880ad27957649df672f94a53106baa;hpb=3fadfbc0c91f82c46bd36e6e0657ea93570c9db1;p=babeltrace.git diff --git a/include/babeltrace2/trace-ir/field-class-const.h b/include/babeltrace2/trace-ir/field-class-const.h index b07ee4b6..777e07b0 100644 --- a/include/babeltrace2/trace-ir/field-class-const.h +++ b/include/babeltrace2/trace-ir/field-class-const.h @@ -1,9 +1,8 @@ -#ifndef BABELTRACE_TRACE_IR_FIELD_CLASSES_CONST_H -#define BABELTRACE_TRACE_IR_FIELD_CLASSES_CONST_H +#ifndef BABELTRACE2_TRACE_IR_FIELD_CLASS_CONST_H +#define BABELTRACE2_TRACE_IR_FIELD_CLASS_CONST_H /* - * Copyright 2017-2018 Philippe Proulx - * Copyright 2013, 2014 Jérémie Galarneau + * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,55 +21,55 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. - * - * The Common Trace Format (CTF) Specification is available at - * http://www.efficios.com/ctf */ -/* - * For bt_bool, bt_field_class, bt_field_path, - * bt_field_class_enumeration_mapping, - * bt_field_class_unsigned_enumeration_mapping, - * bt_field_class_signed_enumeration_mapping, - * bt_field_class_enumeration_mapping_label_array, __BT_UPCAST_CONST - */ -#include +#ifndef __BT_IN_BABELTRACE_H +# error "Please include instead." +#endif #include #include +#include + #ifdef __cplusplus extern "C" { #endif -typedef enum bt_field_class_status { - BT_FIELD_CLASS_STATUS_OK = 0, - BT_FIELD_CLASS_STATUS_NOMEM = -12, -} bt_field_class_status; - typedef enum bt_field_class_type { - BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER, - BT_FIELD_CLASS_TYPE_SIGNED_INTEGER, - BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION, - BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION, - BT_FIELD_CLASS_TYPE_REAL, - BT_FIELD_CLASS_TYPE_STRING, - BT_FIELD_CLASS_TYPE_STRUCTURE, - BT_FIELD_CLASS_TYPE_STATIC_ARRAY, - BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY, - BT_FIELD_CLASS_TYPE_VARIANT, + BT_FIELD_CLASS_TYPE_BOOL = 0, + BT_FIELD_CLASS_TYPE_BIT_ARRAY = 1, + BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER = 2, + BT_FIELD_CLASS_TYPE_SIGNED_INTEGER = 3, + BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION = 4, + BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION = 5, + BT_FIELD_CLASS_TYPE_REAL = 6, + BT_FIELD_CLASS_TYPE_STRING = 7, + BT_FIELD_CLASS_TYPE_STRUCTURE = 8, + BT_FIELD_CLASS_TYPE_STATIC_ARRAY = 9, + BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY = 10, + BT_FIELD_CLASS_TYPE_OPTION = 11, + BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR = 12, + BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR = 13, + BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR = 14, } bt_field_class_type; typedef enum bt_field_class_integer_preferred_display_base { - BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_BINARY, - BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_OCTAL, - BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_DECIMAL, - BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_HEXADECIMAL, + BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_BINARY = 2, + BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_OCTAL = 8, + BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_DECIMAL = 10, + BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_HEXADECIMAL = 16, } bt_field_class_integer_preferred_display_base; extern bt_field_class_type bt_field_class_get_type( const bt_field_class *field_class); +extern const bt_value *bt_field_class_borrow_user_attributes_const( + const bt_field_class *field_class); + +extern uint64_t bt_field_class_bit_array_get_length( + const bt_field_class *field_class); + extern uint64_t bt_field_class_integer_get_field_value_range( const bt_field_class *field_class); @@ -84,26 +83,34 @@ extern bt_bool bt_field_class_real_is_single_precision( extern uint64_t bt_field_class_enumeration_get_mapping_count( const bt_field_class *field_class); -extern const bt_field_class_unsigned_enumeration_mapping * -bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const( +extern const bt_field_class_enumeration_unsigned_mapping * +bt_field_class_enumeration_unsigned_borrow_mapping_by_index_const( const bt_field_class *field_class, uint64_t index); -extern const bt_field_class_signed_enumeration_mapping * -bt_field_class_signed_enumeration_borrow_mapping_by_index_const( +extern const bt_field_class_enumeration_unsigned_mapping * +bt_field_class_enumeration_unsigned_borrow_mapping_by_label_const( + const bt_field_class *field_class, const char *label); + +extern const bt_field_class_enumeration_signed_mapping * +bt_field_class_enumeration_signed_borrow_mapping_by_index_const( const bt_field_class *field_class, uint64_t index); +extern const bt_field_class_enumeration_signed_mapping * +bt_field_class_enumeration_signed_borrow_mapping_by_label_const( + const bt_field_class *field_class, const char *label); + static inline const bt_field_class_enumeration_mapping * -bt_field_class_unsigned_enumeration_mapping_as_mapping_const( - const bt_field_class_unsigned_enumeration_mapping *mapping) +bt_field_class_enumeration_unsigned_mapping_as_mapping_const( + const bt_field_class_enumeration_unsigned_mapping *mapping) { return __BT_UPCAST_CONST(bt_field_class_enumeration_mapping, mapping); } static inline const bt_field_class_enumeration_mapping * -bt_field_class_signed_enumeration_mapping_as_mapping_const( - const bt_field_class_signed_enumeration_mapping *mapping) +bt_field_class_enumeration_signed_mapping_as_mapping_const( + const bt_field_class_enumeration_signed_mapping *mapping) { return __BT_UPCAST_CONST(bt_field_class_enumeration_mapping, mapping); } @@ -111,27 +118,27 @@ bt_field_class_signed_enumeration_mapping_as_mapping_const( extern const char *bt_field_class_enumeration_mapping_get_label( const bt_field_class_enumeration_mapping *mapping); -extern uint64_t bt_field_class_enumeration_mapping_get_range_count( - const bt_field_class_enumeration_mapping *mapping); +extern const bt_integer_range_set_unsigned * +bt_field_class_enumeration_unsigned_mapping_borrow_ranges_const( + const bt_field_class_enumeration_unsigned_mapping *mapping); -extern void -bt_field_class_unsigned_enumeration_mapping_get_range_by_index( - const bt_field_class_unsigned_enumeration_mapping *mapping, - uint64_t index, uint64_t *lower, uint64_t *upper); +extern const bt_integer_range_set_signed * +bt_field_class_enumeration_signed_mapping_borrow_ranges_const( + const bt_field_class_enumeration_signed_mapping *mapping); -extern void -bt_field_class_signed_enumeration_mapping_get_range_by_index( - const bt_field_class_signed_enumeration_mapping *mapping, - uint64_t index, int64_t *lower, int64_t *upper); +typedef enum bt_field_class_enumeration_get_mapping_labels_for_value_status { + BT_FIELD_CLASS_ENUMERATION_GET_MAPPING_LABELS_BY_VALUE_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, + BT_FIELD_CLASS_ENUMERATION_GET_MAPPING_LABELS_BY_VALUE_STATUS_OK = __BT_FUNC_STATUS_OK, +} bt_field_class_enumeration_get_mapping_labels_for_value_status; -extern bt_field_class_status -bt_field_class_unsigned_enumeration_get_mapping_labels_by_value( +extern bt_field_class_enumeration_get_mapping_labels_for_value_status +bt_field_class_enumeration_unsigned_get_mapping_labels_for_value( const bt_field_class *field_class, uint64_t value, bt_field_class_enumeration_mapping_label_array *label_array, uint64_t *count); -extern bt_field_class_status -bt_field_class_signed_enumeration_get_mapping_labels_by_value( +extern bt_field_class_enumeration_get_mapping_labels_for_value_status +bt_field_class_enumeration_signed_get_mapping_labels_for_value( const bt_field_class *field_class, int64_t value, bt_field_class_enumeration_mapping_label_array *label_array, uint64_t *count); @@ -154,19 +161,26 @@ extern const bt_field_class * bt_field_class_structure_member_borrow_field_class_const( const bt_field_class_structure_member *member); +extern const bt_value *bt_field_class_structure_member_borrow_user_attributes_const( + const bt_field_class_structure_member *member); + extern const bt_field_class * bt_field_class_array_borrow_element_field_class_const( const bt_field_class *field_class); -extern uint64_t bt_field_class_static_array_get_length( +extern uint64_t bt_field_class_array_static_get_length( const bt_field_class *field_class); extern const bt_field_path * -bt_field_class_dynamic_array_borrow_length_field_path_const( +bt_field_class_array_dynamic_borrow_length_field_path_const( + const bt_field_class *field_class); + +extern const bt_field_class * +bt_field_class_option_borrow_field_class_const( const bt_field_class *field_class); extern const bt_field_path * -bt_field_class_variant_borrow_selector_field_path_const( +bt_field_class_option_borrow_selector_field_path_const( const bt_field_class *field_class); extern uint64_t bt_field_class_variant_get_option_count( @@ -180,6 +194,22 @@ extern const bt_field_class_variant_option * bt_field_class_variant_borrow_option_by_name_const( const bt_field_class *field_class, const char *name); +extern const bt_field_class_variant_with_selector_unsigned_option * +bt_field_class_variant_with_selector_unsigned_borrow_option_by_index_const( + const bt_field_class *field_class, uint64_t index); + +extern const bt_field_class_variant_with_selector_unsigned_option * +bt_field_class_variant_with_selector_unsigned_borrow_option_by_name_const( + const bt_field_class *field_class, const char *name); + +extern const bt_field_class_variant_with_selector_signed_option * +bt_field_class_variant_with_selector_signed_borrow_option_by_index_const( + const bt_field_class *field_class, uint64_t index); + +extern const bt_field_class_variant_with_selector_signed_option * +bt_field_class_variant_with_selector_signed_borrow_option_by_name_const( + const bt_field_class *field_class, const char *name); + extern const char *bt_field_class_variant_option_get_name( const bt_field_class_variant_option *option); @@ -187,6 +217,37 @@ extern const bt_field_class * bt_field_class_variant_option_borrow_field_class_const( const bt_field_class_variant_option *option); +extern const bt_value *bt_field_class_variant_option_borrow_user_attributes_const( + const bt_field_class_variant_option *option); + +extern const bt_field_path * +bt_field_class_variant_with_selector_borrow_selector_field_path_const( + const bt_field_class *field_class); + +extern const bt_integer_range_set_unsigned * +bt_field_class_variant_with_selector_unsigned_option_borrow_ranges_const( + const bt_field_class_variant_with_selector_unsigned_option *option); + +static inline +const bt_field_class_variant_option * +bt_field_class_variant_with_selector_unsigned_option_as_option_const( + const bt_field_class_variant_with_selector_unsigned_option *option) +{ + return __BT_UPCAST_CONST(bt_field_class_variant_option, option); +} + +extern const bt_integer_range_set_signed * +bt_field_class_variant_with_selector_signed_option_borrow_ranges_const( + const bt_field_class_variant_with_selector_signed_option *option); + +static inline +const bt_field_class_variant_option * +bt_field_class_variant_with_selector_signed_option_as_option_const( + const bt_field_class_variant_with_selector_signed_option *option) +{ + return __BT_UPCAST_CONST(bt_field_class_variant_option, option); +} + extern void bt_field_class_get_ref(const bt_field_class *field_class); extern void bt_field_class_put_ref(const bt_field_class *field_class); @@ -209,4 +270,4 @@ extern void bt_field_class_put_ref(const bt_field_class *field_class); } #endif -#endif /* BABELTRACE_TRACE_IR_FIELD_CLASSES_CONST_H */ +#endif /* BABELTRACE2_TRACE_IR_FIELD_CLASS_CONST_H */