deps/kb_meme/meme-5.0.1/src/motif-in.c
/*
 * Update the parser and reorganise the formats list
 * if an error occurs or the parser produces a motif
 * and is selected.
 */
Update the parser and reorganise the formats list
if an error occurs or the parser produces a motif
and is selected.
Update the parser and reorganise the formats list if an error occurs or the parser produces a motif and is selected .
static void update_parser(
  MREAD_T *mread, 
  MFORMAT_T *format,  
  const char *buffer, 
  size_t size, 
  short end
) {
  format->update(format->data, buffer, size, end);
  if (format->has_error(format->data)) {
    format->valid = false;
    if (format != mread->formats+(mread->valid - 1)) {
      MFORMAT_T temp;
      temp = *format;
      *format = mread->formats[mread->valid -1];
      mread->formats[mread->valid -1] = temp;
    }
    mread->valid--;
  } else if (!mread->success && format->has_motif(format->data)) {
    if (format != mread->formats) {
      MFORMAT_T temp;
      temp = *format;
      *format = mread->formats[0];
      mread->formats[0] = temp;
    }
    mread->valid = 1;
    mread->success = true;
    parser_selected(mread);
  }
}
static void update_parser ( MREAD_T * mread , MFORMAT_T * format , const char * buffer , size_t size , short end ) { format -> update ( format -> data , buffer , size , end ) ; if ( format -> has_error ( format -> data ) ) { format -> valid = false ; if ( format != mread -> formats + ( mread -> valid - 1 ) ) { MFORMAT_T temp ; temp = * format ; * format = mread -> formats [ mread -> valid - 1 ] ; mread -> formats [ mread -> valid - 1 ] = temp ; } mread -> valid -- ; } else if ( ! mread -> success && format -> has_motif ( format -> data ) ) { if ( format != mread -> formats ) { MFORMAT_T temp ; temp = * format ; * format = mread -> formats [ 0 ] ; mread -> formats [ 0 ] = temp ; } mread -> valid = 1 ; mread -> success = true ; parser_selected ( mread ) ; } }
Update the parser and reorganise the formats list
 if an error occurs or the parser produces a motif
 and is selected.
Update the parser and reorganise the formats list if an error occurs or the parser produces a motif and is selected .
// update the parser // reorganise the parser list // error occurred! parser not valid // not the last valid in the list so we have to swap // decrement valid count // a parser is chosen! // not the first in the list so swap into first position