Make API CTF-agnostic
[babeltrace.git] / include / babeltrace / ctf-ir / resolve-internal.h
CommitLineData
09840de5
PP
1#ifndef BABELTRACE_CTF_IR_RESOLVE_INTERNAL_H
2#define BABELTRACE_CTF_IR_RESOLVE_INTERNAL_H
3
4/*
5 * Babeltrace - CTF IR: Type resolving internal
6 *
7 * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 * Copyright 2016 Philippe Proulx <pproulx@efficios.com>
9 *
10 * Authors: Jérémie Galarneau <jeremie.galarneau@efficios.com>
11 * Philippe Proulx <pproulx@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.
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.
30 */
31
2e33ac5a
PP
32#include <babeltrace/ctf-ir/field-types.h>
33#include <babeltrace/ctf-ir/field-types-internal.h>
09840de5
PP
34#include <babeltrace/values.h>
35#include <babeltrace/babeltrace-internal.h>
36#include <glib.h>
37
50842bdc
PP
38enum bt_resolve_flag {
39 BT_RESOLVE_FLAG_PACKET_HEADER = 0x01,
40 BT_RESOLVE_FLAG_PACKET_CONTEXT = 0x02,
41 BT_RESOLVE_FLAG_EVENT_HEADER = 0x04,
42 BT_RESOLVE_FLAG_STREAM_EVENT_CTX = 0x08,
43 BT_RESOLVE_FLAG_EVENT_CONTEXT = 0x10,
44 BT_RESOLVE_FLAG_EVENT_PAYLOAD = 0x20,
09840de5
PP
45};
46
47/*
48 * Resolves CTF IR field types: recursively locates the tag and length
49 * field types of resp. variant and sequence field types.
50 *
51 * All `*_type` parameters may be resolved, and may as well serve as
52 * resolving targets.
53 *
54 * Resolving is performed based on the flags in `flags`.
55 *
56 * It is expected that, amongst all the provided types, no common
57 * references to sequence variant field types exist. In other words,
58 * this function does not copy field types.
59 *
60 * All parameters are owned by the caller.
61 */
62BT_HIDDEN
50842bdc 63int bt_resolve_types(struct bt_value *environment,
cb6f1f7d
PP
64 struct bt_field_type *packet_header_type,
65 struct bt_field_type *packet_context_type,
66 struct bt_field_type *event_header_type,
67 struct bt_field_type *stream_event_ctx_type,
68 struct bt_field_type *event_context_type,
69 struct bt_field_type *event_payload_type,
50842bdc 70 enum bt_resolve_flag flags);
09840de5
PP
71
72#endif /* BABELTRACE_CTF_IR_RESOLVE_INTERNAL_H */
This page took 0.042318 seconds and 4 git commands to generate.