deps/kb_meme/meme-5.0.1/src/motif-in.c
/*
 * Output any errors produced by the selected parser
 * or if all content has been parsed then output
 * errors produced by the most likely parser matches.
 */
Output any errors produced by the selected parser
or if all content has been parsed then output
errors produced by the most likely parser matches.
Output any errors produced by the selected parser or if all content has been parsed then output errors produced by the most likely parser matches .
static void output_errors(MREAD_T *mread, short end) {
  MFORMAT_T* format;
  int i;
  short best;
  if (mread->success) {
    print_parser_warnings(mread->formats);
    print_parser_errors(mread->formats);
  } else if (end) {
    qsort(mread->formats, mread->total, sizeof(MFORMAT_T), mformat_cmp);
    best = mread->formats->match_score(mread->formats->data);
    if (best < 1) {
      fputs("There were no convincing matches to any MEME Suite motif "
          "format.\n", stderr);
      return;
    }
    for (i = 0; i < mread->total; i++) {
      format = mread->formats+i;
      if (format->match_score(format->data) < best) break;
      if (format->has_warning != NULL && format->has_warning(format->data)) {
        fprintf(stderr, "Warnings from %s parser:\n", format->name);
        print_parser_warnings(format);
      }
      if (format->has_error(format->data)) {
        fprintf(stderr, "Errors from %s parser:\n", format->name);
        print_parser_errors(format);
      }
    }
  }
}
static void output_errors ( MREAD_T * mread , short end ) { MFORMAT_T * format ; int i ; short best ; if ( mread -> success ) { print_parser_warnings ( mread -> formats ) ; print_parser_errors ( mread -> formats ) ; } else if ( end ) { qsort ( mread -> formats , mread -> total , sizeof ( MFORMAT_T ) , mformat_cmp ) ; best = mread -> formats -> match_score ( mread -> formats -> data ) ; if ( best < 1 ) { fputs ( " " " \n " , stderr ) ; return ; } for ( i = 0 ; i < mread -> total ; i ++ ) { format = mread -> formats + i ; if ( format -> match_score ( format -> data ) < best ) break ; if ( format -> has_warning != NULL && format -> has_warning ( format -> data ) ) { fprintf ( stderr , " \n " , format -> name ) ; print_parser_warnings ( format ) ; } if ( format -> has_error ( format -> data ) ) { fprintf ( stderr , " \n " , format -> name ) ; print_parser_errors ( format ) ; } } } }
Output any errors produced by the selected parser
 or if all content has been parsed then output
 errors produced by the most likely parser matches.
Output any errors produced by the selected parser or if all content has been parsed then output errors produced by the most likely parser matches .
// a single parser has been selected so output // any errors that it has produced // no parsers were selected so try to print the most relevant errors // sort parsers by file match // get the best format match score // check that the best format match is plausible // print out the warnings and errors for the best matching formats