lib: field path: have a specific item for "current array element"
[babeltrace.git] / include / babeltrace / types.h
index b77ac4002017dbb3a7ed0c50fa00b374fbfe23f2..72fcb9e858c44c8710fa5add66373b2ee3dcd695 100644 (file)
-#ifndef _BABELTRACE_TYPES_H
-#define _BABELTRACE_TYPES_H
+#ifndef BABELTRACE_TYPES_H
+#define BABELTRACE_TYPES_H
 
 /*
- * BabelTrace
+ * Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com>
  *
- * Type Header
+ * 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:
  *
- * Copyright (c) 2010 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * 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 <babeltrace/format.h>
-
-struct type_class {
-       GQuark name;            /* type name */
-       size_t alignment;       /* type alignment, in bits */
-       /*
-        * Type copy function. Knows how to find the child type_class from the
-        * parent type_class.
-        */
-       size_t (*copy)(unsigned char *dest, const struct format *fdest, 
-                      const unsigned char *src, const struct format *fsrc,
-                      const struct type_class *type_class);
-};
-
-struct type_class_integer {
-       struct type_class p;
-       size_t len;             /* length, in bits. */
-       int byte_order;         /* byte order */
-       int signedness;
-};
-
-struct type_class_bitfield {
-       struct type_class_integer p;
-       size_t start_offset;    /* offset from base address, in bits */
-};
-
-struct type_class_float {
-       struct type_class p;
-       size_t mantissa_len;
-       size_t exp_len;
-       int byte_order;
-       /* TODO: we might want to express more info about NaN, +inf and -inf */
-};
-
-struct type_class_enum {
-       struct type_class_bitfield;     /* inherit from bitfield */
-       struct enum_table *table;
-};
-
-struct type_class_struct {
-       struct type_class p;
-       /* TODO */
-};
-
-struct type_class *ctf_lookup_type(GQuark qname);
-int ctf_register_type(struct type_class *type_class);
-
-/* Nameless types can be created by passing a NULL name */
-
-struct type_class_integer *integer_type_new(const char *name,
-                                           size_t start_offset,
-                                           size_t len, int byte_order,
-                                           int signedness);
-void integer_type_free(struct type_class_integer *int_class);
-
-struct type_class_bitfield *bitfield_type_new(const char *name,
-                                             size_t start_offset,
-                                             size_t len, int byte_order,
-                                             int signedness);
-void bitfield_type_free(struct type_class_bitfield *bitfield_class);
-
-struct type_class_float *float_type_new(const char *name,
-                                       size_t mantissa_len,
-                                       size_t exp_len, int byte_order,
-                                       size_t alignment);
-void float_type_free(struct type_class_float *float_class);
-
-#endif /* _BABELTRACE_TYPES_H */
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+@defgroup ctypes Babeltrace C types
+@ingroup apiref
+@brief Babeltrace C types.
+
+@code
+#include <babeltrace/types.h>
+@endcode
+
+This header contains custom type definitions used across the library.
+
+@file
+@brief Babeltrace C types.
+@sa ctypes
+
+@addtogroup ctypes
+@{
+*/
+
+/// False boolean value for the #bt_bool type.
+#define BT_FALSE       0
+
+/// True boolean value for the #bt_bool type.
+#define BT_TRUE                1
+
+/**
+@brief Babeltrace's boolean type.
+
+Use only the #BT_FALSE and #BT_TRUE definitions for #bt_bool parameters.
+It is guaranteed that the library functions which return a #bt_bool
+value return either #BT_FALSE or #BT_TRUE.
+
+You can always test the truthness of a #bt_bool value directly, without
+comparing it to #BT_TRUE directly:
+
+@code
+bt_bool ret = bt_some_function(...);
+
+if (ret) {
+       // ret is true
+}
+@endcode
+*/
+typedef int bt_bool;
+
+typedef const uint8_t *bt_uuid;
+
+typedef struct bt_clock_class bt_clock_class;
+typedef struct bt_clock_snapshot bt_clock_snapshot;
+typedef struct bt_component bt_component;
+typedef struct bt_component_class bt_component_class;
+typedef struct bt_component_class_filter bt_component_class_filter;
+typedef struct bt_component_class_sink bt_component_class_sink;
+typedef struct bt_component_class_source bt_component_class_source;
+typedef struct bt_component_filter bt_component_filter;
+typedef struct bt_component_sink bt_component_sink;
+typedef struct bt_component_source bt_component_source;
+typedef struct bt_connection bt_connection;
+typedef struct bt_event bt_event;
+typedef struct bt_event_class bt_event_class;
+typedef struct bt_event_header_field bt_event_header_field;
+typedef struct bt_field bt_field;
+typedef struct bt_field_class bt_field_class;
+typedef struct bt_field_class_signed_enumeration_mapping_ranges bt_field_class_signed_enumeration_mapping_ranges;
+typedef struct bt_field_class_unsigned_enumeration_mapping_ranges bt_field_class_unsigned_enumeration_mapping_ranges;
+typedef struct bt_field_class_structure_member bt_field_class_structure_member;
+typedef struct bt_field_class_variant_option bt_field_class_variant_option;
+typedef struct bt_field_path bt_field_path;
+typedef struct bt_field_path_item bt_field_path_item;
+typedef struct bt_graph bt_graph;
+typedef struct bt_message bt_message;
+typedef struct bt_message_iterator bt_message_iterator;
+typedef struct bt_object bt_object;
+typedef struct bt_packet bt_packet;
+typedef struct bt_packet_context_field bt_packet_context_field;
+typedef struct bt_packet_header_field bt_packet_header_field;
+typedef struct bt_plugin bt_plugin;
+typedef struct bt_plugin_set bt_plugin_set;
+typedef struct bt_plugin_so_shared_lib_handle bt_plugin_so_shared_lib_handle;
+typedef struct bt_port bt_port;
+typedef struct bt_port_input bt_port_input;
+typedef struct bt_port_output bt_port_output;
+typedef struct bt_port_output_message_iterator bt_port_output_message_iterator;
+typedef struct bt_query_executor bt_query_executor;
+typedef struct bt_self_component bt_self_component;
+typedef struct bt_self_component_class_filter bt_self_component_class_filter;
+typedef struct bt_self_component_class_sink bt_self_component_class_sink;
+typedef struct bt_self_component_class_source bt_self_component_class_source;
+typedef struct bt_self_component_filter bt_self_component_filter;
+typedef struct bt_self_component_port bt_self_component_port;
+typedef struct bt_self_component_port_input bt_self_component_port_input;
+typedef struct bt_self_component_port_input_message_iterator bt_self_component_port_input_message_iterator;
+typedef struct bt_self_component_port_output bt_self_component_port_output;
+typedef struct bt_self_component_sink bt_self_component_sink;
+typedef struct bt_self_component_source bt_self_component_source;
+typedef struct bt_self_message_iterator bt_self_message_iterator;
+typedef struct bt_self_port bt_self_port;
+typedef struct bt_self_port_input bt_self_port_input;
+typedef struct bt_self_port_output bt_self_port_output;
+typedef struct bt_stream bt_stream;
+typedef struct bt_stream_class bt_stream_class;
+typedef struct bt_trace bt_trace;
+typedef struct bt_trace_class bt_trace_class;
+typedef struct bt_value bt_value;
+
+typedef const char * const *bt_field_class_enumeration_mapping_label_array;
+typedef const struct bt_message **bt_message_array_const;
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_TYPES_H */
This page took 0.028678 seconds and 4 git commands to generate.