C sources modified to add the handling of OBIDM columns with the type

OBI_INT, and the handling of multiple types in general
This commit is contained in:
celinemercier
2015-07-31 18:03:48 +02:00
parent a6abc74500
commit 5f62cd8526
6 changed files with 684 additions and 10 deletions

View File

@ -86,6 +86,28 @@ typedef struct OBIDMS_column {
} OBIDMS_column_t, *OBIDMS_column_p;
/**
* @brief Returns the latest version of a column in a column directory
*
* @param column_directory
*
* @return the latest version number kept in the version file
* @return -1 if an error occurred
*/
obiversion_t obi_get_latest_version_number(OBIDMS_column_directory_p column_directory);
/**
* @brief Returns the latest version of a column in a column directory
*
* @param column_name
*
* @return the latest version number kept in the version file
* @return -1 if an error occurred
*/
obiversion_t obi_column_get_latest_version_from_name(OBIDMS_p dms, const char* column_name);
/**
* @brief Returns the header size in bytes of a column on this platform.
*
@ -103,7 +125,7 @@ size_t obi_get_platform_header_size();
/**
* @brief Creates a column.
*
* @param dms a pointer on an OBIDMS column
* @param dms a pointer on an OBIDMS
* @param column_name the name of the new column
* @param type the OBIType code used to create the column
* @param nb_elements the number of elements to be stored
@ -120,15 +142,123 @@ OBIDMS_column_p obi_create_column(OBIDMS_p dms,
/**
* @brief Returns the latest column version in the `dms` database
* @brief Opens a column in read-only mode.
*
* @param dms a pointer as returned by obi_create_dms() or obi_open_dms()
* @param dms a pointer on an OBIDMS
* @param column_name the name of the column
* @param version_number the version of the column that should be opened
*
* @return the bigger version number used for this column
* @return -1 if the column does not exist
* @return a pointer to the opened column
*
* @since July 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
obiversion_t obi_get_latest_version_number(OBIDMS_column_directory_p column_directory);
OBIDMS_column_p obi_open_column(OBIDMS_p dms, const char* column_name, obiversion_t version_number);
/**
* @brief Closes a column.
*
* @param column a pointer on an OBIDMS column
*
* @return 0 if the operation was successfully completed
* @return -1 if an error occurred
*
* @since July 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
int obi_close_column(OBIDMS_column_p column);
/**
* @brief Sets the 'writable' header attribute of an OBIDMS column to False.
*
* @param column a pointer on an OBIDMS column
*
* @since July 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
void obi_column_make_unwritable(OBIDMS_column_p column);
/**
* @brief Recovers the line count of an OBIDMS column.
*
* @param column a pointer on an OBIDMS column
*
* @return the line count of the column
*
* @since July 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
size_t obi_column_get_line_count(OBIDMS_column_p column);
/**
* @brief Recovers the data type of an OBIDMS column.
*
* @param column a pointer on an OBIDMS column
*
* @return the data type of the column
*
* @since July 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
OBIType_t obi_column_get_data_type(OBIDMS_column_p column);
/**
* @brief Recovers the data type of an OBIDMS column from the column name.
*
* @param dms a pointer on an OBIDMS
* @param column_name the name of an OBIDMS column
*
* @return the data type of the column
*
* @since July 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
OBIType_t obi_column_get_data_type_from_name(OBIDMS_p dms, const char* column_name);
/**
* @brief Recovers the elements names of an OBIDMS column.
*
* @param column a pointer on an OBIDMS column
*
* @return the elements names
*
* @since July 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
const char* obi_column_get_elements_names(OBIDMS_column_p column);
/**
* @brief Recovers the index of an element in an OBIDMS column from its name.
*
* @param column a pointer on an OBIDMS column
* @param element_name the name of the element
*
* @return the index of the element in a line of the column
*
* @since July 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
size_t obi_column_get_element_index_from_name(OBIDMS_column_p column, const char* element_name);
/**
* @brief Recovers the number of elements per line in an OBIDMS column.
*
* @param column a pointer on an OBIDMS column
*
* @return the number of elements per line
*
* @since July 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
size_t obi_column_get_nb_elements_per_line(OBIDMS_column_p column);
#endif /* OBIDMSCOLUMN_H_ */