Mercurial > repos > bitlab > imsame
comparison IMSAME/src/commonFunctions.h @ 0:762009a91895 draft
Uploaded
author | bitlab |
---|---|
date | Sat, 15 Dec 2018 18:04:10 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:762009a91895 |
---|---|
1 #ifndef COMMON_FUNCTIONS_H | |
2 #define COMMON_FUNCTIONS_H | |
3 #include "structs.h" | |
4 /** | |
5 * Print the error message 's' and exit(-1) | |
6 */ | |
7 void terror(char *s); | |
8 | |
9 | |
10 /** | |
11 * Function to read char by char buffered from a FILE | |
12 */ | |
13 char buffered_fgetc(char *buffer, uint64_t *pos, uint64_t *read, FILE *f); | |
14 | |
15 | |
16 void get_num_seqs_and_length(char * seq_buffer, uint64_t * n_seqs, uint64_t * t_len, LoadingDBArgs * ldbargs); | |
17 | |
18 /* | |
19 Generates a queue of tasks for threads | |
20 */ | |
21 Queue * generate_queue(Head * queue_head, uint64_t t_reads, uint64_t n_threads, uint64_t levels); | |
22 | |
23 /* | |
24 Prints a queue task | |
25 */ | |
26 void print_queue(Queue * q); | |
27 | |
28 /* | |
29 Gets the next task to do when a pthread is free | |
30 */ | |
31 Queue * get_task_from_queue(Head * queue_head, pthread_mutex_t * lock); | |
32 | |
33 uint64_t quick_pow4(uint64_t n); | |
34 | |
35 uint64_t quick_pow4byLetter(uint64_t n, const char c); | |
36 | |
37 uint64_t hashOfWord(const unsigned char * word, uint32_t k); | |
38 | |
39 uint64_t asciiToUint64(const char *text); | |
40 | |
41 #endif /* COMMON_FUNCTIONS_H */ |