logger_index.h 1.75 KB
Newer Older
Loic Hausammann's avatar
Loic Hausammann committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*******************************************************************************
 * This file is part of SWIFT.
 * Copyright (c) 2019 Loic Hausammann (loic.hausammann@epfl.ch)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 ******************************************************************************/

/**
 * @brief This file deals with the index files.
 */
#ifndef __LOGGER_LOGGER_INDEX_H__
#define __LOGGER_LOGGER_INDEX_H__

26
27
struct logger_reader;

Loic Hausammann's avatar
Loic Hausammann committed
28
29
30
31
/**
 * @brief This structure will contain the data related to
 *   the index file.
 */
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
struct logger_index {
  /* The reader */
  struct logger_reader *reader;

  /* List of the time for each file */
  double *times;

  /* Number of files */
  int number_files;

  /* List of all the index files */
  char **filenames;

  /* Offsets */
  size_t *offsets;

  /* ids */
  long long ids;
};

void logger_index_init(struct logger_index *index, struct logger_reader *reader,
		       char *basename);
void logger_index_read_file(struct logger_index *index, int i);

void logger_index_free(struct logger_index *index);

void logger_index_free_current_file(struct logger_index *index);
Loic Hausammann's avatar
Loic Hausammann committed
59
60

#endif // __LOGGER_LOGGER_INDEX_H__