Functions and files for OBIDMS columns with the type OBI_FLOAT

This commit is contained in:
celinemercier
2015-08-10 16:04:53 +02:00
parent 66f397239b
commit d53c16cf3e
7 changed files with 163 additions and 1 deletions

40
src/obidmscolumn_float.c Normal file
View File

@ -0,0 +1,40 @@
/****************************************************************************
* OBIDMS_column_float functions *
****************************************************************************/
/**
* @file obidsmcolumn_float.c
* @author Celine Mercier
* @date August 10th 2015
* @brief Functions handling OBIColumns containing data with the OBIType OBI_FLOAT.
*/
#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_float(OBIDMS_column_p column, size_t line_nb, size_t element_idx, obifloat_t value)
{
// when/where check if can write?
*(((obifloat_t*) (column->data)) + (line_nb * ((column->header)->nb_elements_per_line)) + element_idx) = value;
return 0;
}
obifloat_t obi_column_get_float(OBIDMS_column_p column, size_t line_nb, size_t element_idx)
{
return *(((obifloat_t*) (column->data)) + (line_nb * ((column->header)->nb_elements_per_line)) + element_idx);
}