X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace2%2Ftrace-ir%2Ffield-const.h;h=f3f1ef8d77698f2b2a5d90f2146373cc2a84ae22;hb=5cebbe7fc898bb1d887cbdac1f4dd5f0042443fd;hp=7c5b46d05ab56037f4a452bab285e7cf21a2851d;hpb=3fadfbc0c91f82c46bd36e6e0657ea93570c9db1;p=babeltrace.git diff --git a/include/babeltrace2/trace-ir/field-const.h b/include/babeltrace2/trace-ir/field-const.h index 7c5b46d0..f3f1ef8d 100644 --- a/include/babeltrace2/trace-ir/field-const.h +++ b/include/babeltrace2/trace-ir/field-const.h @@ -1,9 +1,8 @@ -#ifndef BABELTRACE_TRACE_IR_FIELDS_CONST_H -#define BABELTRACE_TRACE_IR_FIELDS_CONST_H +#ifndef BABELTRACE2_TRACE_IR_FIELD_CONST_H +#define BABELTRACE2_TRACE_IR_FIELD_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,48 +21,48 @@ * 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 */ +#ifndef __BT_IN_BABELTRACE_H +# error "Please include instead." +#endif + #include -/* For bt_field_class_type */ #include - -/* For bt_field, bt_field_class */ #include #ifdef __cplusplus extern "C" { #endif -typedef enum bt_field_status { - BT_FIELD_STATUS_OK = 0, - BT_FIELD_STATUS_NOMEM = -12, -} bt_field_status; - extern const bt_field_class *bt_field_borrow_class_const( const bt_field *field); extern bt_field_class_type bt_field_get_class_type( const bt_field *field); -extern int64_t bt_field_signed_integer_get_value(const bt_field *field); +extern bt_bool bt_field_bool_get_value(const bt_field *field); + +extern int64_t bt_field_integer_signed_get_value(const bt_field *field); -extern uint64_t bt_field_unsigned_integer_get_value( +extern uint64_t bt_field_integer_unsigned_get_value( const bt_field *field); extern double bt_field_real_get_value(const bt_field *field); -extern bt_field_status bt_field_unsigned_enumeration_get_mapping_labels( - const bt_field *field, +typedef enum bt_field_enumeration_get_mapping_labels_status { + BT_FIELD_ENUMERATION_GET_MAPPING_LABELS_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, + BT_FIELD_ENUMERATION_GET_MAPPING_LABELS_STATUS_OK = __BT_FUNC_STATUS_OK, +} bt_field_enumeration_get_mapping_labels_status; + +extern 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 *label_array, uint64_t *count); -extern bt_field_status bt_field_signed_enumeration_get_mapping_labels( - const bt_field *field, +extern 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 *label_array, uint64_t *count); @@ -92,8 +91,20 @@ extern const bt_field * bt_field_variant_borrow_selected_option_field_const( const bt_field *field); +extern const bt_field_class_variant_option * +bt_field_variant_borrow_selected_class_option_const( + const bt_field *field); + +extern const bt_field_class_variant_with_selector_unsigned_option * +bt_field_variant_with_unsigned_selector_borrow_selected_class_option_const( + const bt_field *field); + +extern const bt_field_class_variant_with_selector_signed_option * +bt_field_variant_with_signed_selector_borrow_selected_class_option_const( + const bt_field *field); + #ifdef __cplusplus } #endif -#endif /* BABELTRACE_TRACE_IR_FIELDS_CONST_H */ +#endif /* BABELTRACE2_TRACE_IR_FIELD_CONST_H */