deps/kb_meme/meme-5.0.1/src/motif-in.c
/*
 * Update the parsers.
 *
 * Send all parsers the information until they error or one produces a motif.
 * Once a parser has produced a motif then assume it is the correct parser and
 * only send data to it. If no parsers produce motifs by then end of the file
 * then sort the parsers by the most likely file match, eliminate any which
 * have an unlikely match, and print the errors for the most likely file type 
 * matches (in case of a tie multiple are allowed).
 */
Update the parsers.
Send all parsers the information until they error or one produces a motif.
Once a parser has produced a motif then assume it is the correct parser and
only send data to it. If no parsers produce motifs by then end of the file
then sort the parsers by the most likely file match, eliminate any which
have an unlikely match, and print the errors for the most likely file type
matches (in case of a tie multiple are allowed).
Update the parsers . Send all parsers the information until they error or one produces a motif . Once a parser has produced a motif then assume it is the correct parser and only send data to it . If no parsers produce motifs by then end of the file then sort the parsers by the most likely file match eliminate any which have an unlikely match and print the errors for the most likely file type matches ( in case of a tie multiple are allowed ) .
void mread_update(MREAD_T *mread, const char *buffer, size_t size, short end) {
  int i;
  for (i = (mread->valid - 1); i >= 0; --i) {
    update_parser(mread, mread->formats+i, buffer, size, end);
    if (mread->success) break; 
  }
  output_errors(mread, end);
}
void mread_update ( MREAD_T * mread , const char * buffer , size_t size , short end ) { int i ; for ( i = ( mread -> valid - 1 ) ; i >= 0 ; -- i ) { update_parser ( mread , mread -> formats + i , buffer , size , end ) ; if ( mread -> success ) break ; } output_errors ( mread , end ) ; }
Update the parsers.
Update the parsers .
// avoid sending the same chunk twice