When retrieving the header of a column, the version number of the column

wanted can now be provided.
This commit is contained in:
Celine Mercier
2015-11-10 13:30:10 +01:00
parent 8ce4f264aa
commit 410e2e02a0
4 changed files with 17 additions and 11 deletions

View File

@ -1185,14 +1185,13 @@ void obi_ini_to_NA_values(OBIDMS_column_p column,
}
OBIDMS_column_header_p obi_column_get_header_from_name(OBIDMS_p dms, const char* column_name) // TODO ADD VERSION ARGUMENT
OBIDMS_column_header_p obi_column_get_header_from_name(OBIDMS_p dms, const char* column_name, obiversion_t version_number)
{
OBIDMS_column_header_p header;
OBIDMS_column_directory_p column_directory;
char* column_file_name;
int column_file_descriptor;
size_t header_size;
obiversion_t version_number;
// Get the column directory structure associated to the column
column_directory = obi_open_column_directory(dms, column_name);
@ -1202,12 +1201,15 @@ OBIDMS_column_header_p obi_column_get_header_from_name(OBIDMS_p dms, const char*
return NULL;
}
// Get the latest version number
version_number = obi_get_latest_version_number(column_directory);
// Get the latest version number if not provided
if (version_number < 0)
{
obidebug(1, "\nError getting the latest version number in a column directory");
return NULL;
version_number = obi_get_latest_version_number(column_directory);
if (version_number < 0)
{
obidebug(1, "\nError getting the latest version number in a column directory");
return NULL;
}
}
// Get the column file name