Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/klib/blob/master/test/kseq_test.c # klib [Ported from github.com/attractivechaos/klib] added block arena Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `klib / test / kseq_test.c` 27 lines ยท 598 bytes Raw Blame History 1 #include 2 #include 3 #include "kseq.h" 4 KSEQ_INIT(gzFile, gzread) 5 6 int main(int argc, char *argv[]) 7 { 8 gzFile fp; 9 kseq_t *seq; 10 int l; 11 if (argc == 1) { 12 fprintf(stderr, "Usage: %s \n", argv[0]); 13 return 1; 14 } 15 fp = gzopen(argv[1], "r"); 16 seq = kseq_init(fp); 17 while ((l = kseq_read(seq)) >= 0) { 18 printf("name: %s\n", seq->name.s); 19 if (seq->comment.l) printf("comment: %s\n", seq->comment.s); 20 printf("seq: %s\n", seq->seq.s); 21 if (seq->qual.l) printf("qual: %s\n", seq->qual.s); 22 } 23 printf("return value: %d\n", l); 24 kseq_destroy(seq); 25 gzclose(fp); 26 return 0; 27 }