| 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_H |
| 8 | #define BABELTRACE_CTF_WRITER_WRITER_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 | struct bt_ctf_field_type *get_field_type(enum field_type_alias alias); |
| 46 | |
| 47 | const char *bt_ctf_get_byte_order_string(enum bt_ctf_byte_order byte_order); |
| 48 | |
| 49 | void bt_ctf_writer_freeze(struct bt_ctf_writer *writer); |
| 50 | |
| 51 | #endif /* BABELTRACE_CTF_WRITER_WRITER_H */ |