Files and functions for OBIDMS columns with the data type OBI_BOOL

This commit is contained in:
celinemercier
2015-08-11 11:00:59 +02:00
parent bc2ca89088
commit eaca9c85f1
10 changed files with 186 additions and 2 deletions

41
src/obidmscolumn_bool.c Normal file
View File

@ -0,0 +1,41 @@
/****************************************************************************
* OBIDMS_column_bool functions *
****************************************************************************/
/**
* @file obidsmcolumn_bool.c
* @author Celine Mercier
* @date August 10th 2015
* @brief Functions handling OBIColumns containing data with the OBIType OBI_BOOL.
*/
#include <stdlib.h>
#include <stdio.h>
#include "obidmscolumn.h"
#include "obitypes.h"
#include "obierrno.h"
#include "obidebug.h"
/**********************************************************************
*
* D E F I N I T I O N O F T H E P U B L I C F U N C T I O N S
*
**********************************************************************/
int obi_column_set_bool(OBIDMS_column_p column, size_t line_nb, size_t element_idx, obibool_t value)
{
// when/where check if can write?
// check if value in enum?
*(((obibool_t*) (column->data)) + (line_nb * ((column->header)->nb_elements_per_line)) + element_idx) = value;
return 0;
}
obibool_t obi_column_get_bool(OBIDMS_column_p column, size_t line_nb, size_t element_idx)
{
return *(((obibool_t*) (column->data)) + (line_nb * ((column->header)->nb_elements_per_line)) + element_idx);
}