doc/api/libbabeltrace2/DoxygenLayout.xml: use `topics` tab
[babeltrace.git] / src / ctf-writer / fields.h
index bab2e581697e8c9031de0fcdb3900d8d720b00b9..3c13c3efa215636229cd7f35a83e05134f0fb4e2 100644 (file)
@@ -1,33 +1,15 @@
-#ifndef BABELTRACE_CTF_WRITER_FIELDS_INTERNAL_H
-#define BABELTRACE_CTF_WRITER_FIELDS_INTERNAL_H
-
 /*
- * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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.
+ * SPDX-License-Identifier: MIT
  *
- * 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.
+ * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
  * The Common Trace Format (CTF) Specification is available at
  * http://www.efficios.com/ctf
  */
 
+#ifndef BABELTRACE_CTF_WRITER_FIELDS_INTERNAL_H
+#define BABELTRACE_CTF_WRITER_FIELDS_INTERNAL_H
+
 #include <glib.h>
 #include <inttypes.h>
 #include <stdbool.h>
@@ -36,7 +18,6 @@
 #include <string.h>
 
 #include <babeltrace2-ctf-writer/fields.h>
-#include <babeltrace2/types.h>
 
 #include "common/macros.h"
 #include "common/common.h"
@@ -160,10 +141,8 @@ struct bt_ctf_field_common_string {
        size_t size;
 };
 
-BT_HIDDEN
 struct bt_ctf_field_common *bt_ctf_field_common_copy(struct bt_ctf_field_common *field);
 
