String type: complete migration to bitwise position
[babeltrace.git] / include / babeltrace / format.h
CommitLineData
fc93b2bd
MD
1#ifndef _BABELTRACE_FORMAT_H
2#define _BABELTRACE_FORMAT_H
3
4/*
5 * BabelTrace
6 *
7 * Trace Format Header
8 *
9 * Copyright (c) 2010 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 *
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.
15 *
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.
20 *
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
24 */
25
26#include <stdint.h>
27#include <glib.h>
28
29struct format {
30 GQuark name;
31
bed864a7
MD
32 uint64_t (*uint_read)(struct stream_pos *pos,
33 const struct type_class_integer *int_class);
34 int64_t (*int_read)(struct stream_pos *pos,
35 const struct type_class_integer *int_class);
36 void (*uint_write)(struct stream_pos *pos,
37 const struct type_class_integer *int_class,
38 uint64_t v);
39 void (*int_write)(struct stream_pos *pos,
40 const struct type_class_integer *int_class,
41 int64_t v);
fc93b2bd 42
bed864a7
MD
43 uint64_t (*bitfield_unsigned_read)(struct stream_pos *pos,
44 const struct type_class_bitfield *bitfield_class);
45 int64_t (*bitfield_signed_read)(struct stream_pos *pos,
46 const struct type_class_bitfield *bitfield_class);
47 void (*bitfield_unsigned_write)(struct stream_pos *pos,
48 const struct type_class_bitfield *bitfield_class,
49 uint64_t v);
50 void (*bitfield_signed_write)(struct stream_pos *pos,
51 const struct type_class_bitfield *bitfield_class,
52 int64_t v);
0a46062b 53
bed864a7 54 void (*float_copy)(struct stream_pos *destp,
448d3cc7 55 const struct type_class_float *dest,
bed864a7
MD
56 struct stream_pos *srcp,
57 const struct type_class_float *src);
58 double (*double_read)(struct stream_pos *pos,
448d3cc7 59 const struct type_class_float *src);
bed864a7
MD
60 void (*double_write)(struct stream_pos *pos,
61 const struct type_class_float *dest,
62 double v);
fc93b2bd 63
bed864a7
MD
64 void (*string_copy)(struct stream_pos *dest, struct stream_pos *src,
65 const struct type_class_string *string_class);
a52d7f6a
MD
66 void (*string_read)(unsigned char **dest, struct stream_pos *src,
67 const struct type_class_string *string_class);
68 void (*string_write)(struct stream_pos *dest, const unsigned char *src,
69 const struct type_class_string *string_class);
70 void (*string_free_temp)(unsigned char *string);
fc93b2bd 71
bed864a7 72 GQuark (*enum_read)(struct stream_pos *pos,
448d3cc7 73 const struct type_class_enum *src);
bed864a7
MD
74 void (*enum_write)(struct stream_pos *pos,
75 const struct type_class_enum *dest,
76 GQuark q);
448d3cc7 77
fc93b2bd
MD
78};
79
80struct format *bt_lookup_format(GQuark qname);
81int bt_register_format(const struct format *format);
82
83/* TBD: format unregistration */
84
85#endif /* _BABELTRACE_FORMAT_H */
This page took 0.025798 seconds and 4 git commands to generate.