Commit | Line | Data |
---|---|---|
f465e978 JG |
1 | /* |
2 | * Copyright (C) 2018 - Jérémie Galarneau <jeremie.galarneau@efficios.com> | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify it | |
5 | * under the terms of the GNU General Public License, version 2 only, as | |
6 | * published by the Free Software Foundation. | |
7 | * | |
8 | * This program is distributed in the hope that it will be useful, but WITHOUT | |
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
11 | * more details. | |
12 | * | |
13 | * You should have received a copy of the GNU General Public License along with | |
14 | * this program; if not, write to the Free Software Foundation, Inc., 51 | |
15 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
16 | */ | |
17 | ||
18 | #ifndef RELAY_INDEX_FILE_H | |
19 | #define RELAY_INDEX_FILE_H | |
20 | ||
21 | #include <stdint.h> | |
22 | #include <common/index/ctf-index.h> | |
23 | ||
24 | struct relay_index_file; | |
25 | ||
26 | /* | |
27 | * create and open have refcount of 1. Use put to decrement the | |
28 | * refcount. Destroys when reaching 0. Use "get" to increment refcount. | |
29 | */ | |
30 | struct relay_index_file *relay_index_file_create(const char *path_name, | |
31 | const char *stream_name, uint64_t size, | |
32 | uint64_t count, uint32_t major, uint32_t minor); | |
33 | struct relay_index_file *relay_index_file_open(const char *path_name, | |
34 | const char *channel_name, uint64_t tracefile_count, | |
35 | uint64_t tracefile_count_current); | |
36 | ||
37 | int relay_index_file_write(const struct relay_index_file *index_file, | |
38 | const struct ctf_packet_index *element); | |
39 | int relay_index_file_read(const struct relay_index_file *index_file, | |
40 | struct ctf_packet_index *element); | |
41 | ||
42 | int relay_index_file_seek_end(struct relay_index_file *index_file); | |
43 | ||
44 | void relay_index_file_get(struct relay_index_file *index_file); | |
45 | void relay_index_file_put(struct relay_index_file *index_file); | |
46 | ||
47 | #endif /* RELAY_INDEX_FILE_H */ |