if_diff/src/idfReport.cxx
//============================================================================
// find_line returns how many characters of the message to output on the next
// line.  Take care to get 'max' characters or less, but be darn sure to get
// at least 1 character to avoid looping.
//
// Assume for formatting purposes that the string begins with non-whitespace.
//============================================================================
find_line returns how many characters of the message to output on the next
line.  Take care to get 'max' characters or less, but be darn sure to get
at least 1 character to avoid looping.

Assume for formatting purposes that the string begins with non-whitespace.
find_line returns how many characters of the message to output on the next line . Take care to get ' max ' characters or less but be darn sure to get at least 1 character to avoid looping . Assume for formatting purposes that the string begins with non - whitespace .
static boolean find_line(int max, const char *s, int &line_size)
{
  if (s == NULL) {
    return false;
  }
  const char *const q = s + max;
  const char *end = s;
  char const *p;
  for (p = s; p < q && *p != '\0'; p += 1) {
    const char this_char = p[0];
    const char next_char = p[1];
    if (!isspace(this_char) && (   isspace(next_char)
                                || next_char == '\0'
                                || this_char == ',')) {
      end = p + 1;
    }
  }
  if (end > s) {
    line_size = end - s;
    return true;
  }
  line_size = p - s;
  return p > s;
}
static boolean find_line ( int max , const char * s , int & line_size ) { if ( s == NULL ) { return false ; } const char * const q = s + max ; const char * end = s ; char const * p ; for ( p = s ; p < q && * p != ' \0 ' ; p += 1 ) { const char this_char = p [ 0 ] ; const char next_char = p [ 1 ] ; if ( ! isspace ( this_char ) && ( isspace ( next_char ) || next_char == ' \0 ' || this_char == ' ' ) ) { end = p + 1 ; } } if ( end > s ) { line_size = end - s ; return true ; } line_size = p - s ; return p > s ; }
find_line returns how many characters of the message to output on the next
line.
find_line returns how many characters of the message to output on the next line .
// Found no nice place to end the printing. // Print as much as we've got, up to max.