1 #ifndef BABELTRACE_CTF_WRITER_RESOLVE_INTERNAL_H
2 #define BABELTRACE_CTF_WRITER_RESOLVE_INTERNAL_H
5 * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 * Copyright 2016 Philippe Proulx <pproulx@efficios.com>
8 * Authors: Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 * Philippe Proulx <pproulx@efficios.com>
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:
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 #include <babeltrace2-ctf-writer/field-types.h>
31 #include "common/macros.h"
34 #include "field-types.h"
37 enum bt_ctf_resolve_flag
{
38 BT_CTF_RESOLVE_FLAG_PACKET_HEADER
= 0x01,
39 BT_CTF_RESOLVE_FLAG_PACKET_CONTEXT
= 0x02,
40 BT_CTF_RESOLVE_FLAG_EVENT_HEADER
= 0x04,
41 BT_CTF_RESOLVE_FLAG_STREAM_EVENT_CTX
= 0x08,
42 BT_CTF_RESOLVE_FLAG_EVENT_CONTEXT
= 0x10,
43 BT_CTF_RESOLVE_FLAG_EVENT_PAYLOAD
= 0x20,
47 * Resolves CTF IR field types: recursively locates the tag and length
48 * field types of resp. variant and sequence field types.
50 * All `*_type` parameters may be resolved, and may as well serve as
53 * Resolving is performed based on the flags in `flags`.
55 * It is expected that, amongst all the provided types, no common
56 * references to sequence variant field types exist. In other words,
57 * this function does not copy field types.
59 * All parameters are owned by the caller.
62 int bt_ctf_resolve_types(struct bt_ctf_private_value
*environment
,
63 struct bt_ctf_field_type_common
*packet_header_type
,
64 struct bt_ctf_field_type_common
*packet_context_type
,
65 struct bt_ctf_field_type_common
*event_header_type
,
66 struct bt_ctf_field_type_common
*stream_event_ctx_type
,
67 struct bt_ctf_field_type_common
*event_context_type
,
68 struct bt_ctf_field_type_common
*event_payload_type
,
69 enum bt_ctf_resolve_flag flags
);
71 #endif /* BABELTRACE_CTF_WRITER_RESOLVE_INTERNAL_H */