get multi-seg code ready; probably not working yet

This commit is contained in:
Heng Li
2017-09-24 15:17:17 -04:00
parent f0951141a1
commit a742f10164
3 changed files with 40 additions and 20 deletions
+12
View File
@@ -2,6 +2,7 @@
#define MM_BSEQ_H
#include <stdint.h>
#include <string.h>
#ifdef __cplusplus
extern "C" {
@@ -24,6 +25,17 @@ int mm_bseq_eof(mm_bseq_file_t *fp);
extern unsigned char seq_nt4_table[256];
static inline int mm_qname_same(const char *s1, const char *s2)
{
int l1, l2;
l1 = strlen(s1);
l2 = strlen(s2);
if (l1 != l2 || l1 < 3) return 0;
if (!(s1[l1-1] >= '1' && s1[l1-1] <= '2' && s1[l1-2] == '/')) return 0;
if (!(s2[l2-1] >= '1' && s2[l2-1] <= '2' && s2[l2-2] == '/')) return 0;
return (strncmp(s1, s2, l1 - 2) == 0);
}
#ifdef __cplusplus
}
#endif