deps/kb_meme/meme-5.0.1/src/prior-reader-from-psp.c
/******************************************************************************
 * Sets the state of the reader to the positon before the last data block was
 * read. Only the immediately previous get_next_data_block() can be undone.
 * 
 * Returns true if it was able to undo the get_next_block(), false otherwise.
 * Dies if other errors encountered.
 *****************************************************************************/
Sets the state of the reader to the positon before the last data block was
read. Only the immediately previous get_next_data_block() can be undone.

Returns true if it was able to undo the get_next_block(), false otherwise.
Dies if other errors encountered.
Sets the state of the reader to the positon before the last data block was read . Only the immediately previous get_next_data_block () can be undone . Returns true if it was able to undo the get_next_block () false otherwise . Dies if other errors encountered .
bool unget_data_block_from_psp(DATA_BLOCK_READER_T *reader) {
  bool result = false;
  PSP_DATA_BLOCK_READER_T *psp_reader 
    = (PSP_DATA_BLOCK_READER_T *) get_data_block_reader_data(reader);
  if (psp_reader->prev_block_position) {
    errno = 0;
    int e = fseek(psp_reader->psp_file, psp_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", 
        psp_reader->filename, 
        strerror(errno)
      );
    }
    else {
      --psp_reader->current_position;
      psp_reader->prev_block_position = 0;
      result = true;
    }
  }
  return result;
}
bool unget_data_block_from_psp ( DATA_BLOCK_READER_T * reader ) { bool result = false ; PSP_DATA_BLOCK_READER_T * psp_reader = ( PSP_DATA_BLOCK_READER_T * ) get_data_block_reader_data ( reader ) ; if ( psp_reader -> prev_block_position ) { errno = 0 ; int e = fseek ( psp_reader -> psp_file , psp_reader -> prev_block_position , SEEK_SET ) ; if ( e ) { die ( " " " \n \n " , psp_reader -> filename , strerror ( errno ) ) ; } else { -- psp_reader -> current_position ; psp_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 .