Makes few cleanning and adds an obi_dms C constructor

This commit is contained in:
2015-05-26 21:36:55 +02:00
parent 9f69f76704
commit d1324618b8
4 changed files with 90 additions and 53 deletions

View File

@ -61,6 +61,23 @@ typedef struct OBIDMS {
*/
/**@}*/
/*@
* @brief Check if a OBIDMS exist
*
* @param name a pointer to a C string containing the name of the database
* the actual directory name used to store the DMS will be
* `<name>.obidms`
*
* @return an integer value indicating the status of the database
* @retvalue 1 the database exist
* @retvalue 0 the database does not exist
* @retvalue -1 an error occurs
*
* @see obi_close_dms()
* @since May 2015
* @author Eric Coissac (eric.coissac@metabarcoding.org)
*/
int obi_dms_exists(const char* name);
/**
* @brief Create a new OBITools Data Management instance (OBIDMS).
@ -108,6 +125,29 @@ OBIDMS_p obi_create_dms(const char *name);
*/
OBIDMS_p obi_open_dms(const char *name);
/**
* @brief Create a new OBIDMS instance.
*
* If the database already exist this function open it, otherwise it
* creates a new databse.
*
* @param name a pointer to a C string containing the name of the database
* the actual directory name used to store the DMS is
* `<name>.obidms`
*
* @return a pointer to an OBIDMS structure describing the newly created DMS
* @retval NULL on error and the `obi_errno`variable is set.
*
* ###Error values
* - OBIDMS_LONG_NAME_ERROR : the database name exceeds the limit.
* - OBIDMS_MEMORY_ERROR : something wrong occurs during memory allocation.
*
* @see obi_close_dms()
* @since May 2015
* @author Eric Coissac (eric.coissac@metabarcoding.org)
*/
OBIDMS_p obi_dms(const char *name);
/**
* @brief Close an opened OBITools Data Management instance (OBIDMS).
*