CTF trace open/close
[babeltrace.git] / include / babeltrace / ctf / types.h
CommitLineData
d79865b9
MD
1#ifndef _BABELTRACE_CTF_TYPES_H
2#define _BABELTRACE_CTF_TYPES_H
6dc2ca62
MD
3
4/*
5 * Common Trace Format
6 *
7 * Type header
8 *
ccd7e1c8 9 * Copyright 2010 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6dc2ca62 10 *
ccd7e1c8
MD
11 * Permission is hereby granted, free of charge, to any person obtaining a copy
12 * of this software and associated documentation files (the "Software"), to deal
13 * in the Software without restriction, including without limitation the rights
14 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 * copies of the Software, and to permit persons to whom the Software is
16 * furnished to do so, subject to the following conditions:
de0ba614 17 *
ccd7e1c8
MD
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
6dc2ca62
MD
20 */
21
4c8bfb7e 22#include <babeltrace/types.h>
6dc2ca62
MD
23#include <stdint.h>
24#include <glib.h>
25
26/*
de0ba614
MD
27 * IMPORTANT: All lengths (len) and offsets (start, end) are expressed in bits,
28 * *not* in bytes.
29 *
30 * All write primitives, as well as read for dynamically sized entities, can
6dc2ca62
MD
31 * receive a NULL ptr/dest parameter. In this case, no write is performed, but
32 * the size is returned.
33 */
34
bed864a7 35uint64_t ctf_uint_read(struct stream_pos *pos,
f6625916 36 const struct declaration_integer *integer_declaration);
bed864a7 37int64_t ctf_int_read(struct stream_pos *pos,
f6625916 38 const struct declaration_integer *integer_declaration);
bed864a7 39void ctf_uint_write(struct stream_pos *pos,
f6625916 40 const struct declaration_integer *integer_declaration,
bed864a7
MD
41 uint64_t v);
42void ctf_int_write(struct stream_pos *pos,
f6625916 43 const struct declaration_integer *integer_declaration,
bed864a7 44 int64_t v);
6dc2ca62 45
bed864a7 46double ctf_double_read(struct stream_pos *pos,
f6625916 47 const struct declaration_float *src);
bed864a7 48void ctf_double_write(struct stream_pos *pos,
f6625916 49 const struct declaration_float *dest,
bed864a7
MD
50 double v);
51long double ctf_ldouble_read(struct stream_pos *pos,
f6625916 52 const struct declaration_float *src);
bed864a7 53void ctf_ldouble_write(struct stream_pos *pos,
f6625916 54 const struct declaration_float *dest,
bed864a7 55 long double v);
4c8bfb7e
MD
56void ctf_float_copy(struct stream_pos *destp,
57 struct stream_pos *srcp,
f6625916 58 const struct declaration_float *float_declaration);
6dc2ca62 59
bed864a7 60void ctf_string_copy(struct stream_pos *dest, struct stream_pos *src,
f6625916 61 const struct declaration_string *string_declaration);
47e0f2e2 62void ctf_string_read(char **dest, struct stream_pos *src,
f6625916 63 const struct declaration_string *string_declaration);
47e0f2e2 64void ctf_string_write(struct stream_pos *dest, const char *src,
f6625916 65 const struct declaration_string *string_declaration);
47e0f2e2 66void ctf_string_free_temp(char *string);
6dc2ca62 67
47e0f2e2 68GArray *ctf_enum_read(struct stream_pos *pos,
f6625916 69 const struct declaration_enum *src);
bed864a7 70void ctf_enum_write(struct stream_pos *pos,
f6625916 71 const struct declaration_enum *dest,
bed864a7 72 GQuark q);
11796b96 73void ctf_struct_begin(struct stream_pos *pos,
f6625916 74 const struct declaration_struct *struct_declaration);
11796b96 75void ctf_struct_end(struct stream_pos *pos,
f6625916 76 const struct declaration_struct *struct_declaration);
6b71274a 77void ctf_variant_begin(struct stream_pos *pos,
f6625916 78 const struct declaration_variant *variant_declaration);
6b71274a 79void ctf_variant_end(struct stream_pos *pos,
f6625916 80 const struct declaration_variant *variant_declaration);
d06d03db 81void ctf_array_begin(struct stream_pos *pos,
f6625916 82 const struct declaration_array *array_declaration);
d06d03db 83void ctf_array_end(struct stream_pos *pos,
f6625916 84 const struct declaration_array *array_declaration);
d06d03db 85void ctf_sequence_begin(struct stream_pos *pos,
f6625916 86 const struct declaration_sequence *sequence_declaration);
d06d03db 87void ctf_sequence_end(struct stream_pos *pos,
f6625916 88 const struct declaration_sequence *sequence_declaration);
6dc2ca62 89
d79865b9 90#endif /* _BABELTRACE_CTF_TYPES_H */
This page took 0.027033 seconds and 4 git commands to generate.