forked from qtrinh/qpipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
my_math.c
56 lines (36 loc) · 1.07 KB
/
my_math.c
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
//
// written by Quang M Trinh <[email protected]>
//
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "my_math.h"
/**
**/
void my_math_MODE_MATH_LOG_TEN(struct input_data *id, struct output_data *od, int col) {
struct vcf * myVCF = vcf_init();
id->inputFile = fopen(id->inputFileName, "r");
if (id->inputFile == NULL) {
printf ("\n[%s:%d] - error open file '%s'", __FILE__, __LINE__, id->inputFileName);
printf ("\n\n");
exit (1);
}
// read input file
while ((fgets(id->line, MAX_CHAR_PER_LINE, id->inputFile) != NULL)) {
if (id->line[0] == '#') {
printf ("%s", id->line);
continue;
}
if (id->verbose) {
printf ("\n%s\n", LINE_DIVIDER_LONG);
printf ("[%s:%d] - %s", __FILE__, __LINE__, id->line);
}
// remove '\n'
id->line[strlen(id->line)-1] = '\0';
id->columns = input_data_parseLineMem(id, id->line, '\t', &(id->n));
if (id->verbose)
input_data_printParsedLineMemDebugging(id->columns, id->n);
input_data_freeMem(id->columns, id->n);
}
fclose(id->inputFile);
}