X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=include%2Fbabeltrace%2Ftypes.h;h=f8c3c8aa1de80d2a362392c9aa964387432b9ecf;hp=23fec0fcfcba89c48fd2715b30b55e0daa389b7a;hb=fc93b2bdc2ced1d46fefb91fe79391afded8e504;hpb=a3dbc7949a29a2abe9c7e75f2d893f99d36d6256 diff --git a/include/babeltrace/types.h b/include/babeltrace/types.h index 23fec0fc..f8c3c8aa 100644 --- a/include/babeltrace/types.h +++ b/include/babeltrace/types.h @@ -4,7 +4,7 @@ /* * BabelTrace * - * Type header + * Type Header * * Copyright (c) 2010 Mathieu Desnoyers * @@ -23,4 +23,47 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + +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; +}; + +struct type_class_enum { + struct type_class_bitfield; /* inherit from bitfield */ + struct enum_table *table; +}; + +struct type_class_struct { + struct type_class p; + /* TODO */ +}; + #endif /* _BABELTRACE_TYPES_H */