Strong refactoring 1

This commit is contained in:
2016-12-26 13:35:31 +01:00
parent 3cedd00d7f
commit daacd0df76
58 changed files with 732 additions and 1525 deletions

View File

@ -639,7 +639,7 @@ OBIDMS_column_p obi_create_column(OBIDMS_p dms,
obidebug(1, "\nCan't create column because of empty column name");
return NULL;
}
if ((data_type < 1) || (data_type > 8)) // TODO check in more robust way
if ((data_type < 1) || (data_type > 8)) // TODO check in more robust way and use macro define somewhere
{
obi_set_errno(OBICOL_UNKNOWN_ERROR);
obidebug(1, "\nCan't create column because of invalid data type");
@ -665,7 +665,7 @@ OBIDMS_column_p obi_create_column(OBIDMS_p dms,
// Build the indexer name if needed
if ((data_type == OBI_STR) || (data_type == OBI_SEQ) || (data_type == OBI_QUAL))
{
if ((indexer_name == NULL) || (strcmp(indexer_name, "") == 0))
if ((indexer_name == NULL) || (*indexer_name == 0))
{
final_indexer_name = obi_build_indexer_name(column_name, version_number);
if (final_indexer_name == NULL)

View File

@ -102,18 +102,22 @@ typedef struct OBIDMS_column_header {
* creating, opening or cloning an OBIDMS column.
*/
typedef struct OBIDMS_column {
OBIDMS_p dms; /**< A pointer to the OBIDMS structure to which the column belongs.
OBIDMS_p dms; /**< A pointer to the OBIDMS structure to
* which the column belongs.
*/
OBIDMS_column_directory_p column_directory; /**< A pointer to the OBIDMS column directory structure to which the column belongs.
OBIDMS_column_directory_p column_directory; /**< A pointer to the OBIDMS column directory
* structure to which the column belongs.
*/
OBIDMS_column_header_p header; /**< A pointer to the header of the column.
*/
Obi_indexer_p indexer; /**< A pointer to the blob indexer associated with the column if there is one.
Obi_indexer_p indexer; /**< A pointer to the blob indexer associated
* with the column if there is one.
*/
void* data; /**< A `void` pointer to the beginning of the data.
*
* @warning Never use this member directly outside of the code of the
* low level functions of the OBIDMS.
* @warning Never use this member directly outside
* of the code of the low level functions
* of the OBIDMS.
*/
bool writable; /**< Indicates if the column is writable or not.
* - `true` the column is writable
@ -122,7 +126,8 @@ typedef struct OBIDMS_column {
* A column is writable only by its creator
* until it closes it.
*/
size_t counter; /**< Indicates by how many threads/programs (TODO) the column is used.
size_t counter; /**< Indicates by how many threads/programs
* (TODO) the column is used.
*/
} OBIDMS_column_t, *OBIDMS_column_p;