Added signal catching and handling in C and Cython

This commit is contained in:
Celine Mercier
2019-09-21 16:47:22 +02:00
parent 06f9d6da60
commit ec0737a600
23 changed files with 178 additions and 25 deletions

View File

@ -25,6 +25,7 @@
#include "obidms.h"
#include "obidebug.h"
#include "obierrno.h"
#include "obisig.h"
#include "obitypes.h"
#include "obiview.h"
#include "obidmscolumn.h"
@ -273,6 +274,8 @@ int obi_ecotag(const char* dms_name,
buffer_size = 1024;
best_match_ids_buffer_size = 1024;
signal(SIGINT, sig_handler);
// Open main DMS containing the query sequences and where the output will be written
dms = obi_open_dms(dms_name, false);
if (dms == NULL)
@ -471,6 +474,9 @@ int obi_ecotag(const char* dms_name,
for (j=0; j < ref_count; j++)
{
if (! keep_running)
return -1;
// Get reference sequence and its index
ref_seq_idx = obi_get_index_with_elt_idx_and_col_p_in_view(ref_view, ref_seq_column, j, 0);
blob2 = obi_get_blob_with_elt_idx_and_col_p_in_view(ref_view, ref_seq_column, j, 0);