| 1 | /* |
| 2 | * SPDX-License-Identifier: MIT |
| 3 | * |
| 4 | * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
| 5 | * Copyright 2016 Philippe Proulx <pproulx@efficios.com> |
| 6 | */ |
| 7 | |
| 8 | #ifndef BABELTRACE_CTF_WRITER_RESOLVE_INTERNAL_H |
| 9 | #define BABELTRACE_CTF_WRITER_RESOLVE_INTERNAL_H |
| 10 | |
| 11 | #include <babeltrace2-ctf-writer/field-types.h> |
| 12 | #include "common/macros.h" |
| 13 | #include <glib.h> |
| 14 | |
| 15 | #include "field-types.h" |
| 16 | #include "values.h" |
| 17 | |
| 18 | enum bt_ctf_resolve_flag { |
| 19 | BT_CTF_RESOLVE_FLAG_PACKET_HEADER = 0x01, |
| 20 | BT_CTF_RESOLVE_FLAG_PACKET_CONTEXT = 0x02, |
| 21 | BT_CTF_RESOLVE_FLAG_EVENT_HEADER = 0x04, |
| 22 | BT_CTF_RESOLVE_FLAG_STREAM_EVENT_CTX = 0x08, |
| 23 | BT_CTF_RESOLVE_FLAG_EVENT_CONTEXT = 0x10, |
| 24 | BT_CTF_RESOLVE_FLAG_EVENT_PAYLOAD = 0x20, |
| 25 | }; |
| 26 | |
| 27 | /* |
| 28 | * Resolves CTF IR field types: recursively locates the tag and length |
| 29 | * field types of resp. variant and sequence field types. |
| 30 | * |
| 31 | * All `*_type` parameters may be resolved, and may as well serve as |
| 32 | * resolving targets. |
| 33 | * |
| 34 | * Resolving is performed based on the flags in `flags`. |
| 35 | * |
| 36 | * It is expected that, amongst all the provided types, no common |
| 37 | * references to sequence variant field types exist. In other words, |
| 38 | * this function does not copy field types. |
| 39 | * |
| 40 | * All parameters are owned by the caller. |
| 41 | */ |
| 42 | BT_HIDDEN |
| 43 | int bt_ctf_resolve_types(struct bt_ctf_private_value *environment, |
| 44 | struct bt_ctf_field_type_common *packet_header_type, |
| 45 | struct bt_ctf_field_type_common *packet_context_type, |
| 46 | struct bt_ctf_field_type_common *event_header_type, |
| 47 | struct bt_ctf_field_type_common *stream_event_ctx_type, |
| 48 | struct bt_ctf_field_type_common *event_context_type, |
| 49 | struct bt_ctf_field_type_common *event_payload_type, |
| 50 | enum bt_ctf_resolve_flag flags); |
| 51 | |
| 52 | #endif /* BABELTRACE_CTF_WRITER_RESOLVE_INTERNAL_H */ |