Fix: relayd vs consumerd compatibility
[lttng-tools.git] / src / common / index / index.h
CommitLineData
309167d2
JD
1/*
2 * Copyright (C) 2013 - Julien Desfossez <jdesfossez@efficios.com>
3 * David Goulet <dgoulet@efficios.com>
f8f3885c 4 * 2016 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
309167d2
JD
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License, version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20#ifndef _INDEX_H
21#define _INDEX_H
22
23#include <inttypes.h>
f8f3885c 24#include <urcu/ref.h>
309167d2 25
50adc264 26#include "ctf-index.h"
309167d2 27
f8f3885c
MD
28struct lttng_index_file {
29 int fd;
30 uint32_t major;
31 uint32_t minor;
32 uint32_t element_len;
33 struct urcu_ref ref;
34};
35
36/*
37 * create and open have refcount of 1. Use put to decrement the
38 * refcount. Destroys when reaching 0. Use "get" to increment refcount.
39 */
40struct lttng_index_file *lttng_index_file_create(char *path_name,
41 char *stream_name, int uid, int gid, uint64_t size,
42 uint64_t count, uint32_t major, uint32_t minor);
43struct lttng_index_file *lttng_index_file_open(const char *path_name,
44 const char *channel_name, uint64_t tracefile_count,
45 uint64_t tracefile_count_current);
46int lttng_index_file_write(const struct lttng_index_file *index_file,
47 const struct ctf_packet_index *element);
48int lttng_index_file_read(const struct lttng_index_file *index_file,
49 struct ctf_packet_index *element);
50
51void lttng_index_file_get(struct lttng_index_file *index_file);
52void lttng_index_file_put(struct lttng_index_file *index_file);
309167d2
JD
53
54#endif /* _INDEX_H */
This page took 0.033267 seconds and 4 git commands to generate.