X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Flib%2Ftrace-ir%2Ffield-class.h;h=1cd14e39aa247d1c023b4fa75d0863bc85be224d;hb=d98421f2abfc5adab28ab7ee9b63537a6c7261cc;hp=3fe793249216a922c24205b711f38276e36aa236;hpb=81b8fa4490092c27f40470f1f50a925f768b7b83;p=babeltrace.git diff --git a/src/lib/trace-ir/field-class.h b/src/lib/trace-ir/field-class.h index 3fe79324..1cd14e39 100644 --- a/src/lib/trace-ir/field-class.h +++ b/src/lib/trace-ir/field-class.h @@ -1,36 +1,21 @@ -#ifndef BABELTRACE_TRACE_IR_FIELD_CLASSES_INTERNAL_H -#define BABELTRACE_TRACE_IR_FIELD_CLASSES_INTERNAL_H - /* + * SPDX-License-Identifier: MIT + * * Copyright 2017-2018 Philippe Proulx * Copyright 2013, 2014 Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * 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. */ -#include "lib/assert-pre.h" +#ifndef BABELTRACE_TRACE_IR_FIELD_CLASSES_INTERNAL_H +#define BABELTRACE_TRACE_IR_FIELD_CLASSES_INTERNAL_H + +#include "lib/assert-cond.h" #include #include #include "common/macros.h" #include "common/common.h" #include "lib/object.h" #include +#include #include #include @@ -74,40 +59,40 @@ _name " is not an array field class: %![fc-]+F" #define _BT_ASSERT_PRE_FC_IS_OPTION_COND(_fc) \ - (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR || \ - ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR || \ - ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR || \ - ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR) + (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR_FIELD || \ + ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD || \ + ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD || \ + ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR_FIELD) #define _BT_ASSERT_PRE_FC_IS_OPTION_FMT(_name) \ _name " is not an option field class: %![fc-]+F" #define _BT_ASSERT_PRE_FC_IS_OPTION_WITH_SEL_COND(_fc) \ - (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR || \ - ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR || \ - ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR) + (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD || \ + ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD || \ + ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR_FIELD) #define _BT_ASSERT_PRE_FC_IS_OPTION_WITH_SEL_FMT(_name) \ _name " is not an option field class with a selector: %![fc-]+F" #define _BT_ASSERT_PRE_FC_IS_OPTION_WITH_INT_SEL_COND(_fc) \ - (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR || \ - ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR) + (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD || \ + ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR_FIELD) #define _BT_ASSERT_PRE_FC_IS_OPTION_WITH_INT_SEL_FMT(_name) \ _name " is not an option field class with an integer selector: %![fc-]+F" #define _BT_ASSERT_PRE_FC_IS_VARIANT_COND(_fc) \ - (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR || \ - ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR || \ - ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR) + (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR_FIELD || \ + ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD || \ + ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD) #define _BT_ASSERT_PRE_FC_IS_VARIANT_FMT(_name) \ _name " is not a variant field class: %![fc-]+F" #define _BT_ASSERT_PRE_FC_IS_VARIANT_WITH_SEL_COND(_fc) \ - (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR || \ - ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR) + (((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD || \ + ((const struct bt_field_class *) (_fc))->type == BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD) #define _BT_ASSERT_PRE_FC_IS_VARIANT_WITH_SEL_FMT(_name) \ _name " is not a variant field class with a selector: %![fc-]+F" @@ -314,8 +299,8 @@ struct bt_named_field_class { struct bt_field_class_structure_member; struct bt_field_class_variant_option; -struct bt_field_class_variant_with_selector_integer_unsigned_option; -struct bt_field_class_variant_with_selector_integer_signed_option; +struct bt_field_class_variant_with_selector_field_integer_unsigned_option; +struct bt_field_class_variant_with_selector_field_integer_signed_option; struct bt_field_class_named_field_class_container { struct bt_field_class common; @@ -363,7 +348,7 @@ struct bt_field_class_option { struct bt_field_class *content_fc; }; -struct bt_field_class_option_with_selector { +struct bt_field_class_option_with_selector_field { struct bt_field_class_option common; /* Owned by this */ @@ -373,22 +358,22 @@ struct bt_field_class_option_with_selector { struct bt_field_path *selector_field_path; }; -struct bt_field_class_option_with_selector_bool { - struct bt_field_class_option_with_selector common; +struct bt_field_class_option_with_selector_field_bool { + struct bt_field_class_option_with_selector_field common; /* Owned by this */ bool sel_is_reversed; }; -struct bt_field_class_option_with_selector_integer { - struct bt_field_class_option_with_selector common; +struct bt_field_class_option_with_selector_field_integer { + struct bt_field_class_option_with_selector_field common; /* Owned by this */ const struct bt_integer_range_set *range_set; }; /* Variant FC (with selector) option: named field class + range set */ -struct bt_field_class_variant_with_selector_option { +struct bt_field_class_variant_with_selector_field_option { struct bt_named_field_class common; /* Owned by this */ @@ -401,13 +386,13 @@ struct bt_field_class_variant { * named field classes are of type * `struct bt_named_field_class *` if the variant field class * doesn't have a selector, or - * `struct bt_field_class_variant_with_selector_option *` + * `struct bt_field_class_variant_with_selector_field_option *` * if it has. */ struct bt_field_class_named_field_class_container common; }; -struct bt_field_class_variant_with_selector { +struct bt_field_class_variant_with_selector_field { struct bt_field_class_variant common; /*