Added the lists of opened columns and arrays in the OBIDMS structure,

and a counter in the OBIDMS column structure; fixed some bugs and
created tests for referring columns that are bound to disappear anyway.
This commit is contained in:
Celine Mercier
2015-12-02 17:32:07 +01:00
parent b45b496b0e
commit 1586956d57
8 changed files with 331 additions and 142 deletions

View File

@ -25,10 +25,30 @@
#include "obierrno.h"
#define OBIDMS_MAX_NAME (2048) /**< The maximum length of an OBIDMS name.
*/
#define ARRAYS_DIR_NAME "arrays" /**< The name of the arrays directory.
*/
#define OBIDMS_MAX_NAME (2048) /**< The maximum length of an OBIDMS name.
*/
#define ARRAYS_DIR_NAME "arrays" /**< The name of the arrays directory.
*/
#define MAX_NB_OPENED_COLUMNS (100) /**< The maximum number of columns open at the same time.
*/
#define MAX_NB_OPENED_ARRAYS (100) /**< The maximum number of arrays open at the same time.
*/
struct OBIDMS_column; // TODO
typedef struct Opened_columns_list {
size_t nb_opened_columns;
struct OBIDMS_column** columns;
} Opened_columns_list_t, *Opened_columns_list_p;
struct OBIDMS_array; // TODO
typedef struct Opened_arrays_list {
size_t nb_opened_arrays;
struct OBIDMS_array** arrays;
} Opened_arrays_list_t, *Opened_arrays_list_p;
/**
@ -38,23 +58,27 @@
* and opening of an OBITools Data Management System (DMS)
*/
typedef struct OBIDMS {
char directory_name[OBIDMS_MAX_NAME+1]; /**< The name of the directory
* containing the DMS.
*/
DIR* directory; /**< A directory entry usable to
* refer and scan the database directory.
*/
int dir_fd; /**< The file descriptor of the directory entry
* usable to refer and scan the database directory.
*/
DIR* array_directory; /**< A directory entry usable to
* refer and scan the array directory.
*/
int array_dir_fd; /**< The file descriptor of the directory entry
* usable to refer and scan the array directory.
*/
bool little_endian; /**< Endianness of the database.
*/
char directory_name[OBIDMS_MAX_NAME+1]; /**< The name of the directory
* containing the DMS.
*/
DIR* directory; /**< A directory entry usable to
* refer and scan the database directory.
*/
int dir_fd; /**< The file descriptor of the directory entry
* usable to refer and scan the database directory.
*/
DIR* array_directory; /**< A directory entry usable to
* refer and scan the array directory.
*/
int array_dir_fd; /**< The file descriptor of the directory entry
* usable to refer and scan the array directory.
*/
bool little_endian; /**< Endianness of the database.
*/
Opened_columns_list_p opened_columns; /**< List of opened columns.
*/
Opened_arrays_list_p opened_arrays; /**< List of opened arrays.
*/
} OBIDMS_t, *OBIDMS_p;