Commit | Line | Data |
---|---|---|
6f3077a2 JD |
1 | #ifndef _BABELTRACE_CALLBACKS_INTERNAL_H |
2 | #define _BABELTRACE_CALLBACKS_INTERNAL_H | |
3 | ||
4 | /* | |
5 | * BabelTrace | |
6 | * | |
7 | * Internal callbacks header | |
8 | * | |
9 | * Copyright 2010-2011 EfficiOS Inc. and Linux Foundation | |
10 | * | |
11 | * Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
12 | * | |
13 | * Permission is hereby granted, free of charge, to any person obtaining a copy | |
14 | * of this software and associated documentation files (the "Software"), to deal | |
15 | * in the Software without restriction, including without limitation the rights | |
16 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
17 | * copies of the Software, and to permit persons to whom the Software is | |
18 | * furnished to do so, subject to the following conditions: | |
19 | * | |
20 | * The above copyright notice and this permission notice shall be included in | |
21 | * all copies or substantial portions of the Software. | |
c462e188 MD |
22 | * |
23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
24 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
25 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
26 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
28 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
29 | * SOFTWARE. | |
6f3077a2 JD |
30 | */ |
31 | ||
34861b9d | 32 | #include <glib.h> |
9a19a512 PP |
33 | #include <babeltrace/babeltrace-internal.h> |
34 | ||
35 | struct bt_ctf_iter; | |
36 | struct ctf_stream_definition; | |
34861b9d | 37 | |
6f3077a2 JD |
38 | struct bt_callback { |
39 | int prio; /* Callback order priority. Lower first. Dynamically assigned from dependency graph. */ | |
40 | void *private_data; | |
41 | int flags; | |
42 | struct bt_dependencies *depends; | |
43 | struct bt_dependencies *weak_depends; | |
44 | struct bt_dependencies *provides; | |
c50d2a7a | 45 | enum bt_cb_ret (*callback)(struct bt_ctf_event *ctf_data, |
6f3077a2 JD |
46 | void *private_data); |
47 | }; | |
48 | ||
49 | struct bt_callback_chain { | |
50 | GArray *callback; /* Array of struct bt_callback, ordered by priority */ | |
51 | }; | |
52 | ||
53 | /* | |
54 | * per id callbacks need to be per stream class because event ID vs | |
55 | * event name mapping can vary from stream to stream. | |
56 | */ | |
57 | struct bt_stream_callbacks { | |
58 | GArray *per_id_callbacks; /* Array of struct bt_callback_chain */ | |
59 | }; | |
60 | ||
61 | struct bt_dependencies { | |
62 | GArray *deps; /* Array of GQuarks */ | |
63 | int refcount; /* free when decremented to 0 */ | |
64 | }; | |
65 | ||
2e937fb4 | 66 | BT_HIDDEN |
9e88d150 | 67 | void process_callbacks(struct bt_ctf_iter *iter, struct ctf_stream_definition *stream); |
6f3077a2 JD |
68 | |
69 | #endif /* _BABELTRACE_CALLBACKS_INTERNAL_H */ |