| 1 | /* |
| 2 | * SPDX-License-Identifier: MIT |
| 3 | * |
| 4 | * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
| 5 | */ |
| 6 | |
| 7 | #ifndef BABELTRACE_CTF_WRITER_WRITER_INTERNAL_H |
| 8 | #define BABELTRACE_CTF_WRITER_WRITER_INTERNAL_H |
| 9 | |
| 10 | #include <dirent.h> |
| 11 | #include <glib.h> |
| 12 | #include <sys/types.h> |
| 13 | |
| 14 | #include <babeltrace2-ctf-writer/trace.h> |
| 15 | #include <babeltrace2-ctf-writer/writer.h> |
| 16 | |
| 17 | #include "common/macros.h" |
| 18 | |
| 19 | #include "object.h" |
| 20 | |
| 21 | struct metadata_context { |
| 22 | GString *string; |
| 23 | GString *field_name; |
| 24 | unsigned int current_indentation_level; |
| 25 | }; |
| 26 | |
| 27 | struct bt_ctf_writer { |
| 28 | struct bt_ctf_object base; |
| 29 | int frozen; /* Protects attributes that can't be changed mid-trace */ |
| 30 | struct bt_ctf_trace *trace; |
| 31 | GString *path; |
| 32 | int metadata_fd; |
| 33 | }; |
| 34 | |
| 35 | enum field_type_alias { |
| 36 | FIELD_TYPE_ALIAS_UINT5_T = 0, |
| 37 | FIELD_TYPE_ALIAS_UINT8_T, |
| 38 | FIELD_TYPE_ALIAS_UINT16_T, |
| 39 | FIELD_TYPE_ALIAS_UINT27_T, |
| 40 | FIELD_TYPE_ALIAS_UINT32_T, |
| 41 | FIELD_TYPE_ALIAS_UINT64_T, |
| 42 | NR_FIELD_TYPE_ALIAS, |
| 43 | }; |
| 44 | |
| 45 | BT_HIDDEN |
| 46 | struct bt_ctf_field_type *get_field_type(enum field_type_alias alias); |
| 47 | |
| 48 | BT_HIDDEN |
| 49 | const char *bt_ctf_get_byte_order_string(enum bt_ctf_byte_order byte_order); |
| 50 | |
| 51 | BT_HIDDEN |
| 52 | void bt_ctf_writer_freeze(struct bt_ctf_writer *writer); |
| 53 | |
| 54 | #endif /* BABELTRACE_CTF_WRITER_WRITER_INTERNAL_H */ |