Made the handling of listing and unlisting opened columns and indexers
functions in the obidms files.
This commit is contained in:
80
src/obidms.h
80
src/obidms.h
@ -23,6 +23,8 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "obierrno.h"
|
||||
//#include "obidmscolumn.h"
|
||||
//#include "obiblob_indexer.h"
|
||||
|
||||
|
||||
#define OBIDMS_MAX_NAME (2048) /**< The maximum length of an OBIDMS name.
|
||||
@ -35,21 +37,31 @@
|
||||
*/
|
||||
#define MAX_NB_OPENED_INDEXERS (1000) /**< The maximum number of indexers open at the same time.
|
||||
*/
|
||||
#define MAX_PATH_LEN 4096 /**< Maximum length for the character string defining a
|
||||
* file or directory path.
|
||||
*/
|
||||
|
||||
|
||||
typedef int32_t obiversion_t; /**< TODO double
|
||||
*/
|
||||
|
||||
|
||||
struct OBIDMS_column; // TODO
|
||||
typedef struct OBIDMS_column* OBIDMS_column_p;
|
||||
|
||||
typedef struct Opened_columns_list {
|
||||
size_t nb_opened_columns;
|
||||
struct OBIDMS_column** columns; // TODO allocate array size here
|
||||
typedef struct Opened_columns_list { // TODO Handle the problem linked to columns with the same name + means only one version
|
||||
int nb_opened_columns;
|
||||
OBIDMS_column_p columns[MAX_NB_OPENED_COLUMNS];
|
||||
} Opened_columns_list_t, *Opened_columns_list_p;
|
||||
|
||||
|
||||
struct OBIDMS_avl; // TODO
|
||||
struct OBIDMS_avl_group; // TODO
|
||||
typedef struct OBIDMS_avl_group* OBIDMS_avl_group_p;
|
||||
typedef OBIDMS_avl_group_p Obi_indexer_p;
|
||||
|
||||
typedef struct Opened_indexers_list {
|
||||
size_t nb_opened_indexers;
|
||||
struct OBIDMS_avl** indexers; // TODO indexer but not AVL_group
|
||||
int nb_opened_indexers;
|
||||
Obi_indexer_p indexers[MAX_NB_OPENED_INDEXERS];
|
||||
} Opened_indexers_list_t, *Opened_indexers_list_p;
|
||||
|
||||
|
||||
@ -174,4 +186,60 @@ OBIDMS_p obi_dms(const char* dms_name);
|
||||
int obi_close_dms(OBIDMS_p dms);
|
||||
|
||||
|
||||
// TODO doc
|
||||
int obi_dms_is_column_name_in_list(OBIDMS_p dms, const char* column_name);
|
||||
|
||||
|
||||
OBIDMS_column_p obi_dms_get_column_from_list(OBIDMS_p dms, const char* column_name, obiversion_t version);
|
||||
|
||||
|
||||
void obi_dms_list_column(OBIDMS_p dms, OBIDMS_column_p column);
|
||||
|
||||
|
||||
int obi_dms_unlist_column(OBIDMS_p dms, OBIDMS_column_p column);
|
||||
|
||||
|
||||
Obi_indexer_p obi_dms_get_indexer_from_list(OBIDMS_p dms, const char* indexer_name);
|
||||
|
||||
|
||||
void obi_dms_list_indexer(OBIDMS_p dms, Obi_indexer_p indexer);
|
||||
|
||||
|
||||
int obi_dms_unlist_indexer(OBIDMS_p dms, Obi_indexer_p indexer);
|
||||
|
||||
|
||||
/** TODO
|
||||
* @brief Internal function getting the full path of a file or a directory from its
|
||||
* path relative to a directory file descriptor.
|
||||
*
|
||||
* @warning The returned pointer has to be freed by the caller.
|
||||
*
|
||||
* @param directory_file_descriptor The file descriptor for the directory to which
|
||||
* path_name is relative.
|
||||
* @param path_name The path name for the file or directory, relative to directory_file_descriptor.
|
||||
*
|
||||
* @returns A pointer to the full path.
|
||||
* @retval NULL if an error occurred.
|
||||
*
|
||||
* @since June 2015
|
||||
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
||||
*/
|
||||
char* get_full_path(OBIDMS_p dms, const char* path_name);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Replacement function for opendirat() : open a directory relative to a directory file descriptor.
|
||||
*
|
||||
* @param directory_file_descriptor The file descriptor for the directory in which the directory should be opened.
|
||||
* @param path_name The path name for the directory to be opened, relative to directory_file_descriptor.
|
||||
*
|
||||
* @returns The file descriptor of the opened directory.
|
||||
* @retval NULL if an error occurred.
|
||||
*
|
||||
* @since June 2015
|
||||
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
||||
*/
|
||||
DIR* opendir_in_dms(OBIDMS_p dms, const char* path_name);
|
||||
|
||||
|
||||
#endif /* OBIDMS_H_ */
|
||||
|
Reference in New Issue
Block a user