+ /* open complement output */
+ FILE* cfout1 = NULL;
+ FILE* cfout2 = NULL;
+
+ if (cprefix != NULL && file2 == NULL) {
+ output_len = strlen(cprefix) + 7;
+ output_name = malloc_or_die((output_len + 1) * sizeof(char));
+
+ snprintf(output_name, output_len, "%s.fastq", cprefix);
+ cfout1 = fopen(output_name, "wb");
+ if (cfout1 == NULL) {
+ fprintf(stderr, "Cannot open file %s for writing.\n", output_name);
+ exit(1);
+ }
+
+ cfout2 = NULL;
+
+ free(output_name);
+ }
+ else if (cprefix != NULL) {
+ output_len = strlen(cprefix) + 9;
+ output_name = malloc_or_die((output_len + 1) * sizeof(char));
+
+ snprintf(output_name, output_len, "%s.1.fastq", cprefix);
+ cfout1 = fopen(output_name, "wb");
+ if (cfout1 == NULL) {
+ fprintf(stderr, "Cannot open file %s for writing.\n", output_name);
+ exit(1);
+ }
+
+ snprintf(output_name, output_len, "%s.2.fastq", cprefix);
+ cfout2 = fopen(output_name, "wb");
+ if (cfout1 == NULL) {
+ fprintf(stderr, "Cannot open file %s for writing.\n", output_name);
+ exit(1);
+ }
+
+ free(output_name);
+ }
+
+