Closes #34
This commit is contained in:
@ -209,7 +209,7 @@ int create_obiview_file(int dms_file_descriptor)
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
Obiview_p obi_new_view_nuc_seqs(OBIDMS_p dms, const char* view_name, Obiview_p view_to_clone, index_t* line_selection)
|
||||
Obiview_p obi_new_view_nuc_seqs(OBIDMS_p dms, const char* view_name, Obiview_p view_to_clone, index_t* line_selection, const char* comments)
|
||||
{
|
||||
Obiview_p view;
|
||||
|
||||
@ -223,7 +223,7 @@ Obiview_p obi_new_view_nuc_seqs(OBIDMS_p dms, const char* view_name, Obiview_p v
|
||||
}
|
||||
}
|
||||
|
||||
view = obi_new_view(dms, view_name, view_to_clone, line_selection);
|
||||
view = obi_new_view(dms, view_name, view_to_clone, line_selection, comments);
|
||||
|
||||
strcpy(view->view_type, VIEW_TYPE_NUC_SEQS);
|
||||
|
||||
@ -253,7 +253,7 @@ Obiview_p obi_new_view_nuc_seqs(OBIDMS_p dms, const char* view_name, Obiview_p v
|
||||
}
|
||||
|
||||
|
||||
Obiview_p obi_new_view(OBIDMS_p dms, const char* view_name, Obiview_p view_to_clone, index_t* line_selection)
|
||||
Obiview_p obi_new_view(OBIDMS_p dms, const char* view_name, Obiview_p view_to_clone, index_t* line_selection, const char* comments)
|
||||
{
|
||||
Obiview_p view;
|
||||
int i;
|
||||
@ -278,7 +278,7 @@ Obiview_p obi_new_view(OBIDMS_p dms, const char* view_name, Obiview_p view_to_cl
|
||||
return NULL;
|
||||
}
|
||||
|
||||
view->dms = dms;
|
||||
view->dms = dms;
|
||||
view->column_count = view_to_clone->column_count;
|
||||
if ((view_to_clone->line_selection != NULL) && (line_selection == NULL)) // reorder conditions
|
||||
{
|
||||
@ -359,13 +359,14 @@ Obiview_p obi_new_view(OBIDMS_p dms, const char* view_name, Obiview_p view_to_cl
|
||||
}
|
||||
|
||||
strcpy(view->name, view_name);
|
||||
strcpy(view->comments, comments);
|
||||
view->read_only = 0;
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
Obiview_p obi_new_view_cloned_from_name(OBIDMS_p dms, const char* view_name, const char* view_to_clone_name, index_t* line_selection)
|
||||
Obiview_p obi_new_view_cloned_from_name(OBIDMS_p dms, const char* view_name, const char* view_to_clone_name, index_t* line_selection, const char* comments)
|
||||
{
|
||||
Obiview_p view;
|
||||
Obiview_p view_to_clone;
|
||||
@ -373,7 +374,7 @@ Obiview_p obi_new_view_cloned_from_name(OBIDMS_p dms, const char* view_name, con
|
||||
view_to_clone = obi_open_view(dms, view_to_clone_name);
|
||||
if (view_to_clone == NULL)
|
||||
return NULL;
|
||||
view = obi_new_view(dms, view_name, view_to_clone, line_selection);
|
||||
view = obi_new_view(dms, view_name, view_to_clone, line_selection, comments);
|
||||
|
||||
obi_close_view(view_to_clone);
|
||||
|
||||
@ -381,7 +382,7 @@ Obiview_p obi_new_view_cloned_from_name(OBIDMS_p dms, const char* view_name, con
|
||||
}
|
||||
|
||||
|
||||
Obiview_p obi_new_view_nuc_seqs_cloned_from_name(OBIDMS_p dms, const char* view_name, const char* view_to_clone_name, index_t* line_selection)
|
||||
Obiview_p obi_new_view_nuc_seqs_cloned_from_name(OBIDMS_p dms, const char* view_name, const char* view_to_clone_name, index_t* line_selection, const char* comments)
|
||||
{
|
||||
Obiview_p view;
|
||||
Obiview_p view_to_clone;
|
||||
@ -389,7 +390,7 @@ Obiview_p obi_new_view_nuc_seqs_cloned_from_name(OBIDMS_p dms, const char* view_
|
||||
view_to_clone = obi_open_view(dms, view_to_clone_name);
|
||||
if (view_to_clone == NULL)
|
||||
return NULL;
|
||||
view = obi_new_view_nuc_seqs(dms, view_name, view_to_clone, line_selection);
|
||||
view = obi_new_view_nuc_seqs(dms, view_name, view_to_clone, line_selection, comments);
|
||||
|
||||
obi_close_view(view_to_clone);
|
||||
|
||||
@ -532,6 +533,7 @@ Obiview_p obi_open_view(OBIDMS_p dms, const char* view_name)
|
||||
strcpy(view->created_from, view_infos->created_from);
|
||||
strcpy(view->name, view_infos->name);
|
||||
strcpy(view->view_type, view_infos->view_type);
|
||||
strcpy(view->comments, view_infos->comments);
|
||||
|
||||
// Open the columns to read
|
||||
for (i=0; i<(view_infos->column_count); i++)
|
||||
@ -1033,6 +1035,7 @@ int obi_save_view(Obiview_p view)
|
||||
strcpy(view_infos->created_from, view->created_from);
|
||||
strcpy(view_infos->name, view->name);
|
||||
strcpy(view_infos->view_type, view->view_type);
|
||||
strcpy(view_infos->comments, view->comments);
|
||||
|
||||
// Store reference for the line selection associated with that view
|
||||
if (view->new_line_selection != NULL)
|
||||
|
@ -26,8 +26,10 @@
|
||||
#include "obierrno.h"
|
||||
|
||||
|
||||
#define OBIVIEW_NAME_MAX_LENGTH (10239) /**< The maximum length of an OBIDMS view name.
|
||||
*/
|
||||
#define OBIVIEW_NAME_MAX_LENGTH (1000) /**< The maximum length of an OBIDMS view name.
|
||||
*/
|
||||
#define OBIVIEW_COMMENTS_MAX_LENGTH (10000)
|
||||
|
||||
#define OBIVIEW_FILE_NAME "obiviews"
|
||||
|
||||
#define VIEW_TYPE_MAX_NAME (1024)
|
||||
@ -84,6 +86,8 @@ typedef struct Obiview {
|
||||
|
||||
char view_type[VIEW_TYPE_MAX_NAME+1];
|
||||
|
||||
char comments[OBIVIEW_COMMENTS_MAX_LENGTH+1];
|
||||
|
||||
} Obiview_t, *Obiview_p;
|
||||
|
||||
|
||||
@ -111,6 +115,8 @@ typedef struct Obiview_infos {
|
||||
|
||||
char view_type[VIEW_TYPE_MAX_NAME+1];
|
||||
|
||||
char comments[OBIVIEW_COMMENTS_MAX_LENGTH+1];
|
||||
|
||||
} Obiview_infos_t, *Obiview_infos_p;
|
||||
|
||||
|
||||
@ -135,13 +141,13 @@ typedef struct Obiviews_infos_all {
|
||||
} Obiviews_infos_all_t, *Obiviews_infos_all_p;
|
||||
|
||||
|
||||
Obiview_p obi_new_view_nuc_seqs(OBIDMS_p dms, const char* view_name, Obiview_p view_to_clone, index_t* line_selection);
|
||||
Obiview_p obi_new_view_nuc_seqs(OBIDMS_p dms, const char* view_name, Obiview_p view_to_clone, index_t* line_selection, const char* comments);
|
||||
|
||||
Obiview_p obi_new_view(OBIDMS_p dms, const char* view_name, Obiview_p view_to_clone, index_t* line_selection);
|
||||
Obiview_p obi_new_view(OBIDMS_p dms, const char* view_name, Obiview_p view_to_clone, index_t* line_selection, const char* comments);
|
||||
|
||||
Obiview_p obi_new_view_cloned_from_name(OBIDMS_p dms, const char* view_name, const char* view_to_clone_name, index_t* line_selection);
|
||||
Obiview_p obi_new_view_cloned_from_name(OBIDMS_p dms, const char* view_name, const char* view_to_clone_name, index_t* line_selection, const char* comments);
|
||||
|
||||
Obiview_p obi_new_view_nuc_seqs_cloned_from_name(OBIDMS_p dms, const char* view_name, const char* view_to_clone_name, index_t* line_selection);
|
||||
Obiview_p obi_new_view_nuc_seqs_cloned_from_name(OBIDMS_p dms, const char* view_name, const char* view_to_clone_name, index_t* line_selection, const char* comments);
|
||||
|
||||
Obiview_p obi_open_view(OBIDMS_p dms, const char* view_name);
|
||||
|
||||
|
Reference in New Issue
Block a user