deps/kb_meme/meme-5.0.1/src/buffer.c
/*
 * buf_unexpected
 * checks that the specified string follows exactly. If what follows is
 * unexpected then return 1, otherwise advance the buffer to skip over 
 * the expected string and return 0.
 *
 * Errors
 * The expected string must be smaller than the buffer or this will 
 * cause a fatal error.
 */
buf_unexpected
checks that the specified string follows exactly. If what follows is
unexpected then return 1, otherwise advance the buffer to skip over
the expected string and return 0.

Errors
The expected string must be smaller than the buffer or this will
cause a fatal error.
buf_unexpected checks that the specified string follows exactly . If what follows is unexpected then return 1 otherwise advance the buffer to skip over the expected string and return 0 . Errors The expected string must be smaller than the buffer or this will cause a fatal error .
int buf_unexpected(BUF_T *buf, const char *expected, bool ignorecase) {
  int i;
  i = buf->position;
  while (*expected != '\0') {
    if (i == buf->limit) {
      if (buf->position == 0 && buf->limit == buf->capacity)
        die("buf_unexpected() - expected string is longer than the buffer\n");
      return 1;
    }
    if (ignorecase) {
      if (tolower(buf->buffer[i]) != tolower(*expected)) return 1;
    } else {
      if (buf->buffer[i] != *expected) return 1;
    }
    ++i;
    ++expected;
  }
  buf->position = i;
  return 0;
}
int buf_unexpected ( BUF_T * buf , const char * expected , bool ignorecase ) { int i ; i = buf -> position ; while ( * expected != ' \0 ' ) { if ( i == buf -> limit ) { if ( buf -> position == 0 && buf -> limit == buf -> capacity ) die ( " \n " ) ; return 1 ; } if ( ignorecase ) { if ( tolower ( buf -> buffer [ i ] ) != tolower ( * expected ) ) return 1 ; } else { if ( buf -> buffer [ i ] != * expected ) return 1 ; } ++ i ; ++ expected ; } buf -> position = i ; return 0 ; }
buf_unexpected
 checks that the specified string follows exactly.
buf_unexpected checks that the specified string follows exactly .
//can't match all characters so it is unexpected