- if (is_uncompressed) strcat(out_mode, "u");
- if (argc == optind) return usage(is_long_help);
+ if (compress_level >= 0) {
+ char tmp[2];
+ tmp[0] = compress_level + '0'; tmp[1] = '\0';
+ strcat(out_mode, tmp);
+ }
+ if (argc == optind) return usage(is_long_help); // potential memory leak...
+
+ // read the list of read groups
+ if (fn_rg) {
+ FILE *fp_rg;
+ char buf[1024];
+ int ret;
+ g_rghash = kh_init(rg);
+ fp_rg = fopen(fn_rg, "r");
+ while (!feof(fp_rg) && fscanf(fp_rg, "%s", buf) > 0) // this is not a good style, but bear me...
+ kh_put(rg, g_rghash, strdup(buf), &ret); // we'd better check duplicates...
+ fclose(fp_rg);
+ }