Columns are now enlarged if needed when setting a value

This commit is contained in:
Celine Mercier
2015-09-01 17:38:08 +02:00
parent 3b7536c0df
commit f31d8983bb
22 changed files with 406 additions and 111 deletions

View File

@ -27,6 +27,8 @@
#define ELEMENTS_NAMES_MAX (2048)
#define INITIAL_LINE_COUNT (1000)
#define GROWTH_FACTOR (2)
#define MAXIMUM_LINE_COUNT (1000000)
typedef int32_t obiversion_t; /**< Used to store the column version number
@ -205,6 +207,20 @@ int obi_close_column(OBIDMS_column_p column);
int obi_truncate_column_to_lines_used(OBIDMS_column_p column);
/**
* @brief Enlarges a column file.
*
* @param column a pointer on an OBIDMS column
*
* @return 0 if the operation was successfully completed
* @return -1 if an error occurred
*
* @since August 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
int obi_enlarge_column(OBIDMS_column_p column);
/**
* @brief Truncates a column file to the number of lines used and closes it.
*
@ -219,6 +235,19 @@ int obi_truncate_column_to_lines_used(OBIDMS_column_p column);
int obi_truncate_and_close_column(OBIDMS_column_p column);
/*
* @brief Sets the data in a column to the NA value of the data type.
*
* @param column a pointer on an OBIDMS column
* @param start the first line number of the block that should be set
* @param nb_lines the number of lines that should be set
*
* @since August 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
void obi_ini_to_NA_values(OBIDMS_column_p column, size_t start, size_t nb_lines);
/**
* @brief Sets the 'writable' header attribute of an OBIDMS column to False.
*