-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmutils.h
64 lines (48 loc) · 1.2 KB
/
mutils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// Created by lisanhu on 9/16/18.
//
#ifndef ACCSEQV8_MUTILS_H
#define ACCSEQV8_MUTILS_H
#define ACC_PARALLEL 1
#define OMP_PARALLEL 2
#ifndef MP_PARALLELISM
#define MP_PARALLELISM OMP_PARALLEL
#endif
#if MP_PARALLELISM == OMP_PARALLEL
#include <omp.h>
#endif
#include <stdint.h>
#include <time.h>
#include <stdio.h>
#include <stdbool.h>
#include "gact/gact.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* mstring class
*/
typedef struct mstring {
uint64_t l;
char *s;
int own;
} mstring;
char * cstr_concat(const char *s1, const char *s2);
mstring mstring_from(char *s, bool own);
#pragma acc routine
mstring mstring_borrow(char *s, size_t l);
mstring mstring_own(const char *s, size_t l);
mstring mstring_clone(mstring ms);
void mstring_destroy(mstring *ms);
void mstring_write(mstring ms, FILE *fp);
size_t mstring_read(mstring *ms, FILE *fp);
double time_elapse(struct timespec start);
size_t file_length(const char *path);
const char * load_file(const char *path, uint64_t *len);
#pragma acc routine
cigar cigar_align(const char *qry, int qlen, const char *target, int tlen,
int *limit, uint8_t *cigar_result);
#ifdef __cplusplus
};
#endif
#endif //ACCSEQV8_MUTILS_H