deps/kb_meme/meme-5.0.1/src/seq-reader-from-fasta.c
/******************************************************************************
 * This function resets a sequence FASTA reader UDT.
 *****************************************************************************/
This function resets a sequence FASTA reader UDT.
This function resets a sequence FASTA reader UDT .
bool reset_seq_reader_from_fasta(DATA_BLOCK_READER_T *reader) {
  SEQ_READER_FROM_FASTA_T *fasta_reader 
    = (SEQ_READER_FROM_FASTA_T *) get_data_block_reader_data(reader);
  if (fasta_reader->fasta_file == stdin) {
    die("Unable to rewind when reading sequence from standard input\n");
  }
  else {
    rewind(fasta_reader->fasta_file);
  }
  memset(fasta_reader->seq_buffer, 0, BUFFER_SIZE);
  fasta_reader->seq_buffer_index = 0;
  fasta_reader->seq_buffer_last = 0;
  fasta_reader->current_position = -1;
  fasta_reader->at_end_of_file = false;
  fasta_reader->at_start_of_line = true;
  fasta_reader->at_end_of_seq = false;
  return true;
}
bool reset_seq_reader_from_fasta ( DATA_BLOCK_READER_T * reader ) { SEQ_READER_FROM_FASTA_T * fasta_reader = ( SEQ_READER_FROM_FASTA_T * ) get_data_block_reader_data ( reader ) ; if ( fasta_reader -> fasta_file == stdin ) { die ( " \n " ) ; } else { rewind ( fasta_reader -> fasta_file ) ; } memset ( fasta_reader -> seq_buffer , 0 , BUFFER_SIZE ) ; fasta_reader -> seq_buffer_index = 0 ; fasta_reader -> seq_buffer_last = 0 ; fasta_reader -> current_position = -1 ; fasta_reader -> at_end_of_file = false ; fasta_reader -> at_start_of_line = true ; fasta_reader -> at_end_of_seq = false ; return true ; }
This function resets a sequence FASTA reader UDT.
This function resets a sequence FASTA reader UDT .
// TODO it would be nice if this could be made to work using temporary files