View files now have a dynamic size to allow unlimited comments size

This commit is contained in:
Celine Mercier
2016-08-18 17:57:03 +02:00
parent e4129610cf
commit 7b780ffb28
2 changed files with 173 additions and 19 deletions

View File

@ -30,9 +30,6 @@
#define OBIVIEW_NAME_MAX_LENGTH (1000) /**< The maximum length of an OBIDMS view name.
*/
#define OBIVIEW_COMMENTS_MAX_LENGTH (10000) /**< The maximum length of the comments associated
* with a view.
*/
#define VIEW_TYPE_MAX_LENGTH (1024) /**< The maximum length of the type name of a view.
*/
#define LINES_COLUMN_NAME "LINES" /**< The name of the column containing the line selections
@ -73,6 +70,10 @@ typedef struct Alias_column_pair {
* Once a view has been written in the view file, it can not be modified and can only be read.
*/
typedef struct Obiview_infos {
size_t file_size; /**< View file size in bytes.
*/
size_t used_size; /**< Used size in bytes.
*/
time_t creation_date; /**< Time at which the view was written in the view file.
*/
char name[OBIVIEW_NAME_MAX_LENGTH+1]; /**< Name of the view, used to identify it.
@ -92,7 +93,7 @@ typedef struct Obiview_infos {
*/
Alias_column_pair_t column_references[MAX_NB_OPENED_COLUMNS]; /**< References (name, version and alias) for all the columns in the view.
*/
char comments[OBIVIEW_COMMENTS_MAX_LENGTH+1]; /**< Comments, additional informations on the view.
char comments[]; /**< Comments, additional informations on the view.
*/
} Obiview_infos_t, *Obiview_infos_p;