Commit | Line | Data |
---|---|---|
273b65be | 1 | /* |
0235b0db | 2 | * SPDX-License-Identifier: MIT |
273b65be | 3 | * |
0235b0db | 4 | * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
273b65be JG |
5 | */ |
6 | ||
0235b0db MJ |
7 | #ifndef BABELTRACE_CTF_WRITER_WRITER_INTERNAL_H |
8 | #define BABELTRACE_CTF_WRITER_WRITER_INTERNAL_H | |
9 | ||
273b65be | 10 | #include <dirent.h> |
578e048b | 11 | #include <glib.h> |
273b65be | 12 | #include <sys/types.h> |
578e048b | 13 | |
217cf9d3 PP |
14 | #include <babeltrace2-ctf-writer/trace.h> |
15 | #include <babeltrace2-ctf-writer/writer.h> | |
578e048b | 16 | |
91d81473 | 17 | #include "common/macros.h" |
578e048b MJ |
18 | |
19 | #include "object.h" | |
273b65be | 20 | |
3dca2276 PP |
21 | struct metadata_context { |
22 | GString *string; | |
23 | GString *field_name; | |
24 | unsigned int current_indentation_level; | |
25 | }; | |
26 | ||
273b65be | 27 | struct bt_ctf_writer { |
e1e02a22 | 28 | struct bt_ctf_object base; |
273b65be | 29 | int frozen; /* Protects attributes that can't be changed mid-trace */ |
3dca2276 | 30 | struct bt_ctf_trace *trace; |
273b65be | 31 | GString *path; |
273b65be | 32 | int metadata_fd; |
273b65be JG |
33 | }; |
34 | ||
3dca2276 PP |
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 | ||
3dca2276 PP |
45 | struct bt_ctf_field_type *get_field_type(enum field_type_alias alias); |
46 | ||
16ca5ff0 | 47 | const char *bt_ctf_get_byte_order_string(enum bt_ctf_byte_order byte_order); |
3dca2276 | 48 | |
319fd969 PP |
49 | void bt_ctf_writer_freeze(struct bt_ctf_writer *writer); |
50 | ||
273b65be | 51 | #endif /* BABELTRACE_CTF_WRITER_WRITER_INTERNAL_H */ |