Views are now rollbacked if an error occurs, and unfinished views and

columns are deleted when an OBIDMS is opened.
This commit is contained in:
Celine Mercier
2017-10-26 18:58:48 +02:00
parent 1ae634d56b
commit dfd51939a0
11 changed files with 702 additions and 55 deletions

View File

@ -538,6 +538,43 @@ int obi_select_lines(Obiview_p view, index_t* line_nbs);
int obi_save_and_close_view(Obiview_p view);
/**
* @brief Goes through all the view files of a DMS and deletes views that have
* not been flagged as finished (file extension renamed from '.obiview_unfinished'
* to '.obiview' and finished boolean set to true in the file, done by finish_view()).
*
* @param dms A pointer on an OBIDMS.
*
* @returns A value indicating the success of the operation.
* @retval 0 if the operation was successfully completed.
* @retval -1 if an error occurred.
*
* @since October 2017
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
int obi_clean_unfinished_views(OBIDMS_p dms);
/**
* @brief Frees and deletes an opened, writable view and the columns it created.
*
* The view and column files are deleted and the structures are freed.
*
* @warning The view pointer becomes invalid, as well as the pointers on
* the columns created by the view.
*
* @param view A pointer on the writable view to rollback.
*
* @returns A value indicating the success of the operation.
* @retval 0 if the operation was successfully completed.
* @retval -1 if an error occurred.
*
* @since October 2017
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
int obi_rollback_view(Obiview_p view);
/**
* @brief Creates an OBI_INT column with the line count of the view it belongs to, and sets all lines to 1.
*