1 #ifndef _BABELTRACE_TYPES_H
2 #define _BABELTRACE_TYPES_H
9 * Copyright (c) 2010 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 #include <babeltrace/format.h>
29 GQuark name
; /* type name */
30 size_t alignment
; /* type alignment, in bits */
32 * Type copy function. Knows how to find the child type_class from the
35 size_t (*copy
)(unsigned char *dest
, const struct format
*fdest
,
36 const unsigned char *src
, const struct format
*fsrc
,
37 const struct type_class
*type_class
);
40 struct type_class_integer
{
42 size_t len
; /* length, in bits. */
43 int byte_order
; /* byte order */
47 struct type_class_bitfield
{
48 struct type_class_integer p
;
49 size_t start_offset
; /* offset from base address, in bits */
52 struct type_class_float
{
57 /* TODO: we might want to express more info about NaN, +inf and -inf */
60 struct type_class_enum
{
61 struct type_class_bitfield
; /* inherit from bitfield */
62 struct enum_table
*table
;
65 struct type_class_struct
{
70 struct type_class
*ctf_lookup_type(GQuark qname
);
71 int ctf_register_type(struct type_class
*type_class
);
73 /* Nameless types can be created by passing a NULL name */
75 struct type_class_integer
*integer_type_new(const char *name
,
77 size_t len
, int byte_order
,
79 void integer_type_free(struct type_class_integer
*int_class
);
81 struct type_class_bitfield
*bitfield_type_new(const char *name
,
83 size_t len
, int byte_order
,
85 void bitfield_type_free(struct type_class_bitfield
*bitfield_class
);
87 struct type_class_float
*float_type_new(const char *name
,
89 size_t exp_len
, int byte_order
,
91 void float_type_free(struct type_class_float
*float_class
);
93 #endif /* _BABELTRACE_TYPES_H */
This page took 0.030522 seconds and 4 git commands to generate.