Commit 87935c66 by Celine Mercier

Fixed all compilation problems with new function names, locations etc

parent 92980508
......@@ -6,9 +6,10 @@ from .capi.obidms cimport obi_dms, \
obi_close_dms
from .capi.obidmscolumn cimport obi_close_column, \
obi_column_format_date, \
OBIDMS_column_p, \
OBIDMS_column_header_p
from .capi.obiutils cimport obi_format_date
from .capi.obitypes cimport const_char_p, \
OBIType_t, \
......@@ -57,8 +58,8 @@ from .capi.obiview cimport Obiview_p, \
obi_new_view_cloned_from_name, \
obi_new_view_nuc_seqs_cloned_from_name, \
obi_open_view, \
obi_read_views, \
obi_unmap_read_views, \
obi_read_view_infos, \
obi_close_view_infos, \
obi_view_delete_column, \
obi_view_add_column, \
obi_view_get_column, \
......@@ -131,7 +132,7 @@ cdef class OBIDMS_column :
return (self.pointer)[0].header.lines_used
cpdef str get_creation_date(self):
return bytes2str(obi_column_format_date((self.pointer)[0].header.creation_date))
return bytes2str(obi_format_date((self.pointer)[0].header.creation_date))
cpdef str get_comments(self):
return bytes2str((self.pointer)[0].header.comments)
......@@ -703,7 +704,7 @@ cdef class OBIDMS :
cdef bytes name_b
views = {}
all_views_p = obi_read_views(self.pointer)
all_views_p = obi_read_view_infos(self.pointer)
if all_views_p == NULL :
raise Exception("No views to read")
nb_views = <int> (all_views_p.header).view_count
......@@ -717,7 +718,7 @@ cdef class OBIDMS :
views[view_name]["line_count"] = <int> view_p.line_count
views[view_name]["view_number"] = <int> view_p.view_number
views[view_name]["created_from"] = bytes2str(view_p.created_from)
views[view_name]["creation_date"] = bytes2str(obi_column_format_date(view_p.creation_date)) # TODO move this function in utils or somethings
views[view_name]["creation_date"] = bytes2str(obi_format_date(view_p.creation_date)) # TODO move this function in utils or somethings
if (view_p.all_lines) :
views[view_name]["line_selection"] = None
else :
......@@ -731,7 +732,7 @@ cdef class OBIDMS :
views[view_name]["column_references"][column_name] = {}
views[view_name]["column_references"][column_name]["version"] = column_refs[j].version
obi_unmap_read_views(all_views_p);
obi_close_view_infos(all_views_p);
return views
......
......@@ -70,8 +70,6 @@ cdef extern from "obidmscolumn.h" nogil:
obiversion_t version_number)
int obi_close_header(OBIDMS_column_header_p header)
char* obi_column_format_date(time_t date)
int obi_select(OBIDMS_column_p line_selection_column, index_t line_to_grep)
......
#cython: language_level=3
from posix.types cimport time_t
from ..capi.obitypes cimport const_char_p
cdef extern from "utils.h" nogil:
const_char_p obi_format_date(time_t date)
......@@ -84,10 +84,6 @@ cdef extern from "obiview.h" nogil:
Obiview_p obi_open_view(OBIDMS_p dms, const_char_p view_name)
Obiviews_infos_all_p obi_read_views(OBIDMS_p dms)
int obi_unmap_read_views(Obiviews_infos_all_p views)
int obi_view_add_column(Obiview_p view,
const_char_p column_name,
obiversion_t version_number,
......@@ -115,6 +111,10 @@ cdef extern from "obiview.h" nogil:
int obi_save_and_close_view(Obiview_p view)
Obiviews_infos_all_p obi_read_view_infos(OBIDMS_p dms)
int obi_close_view_infos(Obiviews_infos_all_p views)
int obi_column_set_obiint_with_elt_name_in_view(Obiview_p view,
OBIDMS_column_p column,
index_t line_nb,
......
......@@ -435,7 +435,7 @@ Obiview_p obi_new_view(OBIDMS_p dms, const char* view_name, Obiview_p view_to_cl
Obiviews_infos_all_p views_infos;
// Check uniqueness of name TODO but problem if view not written yet has the same name. Save lists of open views in DMS ?
views_infos = obi_read_views(dms);
views_infos = obi_read_view_infos(dms);
if (views_infos != NULL)
{
for (i=0; i<((views_infos->header)->view_count); i++)
......@@ -444,11 +444,11 @@ Obiview_p obi_new_view(OBIDMS_p dms, const char* view_name, Obiview_p view_to_cl
{
obi_set_errno(OBIVIEW_ERROR);
obidebug(1, "\nView name already exists for a previous view");
obi_unmap_read_views(views_infos);
obi_close_view_infos(views_infos);
return NULL;
}
}
obi_unmap_read_views(views_infos);
obi_close_view_infos(views_infos);
}
view = (Obiview_p) malloc(sizeof(Obiview_t));
......@@ -826,7 +826,7 @@ int obi_view_add_column(Obiview_p view,
if (view->line_count > nb_lines)
nb_lines = view->line_count;
else if (nb_lines > view->line_count)
obi_view_update_lines(view, nb_lines);
update_lines(view, nb_lines);
// Open or create the column
if (create)
......
......@@ -72,7 +72,7 @@ typedef struct Obiview {
*/
char created_from[OBIVIEW_NAME_MAX_LENGTH+1]; /**< Name of the view from which that view was cloned if the view was cloned.
*/
char view_type[VIEW_TYPE_MAX_NAME+1]; /**< Type of the view if there is one.
char view_type[VIEW_TYPE_MAX_LENGTH+1]; /**< Type of the view if there is one.
* Types existing: NUC_SEQS_VIEW.
*/
bool read_only; /**< Whether the view is read-only or can be modified.
......@@ -125,7 +125,7 @@ typedef struct Obiview_infos {
*/
char created_from[OBIVIEW_NAME_MAX_LENGTH+1]; /**< Name of the view from which that view was cloned, if it was cloned.
*/
char view_type[VIEW_TYPE_MAX_NAME+1]; /**< Type of the view if there is one.
char view_type[VIEW_TYPE_MAX_LENGTH+1]; /**< Type of the view if there is one.
* Types existing: NUC_SEQS_VIEW.
*/
bool all_lines; /**< Whether there is a line selection associated with the view.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment