Commit | Line | Data |
---|---|---|
16ca5ff0 | 1 | /* |
0235b0db | 2 | * SPDX-License-Identifier: MIT |
16ca5ff0 | 3 | * |
0235b0db | 4 | * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
16ca5ff0 PP |
5 | */ |
6 | ||
0235b0db MJ |
7 | #ifndef BABELTRACE_CTF_WRITER_VISITOR_INTERNAL_H |
8 | #define BABELTRACE_CTF_WRITER_VISITOR_INTERNAL_H | |
9 | ||
91d81473 | 10 | #include <stdlib.h> |
de58dd3c | 11 | #include <stdint.h> |
217cf9d3 | 12 | #include <babeltrace2-ctf-writer/visitor.h> |
91d81473 | 13 | #include "common/macros.h" |
16ca5ff0 PP |
14 | |
15 | typedef void *(*bt_ctf_child_accessor)(void *object, int index); | |
16 | typedef int64_t (*bt_ctf_child_count_accessor)(void *object); | |
17 | typedef int (*bt_ctf_child_visitor)(void *object, bt_ctf_visitor visitor, | |
18 | void *data); | |
19 | ||
20 | struct bt_ctf_visitor_object { | |
21 | enum bt_ctf_visitor_object_type type; | |
22 | void *object; | |
23 | }; | |
24 | ||
25 | BT_HIDDEN | |
44c440bc | 26 | int bt_ctf_visitor_helper(struct bt_ctf_visitor_object *root, |
16ca5ff0 PP |
27 | bt_ctf_child_count_accessor child_counter, |
28 | bt_ctf_child_accessor child_accessor, | |
29 | bt_ctf_child_visitor child_visitor, | |
30 | bt_ctf_visitor visitor, | |
31 | void *data); | |
32 | ||
33 | #endif /* BABELTRACE_CTF_WRITER_VISITOR_INTERNAL_H */ |