2015-08-10 16:30:55 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* OBIDMS_column_idx header file *
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file obidsmcolumn_idx.h
|
|
|
|
* @author Celine Mercier
|
|
|
|
* @date August 10th 2015
|
|
|
|
* @brief Header file for the functions handling OBIColumns containing data with the OBIType OBI_IDX.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2015-09-30 12:03:46 +02:00
|
|
|
#ifndef OBIDMSCOLUMN_IDX_H_
|
|
|
|
#define OBIDMSCOLUMN_IDX_H_
|
|
|
|
|
|
|
|
|
2015-08-10 16:30:55 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "obidmscolumn.h"
|
|
|
|
#include "obitypes.h"
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2015-08-26 15:05:23 +02:00
|
|
|
* @brief Sets a value in an OBIDMS column containing data with the type OBI_IDX, using the index of the element in the line.
|
2015-08-10 16:30:55 +02:00
|
|
|
*
|
|
|
|
* @warning Pointers returned by obi_open_column() don't allow writing.
|
|
|
|
*
|
2015-09-30 12:03:46 +02:00
|
|
|
* @param column A pointer as returned by obi_create_column() or obi_clone_column().
|
|
|
|
* @param line_nb The number of the line where the value should be set.
|
|
|
|
* @param element_idx The index of the element that should be set in the line.
|
|
|
|
* @param value The value that should be set.
|
2015-08-10 16:30:55 +02:00
|
|
|
*
|
2015-09-30 12:03:46 +02:00
|
|
|
* @returns An integer value indicating the success of the operation.
|
2015-10-08 10:33:19 +02:00
|
|
|
* @retval 0 on success.
|
|
|
|
* @retval -1 if an error occurred.
|
2015-08-10 16:30:55 +02:00
|
|
|
*
|
2015-08-26 15:05:23 +02:00
|
|
|
* @since July 2015
|
2015-08-10 16:30:55 +02:00
|
|
|
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
|
|
|
*/
|
2015-11-03 14:22:00 +01:00
|
|
|
int obi_column_set_obiidx_with_elt_idx(OBIDMS_column_p column, size_t line_nb, size_t element_idx, void* value);
|
2015-08-10 16:30:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Recovers a value in an OBIDMS column containing data with the type OBI_IDX.
|
|
|
|
*
|
2015-09-30 12:03:46 +02:00
|
|
|
* @param column A pointer as returned by obi_create_column().
|
|
|
|
* @param line_nb The number of the line where the value should be recovered.
|
|
|
|
* @param element_idx The index of the element that should be recovered in the line.
|
2015-08-10 16:30:55 +02:00
|
|
|
*
|
2015-09-30 12:03:46 +02:00
|
|
|
* @returns The recovered value.
|
|
|
|
* @retval OBIBool_NA the NA value of the type if an error occurred and obi_errno is set.
|
2015-08-10 16:30:55 +02:00
|
|
|
*
|
2015-08-26 15:05:23 +02:00
|
|
|
* @since July 2015
|
|
|
|
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
|
|
|
*/
|
2015-11-03 14:22:00 +01:00
|
|
|
const char* obi_column_get_obiidx_with_elt_idx(OBIDMS_column_p column, size_t line_nb, size_t element_idx);
|
2015-08-26 15:05:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2015-09-30 12:03:46 +02:00
|
|
|
* @brief Sets a value in an OBIDMS column containing data with the type OBI_IDX,
|
|
|
|
* using the name of the element in the line.
|
2015-08-26 15:05:23 +02:00
|
|
|
*
|
|
|
|
* @warning Pointers returned by obi_open_column() don't allow writing.
|
|
|
|
*
|
2015-09-30 12:03:46 +02:00
|
|
|
* @param column A pointer as returned by obi_create_column() or obi_clone_column().
|
|
|
|
* @param line_nb The number of the line where the value should be set.
|
|
|
|
* @param element_name The name of the element that should be set in the line.
|
|
|
|
* If empty, it is checked that there is only one element per line.
|
|
|
|
* @param value The value that should be set.
|
2015-08-26 15:05:23 +02:00
|
|
|
*
|
2015-09-30 12:03:46 +02:00
|
|
|
* @returns An integer value indicating the success of the operation.
|
|
|
|
* @retval 0 on success.
|
2015-10-08 10:33:19 +02:00
|
|
|
* @retval -1 if an error occurred.
|
2015-08-26 15:05:23 +02:00
|
|
|
*
|
2015-08-10 16:30:55 +02:00
|
|
|
* @since August 2015
|
|
|
|
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
|
|
|
*/
|
2015-11-03 14:22:00 +01:00
|
|
|
int obi_column_set_obiidx_with_elt_name(OBIDMS_column_p column, size_t line_nb, const char* element_name, void* value);
|
2015-08-26 15:05:23 +02:00
|
|
|
|
2015-08-10 16:30:55 +02:00
|
|
|
|
2015-08-26 15:05:23 +02:00
|
|
|
/**
|
2015-09-30 12:03:46 +02:00
|
|
|
* @brief Recovers a value in an OBIDMS column containing data with the type OBI_IDX,
|
|
|
|
* using the name of the element in the line.
|
2015-08-26 15:05:23 +02:00
|
|
|
*
|
2015-09-30 12:03:46 +02:00
|
|
|
* @param column A pointer as returned by obi_create_column() or obi_clone_column().
|
|
|
|
* @param line_nb The number of the line where the value should be recovered.
|
|
|
|
* @param element_name The name of the element that should be recovered in the line.
|
|
|
|
* If empty, it is checked that there is only one element per line.
|
2015-08-26 15:05:23 +02:00
|
|
|
*
|
2015-09-30 12:03:46 +02:00
|
|
|
* @returns The recovered value.
|
|
|
|
* @retval OBIBool_NA the NA value of the type if an error occurred and obi_errno is set.
|
2015-08-26 15:05:23 +02:00
|
|
|
*
|
|
|
|
* @since August 2015
|
|
|
|
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
|
|
|
*/
|
2015-11-03 14:22:00 +01:00
|
|
|
const char* obi_column_get_obiidx_with_elt_name(OBIDMS_column_p column, size_t line_nb, const char* element_name);
|
2015-09-30 12:03:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* OBIDMSCOLUMN_IDX_H_ */
|
2015-08-10 16:30:55 +02:00
|
|
|
|