-BT_HIDDEN
 int bt_ctf_field_common_structure_initialize(struct bt_ctf_field_common *field,
                struct bt_ctf_field_type_common *type,
                bool is_shared, bt_ctf_object_release_func release_func,
@@ -171,7 +150,6 @@ int bt_ctf_field_common_structure_initialize(struct bt_ctf_field_common *field,
                bt_ctf_field_common_create_func field_create_func,
                GDestroyNotify field_release_func);
 
-BT_HIDDEN
 int bt_ctf_field_common_array_initialize(struct bt_ctf_field_common *field,
                struct bt_ctf_field_type_common *type,
                bool is_shared, bt_ctf_object_release_func release_func,
@@ -179,14 +157,12 @@ int bt_ctf_field_common_array_initialize(struct bt_ctf_field_common *field,
                bt_ctf_field_common_create_func field_create_func,
                GDestroyNotify field_destroy_func);
 
-BT_HIDDEN
 int bt_ctf_field_common_sequence_initialize(struct bt_ctf_field_common *field,
                struct bt_ctf_field_type_common *type,
                bool is_shared, bt_ctf_object_release_func release_func,
                struct bt_ctf_field_common_methods *methods,
                GDestroyNotify field_destroy_func);
 
-BT_HIDDEN
 int bt_ctf_field_common_variant_initialize(struct bt_ctf_field_common *field,
                struct bt_ctf_field_type_common *type,
                bool is_shared, bt_ctf_object_release_func release_func,
@@ -194,80 +170,58 @@ int bt_ctf_field_common_variant_initialize(struct bt_ctf_field_common *field,
                bt_ctf_field_common_create_func field_create_func,
                GDestroyNotify field_release_func);
 
-BT_HIDDEN
 int bt_ctf_field_common_string_initialize(struct bt_ctf_field_common *field,
                struct bt_ctf_field_type_common *type,
                bool is_shared, bt_ctf_object_release_func release_func,
                struct bt_ctf_field_common_methods *methods);
 
-BT_HIDDEN
 int bt_ctf_field_common_generic_validate(struct bt_ctf_field_common *field);
 
-BT_HIDDEN
 int bt_ctf_field_common_structure_validate_recursive(struct bt_ctf_field_common *field);
 
-BT_HIDDEN
 int bt_ctf_field_common_variant_validate_recursive(struct bt_ctf_field_common *field);
 
-BT_HIDDEN
 int bt_ctf_field_common_array_validate_recursive(struct bt_ctf_field_common *field);
 
-BT_HIDDEN
 int bt_ctf_field_common_sequence_validate_recursive(struct bt_ctf_field_common *field);
 
-BT_HIDDEN
 void bt_ctf_field_common_generic_reset(struct bt_ctf_field_common *field);
 
-BT_HIDDEN
 void bt_ctf_field_common_structure_reset_recursive(struct bt_ctf_field_common *field);
 
-BT_HIDDEN
 void bt_ctf_field_common_variant_reset_recursive(struct bt_ctf_field_common *field);
 
-BT_HIDDEN
 void bt_ctf_field_common_array_reset_recursive(struct bt_ctf_field_common *field);
 
-BT_HIDDEN
 void bt_ctf_field_common_sequence_reset_recursive(struct bt_ctf_field_common *field);
 
-BT_HIDDEN
 void bt_ctf_field_common_generic_set_is_frozen(struct bt_ctf_field_common *field,
                bool is_frozen);
 
-BT_HIDDEN
 void bt_ctf_field_common_structure_set_is_frozen_recursive(
                struct bt_ctf_field_common *field, bool is_frozen);
 
-BT_HIDDEN
 void bt_ctf_field_common_variant_set_is_frozen_recursive(
                struct bt_ctf_field_common *field, bool is_frozen);
 
-BT_HIDDEN
 void bt_ctf_field_common_array_set_is_frozen_recursive(
                struct bt_ctf_field_common *field, bool is_frozen);
 
-BT_HIDDEN
 void bt_ctf_field_common_sequence_set_is_frozen_recursive(
                struct bt_ctf_field_common *field, bool is_frozen);
 
-BT_HIDDEN
 void _bt_ctf_field_common_set_is_frozen_recursive(struct bt_ctf_field_common *field,
                bool is_frozen);
 
-BT_HIDDEN
 bt_ctf_bool bt_ctf_field_common_generic_is_set(struct bt_ctf_field_common *field);
 
-BT_HIDDEN
 bt_ctf_bool bt_ctf_field_common_structure_is_set_recursive(
                struct bt_ctf_field_common *field);
 
-BT_HIDDEN
 bt_ctf_bool bt_ctf_field_common_variant_is_set_recursive(struct bt_ctf_field_common *field);
 
-BT_HIDDEN
 bt_ctf_bool bt_ctf_field_common_array_is_set_recursive(struct bt_ctf_field_common *field);
 
-BT_HIDDEN
 bt_ctf_bool bt_ctf_field_common_sequence_is_set_recursive(struct bt_ctf_field_common *field);
 
 #ifdef BT_DEV_MODE
@@ -288,7 +242,7 @@ BT_ASSERT_DBG_FUNC
 static inline bool field_type_common_has_known_id(
                struct bt_ctf_field_type_common *ft)
 {
-       return (int) ft->id > BT_CTF_FIELD_TYPE_ID_UNKNOWN ||
+       return (int) ft->id > BT_CTF_FIELD_TYPE_ID_UNKNOWN &&
                (int) ft->id < BT_CTF_FIELD_TYPE_ID_NR;
 }
 
@@ -830,21 +784,25 @@ struct bt_ctf_field_variant {
        struct bt_ctf_field_enumeration *tag;
 };
 
-BT_HIDDEN
 int bt_ctf_field_serialize_recursive(struct bt_ctf_field *field,
                struct bt_ctfser *ctfser,
                enum bt_ctf_byte_order native_byte_order);
 
-BT_HIDDEN
 int bt_ctf_field_structure_set_field_by_name(struct bt_ctf_field *field,
                const char *name, struct bt_ctf_field *value);
 
-BT_HIDDEN
 struct bt_ctf_field *bt_ctf_field_enumeration_borrow_container(
                struct bt_ctf_field *field);
 
+#ifndef BT_DEV_MODE
+#define BT_FIELD_UNUSED_ATTR __attribute__((unused))
+#else
+#define BT_FIELD_UNUSED_ATTR
+#endif
+
 static inline
-bt_ctf_bool bt_ctf_field_is_set_recursive(struct bt_ctf_field *field)
+bt_ctf_bool bt_ctf_field_is_set_recursive(
+               struct bt_ctf_field *field BT_FIELD_UNUSED_ATTR)
 {
        return bt_ctf_field_common_is_set_recursive((void *) field);
 }
This page took 0.024743 seconds and 4 git commands to generate.