 
 using namespace nvbio;
 
-bool read(const char* reads_name, FILE* output_file, const io::QualityEncoding qencoding, const io::SequenceEncoding flags)
+bool to_ascii(const char* reads_name, void* output_file, void* output_index, const io::QualityEncoding qencoding, const io::SequenceEncoding flags)
 {
     log_visible(stderr, "opening read file \"%s\"\n", reads_name);
     SharedPointer<nvbio::io::SequenceDataStream> read_data_file(

        {
            reverse = false;
        }
    }

    FILE* output_file = fopen( out_name, "w" );
    if (output_file == NULL)
    {
        log_error(stderr, "    failed opening file \"%s\"\n", out_name);
        return 1;
    }

    log_visible(stderr,"nvExtractReads... started\n");

    if (forward) encoding_flags |= io::FORWARD;
    if (reverse) encoding_flags |= io::REVERSE_COMPLEMENT;

    bool success;

    switch (format)
    {
    case ASCII:
        success = to_ascii( reads_name, output_file, output_index, qencoding, io::SequenceEncoding(encoding_flags) );
        break;
    case PACKED2:
        success = to_packed<2u>( reads_name, output_file, output_index, qencoding, io::SequenceEncoding(encoding_flags) );
        break;
    case PACKED4:
        success = to_packed<4u>( reads_name, output_file, output_index, qencoding, io::SequenceEncoding(encoding_flags) );
        break;
    }

    if (output_file)  gzclose( output_file );
    if (output_index) gzclose( output_index );

    log_visible(stderr,"nvExtractReads... done\n");
    return success ? 0u : 1u;
}
