Debian Codegraph @

seagen/hitConverter.C

raw symbols SCIP
1 #cxx . . $ `<file>/seagen/hitConverter.C`/include <stdio.h>
2 #include <stdlib.h>
3 #include "aHit.H"cxx . . $ `<file>/seagen/aHit.H`/
4
5 void
6 bin2asccxx . . $ bin2asc(30d2de35654253c4).(FILE *I, FILE *O) {
7 uint32cxx . . $ uint32# i = 0;
8 aHitcxx . . $ aHit# a;
9
10 fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Converting BINARY to ASCII.\n");
11
12 while (!feof(I)) {
13 ahit_readBinarycxx . . $ ahit_readBinary(6c917abaf95665ca).(&a, I);
14
15 if (!feof(I)) {
16 ahit_printASCIIcxx . . $ ahit_printASCII(6c917abaf95665ca).(&a, O);
17
18 if ((++i & 0xffff) == 0) {
19 fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, uint32FMTcxx . . $ `libutil/util.h:65:10`!" hits.\r", i);
20 fflush(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!);
21 }
22 }
23 }
24
25 fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, uint32FMTcxx . . $ `libutil/util.h:65:10`!" hits.\r", i);
26 fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "\n");
27 }
28
29
30 void
31 asc2bincxx . . $ asc2bin(30d2de35654253c4).(FILE *I, FILE *O) {
32 uint32cxx . . $ uint32# i = 0;
33 aHitcxx . . $ aHit# a;
34 char b[1025];
35
36 fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Converting ASCII to BINARY.\n");
37
38 while (!feof(I)) {
39 fgets(b, 1024, I);
40
41 if (!feof(I)) {
42 ahit_parseStringcxx . . $ ahit_parseString(e8f5be3781ac6c2f).(&a, b);
43 ahit_writeBinarycxx . . $ ahit_writeBinary(6c917abaf95665ca).(&a, O);
44
45 if ((++i & 0xffff) == 0) {
46 fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, uint32FMTcxx . . $ `libutil/util.h:65:10`!" hits.\r", i);
47 fflush(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!);
48 }
49 }
50 }
51
52 fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, uint32FMTcxx . . $ `libutil/util.h:65:10`!" hits.\r", i);
53 fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "\n");
54 }
55
56
57 int
58 maincxx . . $ main(afcd3168fc1188a4).(int argc, char **argv) {
59
60 if (argc != 1) {
61 fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s: I only read stdin and write stdout.\n", argv[0]);
62 exitcxx . . $ exit(44ed87f96534fad7).(1);
63 }
64
65 // If the first character in the stream is ascii, do ASCII -> BINARY.
66 // Else, do BINARY -> ASCII.
67 //
68 char x = (char)fgetc(stdincxx . . $ `<external>/232824719582829767/stdio.h:153:9`!);
69 ungetc(x, stdincxx . . $ `<external>/232824719582829767/stdio.h:153:9`!);
70
71 if (x == '-')
72 asc2bincxx . . $ asc2bin(30d2de35654253c4).(stdincxx . . $ `<external>/232824719582829767/stdio.h:153:9`!, stdoutcxx . . $ `<external>/232824719582829767/stdio.h:154:9`!);
73 else
74 bin2asccxx . . $ bin2asc(30d2de35654253c4).(stdincxx . . $ `<external>/232824719582829767/stdio.h:153:9`!, stdoutcxx . . $ `<external>/232824719582829767/stdio.h:154:9`!);
75
76 return(0);
77 }