Commit 63848443 authored by Loic Hausammann's avatar Loic Hausammann
Browse files

Add comments

parent 0b43546a
......@@ -30,6 +30,17 @@
#define LOGGER_OFFSET_SIZE 7
#define LOGGER_MASK_SIZE 1
/**
* @brief This structure contains everything from the file header.
*
* This structure is initialized by @header_read and need to be freed
* with @header_free.
*
* The information contained by the header can be easily access with
* the functions @header_get_mask_size and @header_get_field_index.
*
* The only function that modify the file is @header_change_offset_direction.
*/
struct header {
/* Logger version */
char version[STRING_SIZE];
......
......@@ -16,6 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
/**
* @brief This file contains basic IO function.
*/
#ifndef __LOGGER_LOGGER_IO_H__
#define __LOGGER_LOGGER_IO_H__
......
......@@ -28,6 +28,22 @@
#define DIM 3
/**
* @brief Store the data from a chunk.
*
* This structure contains all the required fields
* present in a file.
*
* As we need only a single particle, no need to keep
* it small.
*
* The particle is initialized with @logger_particle_init
* and can be updated with a chunk through @logger_particle_read.
*
* In @logger_particle_read, we use @logger_particle_read_field on
* each field and @logger_particle_interpolate if a linear
* interpolation is required.
*/
struct logger_particle {
/* position */
double pos[DIM];
......@@ -57,9 +73,12 @@ struct logger_particle {
double time;
};
/**
* @brief Defines the type of interpolation
*/
enum logger_reader_type {
logger_reader_const,
logger_reader_lin,
logger_reader_const, /* Constant interpolation */
logger_reader_lin, /* Linear interpolation */
};
void logger_particle_print(const struct logger_particle *p);
......
......@@ -16,6 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
/**
* @brief This file contains the C function shown to the external user.
*/
#ifndef __LOGGER_LOGGER_READER_H__
#define __LOGGER_LOGGER_READER_H__
......
......@@ -25,6 +25,23 @@
typedef char timebin_t;
typedef long long integertime_t;
/**
* @brief This structure contains all the timestamp.
*
* In order to obtain easily the time step of a chunk,
* this structure is required. It contains all the time step
* with their timestamp and position in the file.
*
* This structure is initialized with @time_array_init and
* freed with @time_array_free.
*
* The time step of an offset can be obtained with
* @time_array_get_integertime, @time_array_get_time and
* @time_array_get_time_array.
*
* The size of the time array can be accessed with
* @time_array_count.
*/
struct time_array {
/* Pointer to next element */
void *next;
......@@ -42,8 +59,6 @@ struct time_array {
size_t offset;
};
double time_convert_to_double(const integertime_t ti, const double timeBase);
integertime_t time_convert_to_integer(const double ti, const double timeBase);
void time_read(integertime_t *timestamp, double *time, const struct header *h,
void *map, size_t *offset);
void time_array_init(struct time_array *t, const struct header *h, void *map,
......
......@@ -16,6 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
/**
* @brief This file contains functions that help to navigate in the dumps.
*/
#ifndef __LOGGER_LOGGER_TOOLS_H__
#define __LOGGER_LOGGER_TOOLS_H__
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment