deps/kb_meme/meme-5.0.1/src/seq-reader-from-fasta.c
/******************************************************************************
 * Sets the state of the reader to the positon before the last data block was
 * read
 * 
 * Returns true if it was able to rewind the reader, false otherwise.
 * Dies if other errors encountered.
 *****************************************************************************/
Sets the state of the reader to the positon before the last data block was
read

Returns true if it was able to rewind the reader, false otherwise.
Dies if other errors encountered.
Sets the state of the reader to the positon before the last data block was read Returns true if it was able to rewind the reader false otherwise . Dies if other errors encountered .
bool unget_data_block_from_seq_reader_from_fasta(
  DATA_BLOCK_READER_T *reader
) {
  bool result = false;
  SEQ_READER_FROM_FASTA_T *fasta_reader 
    = (SEQ_READER_FROM_FASTA_T *) get_data_block_reader_data(reader);
  if (fasta_reader->prev_block_position) {
    errno = 0;
    int e = fseek(fasta_reader->fasta_file, fasta_reader->prev_block_position, SEEK_SET);
    if (e) {
      die(
        "Error when trying to unget data block in prior PSP file: "
        "%s.\nError message: %s.\n", 
        fasta_reader->filename, 
        strerror(errno)
      );
    }
    else {
      --fasta_reader->current_position;
      fasta_reader->prev_block_position = 0;
      result = true;
    }
  }
  return result;
}
bool unget_data_block_from_seq_reader_from_fasta ( DATA_BLOCK_READER_T * reader ) { bool result = false ; SEQ_READER_FROM_FASTA_T * fasta_reader = ( SEQ_READER_FROM_FASTA_T * ) get_data_block_reader_data ( reader ) ; if ( fasta_reader -> prev_block_position ) { errno = 0 ; int e = fseek ( fasta_reader -> fasta_file , fasta_reader -> prev_block_position , SEEK_SET ) ; if ( e ) { die ( " " " \n \n " , fasta_reader -> filename , strerror ( errno ) ) ; } else { -- fasta_reader -> current_position ; fasta_reader -> prev_block_position = 0 ; result = true ; } } return result ; }
Sets the state of the reader to the positon before the last data block was
 read
Sets the state of the reader to the positon before the last data block was read