Export the babeltrace API in babeltrace.h
[babeltrace.git] / include / babeltrace / babeltrace.h
CommitLineData
34ac0e6c
MD
1#ifndef _BABELTRACE_H
2#define _BABELTRACE_H
3
70bd0a12
JD
4/*
5 * BabelTrace API
6 *
7 * Copyright 2010-2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a copy
10 * of this software and associated documentation files (the "Software"), to deal
11 * in the Software without restriction, including without limitation the rights
12 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 * copies of the Software, and to permit persons to whom the Software is
14 * furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
18 */
847bf71a 19
70bd0a12
JD
20/* Forward declarations */
21struct babeltrace_iter;
22struct babeltrace_iter_pos;
23struct babeltrace_iter_stream_pos;
24struct trace_collection;
25struct ctf_stream_event;
26struct ctf_stream;
34ac0e6c 27
70bd0a12
JD
28/*
29 * babeltrace_iter_create - Allocate a trace collection iterator.
30 */
31struct babeltrace_iter *babeltrace_iter_create(struct trace_collection *tc);
34ac0e6c 32
70bd0a12
JD
33/*
34 * babeltrace_iter_destroy - Free a trace collection iterator.
35 */
36void babeltrace_iter_destroy(struct babeltrace_iter *iter);
34ac0e6c 37
70bd0a12
JD
38/*
39 * babeltrace_iter_next: Move trace collection position to the next event.
40 *
41 * Returns 0 on success, a negative value on error
42 */
43int babeltrace_iter_next(struct babeltrace_iter *iter);
46322b33 44
70bd0a12
JD
45/*
46 * babeltrace_iter_get_pos - Get the current trace collection position.
47 *
48 * The position returned by this function needs to be freed by
49 * babeltrace_iter_free_pos after use.
50 */
51struct babeltrace_iter_pos *
52 babeltrace_iter_get_pos(struct babeltrace_iter *iter);
46322b33 53
70bd0a12
JD
54/*
55 * babeltrace_iter_free_pos - Free the position.
56 */
57void babeltrace_iter_free_pos(struct babeltrace_iter_pos *pos);
d63ca2cd 58
70bd0a12
JD
59/*
60 * babeltrace_iter_seek_pos - Seek the trace collection to the position.
61 */
62int babeltrace_iter_seek_pos(struct babeltrace_iter *iter,
63 struct babeltrace_iter_pos *pos);
64
65/*
66 * babeltrace_iter_seek_time: Seek the trace collection to the given timestamp.
67 *
68 * Return EOF if timestamp is after the last event of the trace collection.
69 * Return other negative value for other errors.
70 * Return 0 for success.
71 */
72int babeltrace_iter_seek_time(struct babeltrace_iter *iter,
73 uint64_t timestamp);
74
75/*
76 * babeltrace_iter_read_event: Read the iterator's current event data.
77 *
78 * @iter: trace collection iterator (input)
79 * @stream: stream containing event at current position (output)
80 * @event: current event (output)
81 * Return 0 on success, negative error value on error.
82 */
83int babeltrace_iter_read_event(struct babeltrace_iter *iter,
84 struct ctf_stream **stream,
85 struct ctf_stream_event **event);
86
87#endif /* _BABELTRACE_H */
This page took 0.027625 seconds and 4 git commands to generate.