41 lines
1.2 KiB
C
41 lines
1.2 KiB
C
![]() |
/****************************************************************************
|
||
|
* OBIDMS_column_idx functions *
|
||
|
****************************************************************************/
|
||
|
|
||
|
/**
|
||
|
* @file obidsmcolumn_idx.c
|
||
|
* @author Celine Mercier
|
||
|
* @date August 10th 2015
|
||
|
* @brief Functions handling OBIColumns containing data with the OBIType OBI_IDX.
|
||
|
*/
|
||
|
|
||
|
|
||
|
#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_idx(OBIDMS_column_p column, size_t line_nb, size_t element_idx, obiidx_t value)
|
||
|
{
|
||
|
// when/where check if can write?
|
||
|
*(((obiidx_t*) (column->data)) + (line_nb * ((column->header)->nb_elements_per_line)) + element_idx) = value;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
|
||
|
obiidx_t obi_column_get_idx(OBIDMS_column_p column, size_t line_nb, size_t element_idx)
|
||
|
{
|
||
|
return *(((obiidx_t*) (column->data)) + (line_nb * ((column->header)->nb_elements_per_line)) + element_idx);
|
||
|
}
|
||
|
|