64 lines
1.6 KiB
C
64 lines
1.6 KiB
C
![]() |
/****************************************************************************
|
||
|
* OBIDMSColumn header file *
|
||
|
****************************************************************************/
|
||
|
|
||
|
/**
|
||
|
* @file obidmscolumn.h
|
||
|
* @author Celine Mercier
|
||
|
* @date 12 May 2015
|
||
|
* @brief Header file for the shared elements of all the OBIColumn structures.
|
||
|
*/
|
||
|
|
||
|
#ifndef OBIDMSCOLUMN_H_
|
||
|
#define OBIDMSCOLUMN_H_
|
||
|
|
||
|
#include <stdio.h>
|
||
|
#include <sys/types.h>
|
||
|
#include <unistd.h>
|
||
|
#include <stdbool.h>
|
||
|
|
||
|
#include "obitypes.h"
|
||
|
|
||
|
/**
|
||
|
* @brief Value separator in OBIDMSColumn files.
|
||
|
*/
|
||
|
static const char SEPARATOR = '\n';
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @brief Header size in OBIDMSColumn files.
|
||
|
*/
|
||
|
static const int HEADER_SIZE = 4096;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @brief Number of bytes to map
|
||
|
*/
|
||
|
static const int BUFFER_SIZE = 4;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @brief OBIColumnHeader structure.
|
||
|
*/
|
||
|
|
||
|
typedef struct OBIDMSColumnHeader {
|
||
|
bool endyan_byte_order; /**< endyan byte order */
|
||
|
int header_size_value; /**< size of the header: a multiple of PAGESIZE */
|
||
|
bool file_status; /**< file status : 0 is Open and 1 is Closed */
|
||
|
pid_t PID; /**< PID of the process that created the file and is
|
||
|
the only one allowed to modify it if it is open */
|
||
|
int line_count; /**< number of lines of data */
|
||
|
OBIType_t data_type; /**< type of the data */
|
||
|
char* creation_date; /**< date of creation of the file */
|
||
|
int version; /**< version of the OBIColumn */
|
||
|
char* comments; /**< comments */
|
||
|
} OBIDMSColumnHeader_t, *OBIDMSColumnHeader_p;
|
||
|
|
||
|
|
||
|
char* obi_map_read_only(int file, int start, int size);
|
||
|
|
||
|
void obi_unmap(int size);
|
||
|
|
||
|
|
||
|
#endif /* OBIDMSCOLUMN_H_ */
|