Commit | Line | Data |
---|---|---|
273b65be JG |
1 | #ifndef BABELTRACE_CTF_WRITER_WRITER_INTERNAL_H |
2 | #define BABELTRACE_CTF_WRITER_WRITER_INTERNAL_H | |
3 | ||
4 | /* | |
de9dd397 | 5 | * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
273b65be JG |
6 | * |
7 | * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com> | |
8 | * | |
9 | * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | * of this software and associated documentation files (the "Software"), to deal | |
11 | * in the Software without restriction, including without limitation the rights | |
12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
13 | * copies of the Software, and to permit persons to whom the Software is | |
14 | * furnished to do so, subject to the following conditions: | |
15 | * | |
16 | * The above copyright notice and this permission notice shall be included in | |
17 | * all copies or substantial portions of the Software. | |
18 | * | |
19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
25 | * SOFTWARE. | |
26 | */ | |
27 | ||
273b65be | 28 | #include <babeltrace/ctf-writer/writer.h> |
273b65be JG |
29 | #include <babeltrace/babeltrace-internal.h> |
30 | #include <glib.h> | |
31 | #include <dirent.h> | |
32 | #include <sys/types.h> | |
16ca5ff0 | 33 | #include <babeltrace/ctf-writer/trace.h> |
83509119 | 34 | #include <babeltrace/object-internal.h> |
273b65be | 35 | |
3dca2276 PP |
36 | struct metadata_context { |
37 | GString *string; | |
38 | GString *field_name; | |
39 | unsigned int current_indentation_level; | |
40 | }; | |
41 | ||
273b65be | 42 | struct bt_ctf_writer { |
83509119 | 43 | struct bt_object base; |
273b65be | 44 | int frozen; /* Protects attributes that can't be changed mid-trace */ |
3dca2276 | 45 | struct bt_ctf_trace *trace; |
273b65be | 46 | GString *path; |
273b65be | 47 | int metadata_fd; |
273b65be JG |
48 | }; |
49 | ||
3dca2276 PP |
50 | enum field_type_alias { |
51 | FIELD_TYPE_ALIAS_UINT5_T = 0, | |
52 | FIELD_TYPE_ALIAS_UINT8_T, | |
53 | FIELD_TYPE_ALIAS_UINT16_T, | |
54 | FIELD_TYPE_ALIAS_UINT27_T, | |
55 | FIELD_TYPE_ALIAS_UINT32_T, | |
56 | FIELD_TYPE_ALIAS_UINT64_T, | |
57 | NR_FIELD_TYPE_ALIAS, | |
58 | }; | |
59 | ||
60 | BT_HIDDEN | |
61 | struct bt_ctf_field_type *get_field_type(enum field_type_alias alias); | |
62 | ||
63 | BT_HIDDEN | |
16ca5ff0 | 64 | const char *bt_ctf_get_byte_order_string(enum bt_ctf_byte_order byte_order); |
3dca2276 | 65 | |
319fd969 PP |
66 | BT_HIDDEN |
67 | void bt_ctf_writer_freeze(struct bt_ctf_writer *writer); | |
68 | ||
273b65be | 69 | #endif /* BABELTRACE_CTF_WRITER_WRITER_INTERNAL_H */ |