94df03c868526b1bcdf3fdbe935d8dfbf09406c9
1 #ifndef _BABELTRACE_ITERATOR_H
2 #define _BABELTRACE_ITERATOR_H
5 * BabelTrace API Iterators
7 * Copyright 2010-2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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:
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
20 #include <babeltrace/format.h>
21 #include <babeltrace/context.h>
23 /* Forward declarations */
29 BT_SEEK_TIME
, /* uses u.seek_time */
30 BT_SEEK_RESTORE
, /* uses u.restore */
37 struct bt_saved_pos
*restore
;
42 * bt_iter_next: Move trace collection position to the next event.
44 * Returns 0 on success, a negative value on error
46 int bt_iter_next(struct bt_iter
*iter
);
49 * bt_iter_get_pos - Get the current iterator position.
51 * The position returned by this function needs to be freed by
52 * bt_iter_free_pos after use.
54 struct bt_iter_pos
*bt_iter_get_pos(struct bt_iter
*iter
);
57 * bt_iter_free_pos - Free the position.
59 void bt_iter_free_pos(struct bt_iter_pos
*pos
);
62 * bt_iter_set_pos: move the iterator to a given position.
64 * On error, the stream_heap is reinitialized and returned empty.
66 * Return 0 for success.
68 * Return EOF if the position requested is after the last event of the
70 * Return -EINVAL when called with invalid parameter.
71 * Return -ENOMEM if the stream_heap could not be properly initialized.
73 int bt_iter_set_pos(struct bt_iter
*iter
, const struct bt_iter_pos
*pos
);
76 * bt_iter_create_time_pos: create a position based on time
78 * This function allocates and returns a new bt_iter_pos (which must be freed
79 * with bt_iter_free_pos) to be able to restore an iterator position based on a
82 struct bt_iter_pos
*bt_iter_create_time_pos(struct bt_iter
*iter
,
85 #endif /* _BABELTRACE_ITERATOR_H */
This page took 0.031967 seconds and 3 git commands to generate.