deps/kb_meme/meme-5.0.1/src/buffer.c
/*
 * buf_fread_consume
 * consumes all the delimiters returning the number of delimiters that it consumes.
 * returns -1 on read error.
 */
buf_fread_consume
consumes all the delimiters returning the number of delimiters that it consumes.
returns -1 on read error.
buf_fread_consume consumes all the delimiters returning the number of delimiters that it consumes . returns - 1 on read error .
int buf_fread_consume(BUF_T *buf, FILE *fp, int (*is_delim)(void*, int), void* config, bool negate_is_delim) {
  int index, count;
  count = 0;
  while (true) {
    index = buf_find_next(buf, is_delim, config, !negate_is_delim);
    if (index == -1) {
      count += buf_remaining(buf);
    } else {
      count += index - buf->position;
      break;
    }
    if (feof(fp)) {
      index = buf->limit;
      break;
    }
    buf_clear(buf);
    buf_fread(buf, fp);
    buf_flip(buf);
    if (ferror(fp)) {
      return -1;
    }
  }
  buf_set_position(buf, index);
  return count;
}
int buf_fread_consume ( BUF_T * buf , FILE * fp , int ( * is_delim ) ( void * , int ) , void * config , bool negate_is_delim ) { int index , count ; count = 0 ; while ( true ) { index = buf_find_next ( buf , is_delim , config , ! negate_is_delim ) ; if ( index == -1 ) { count += buf_remaining ( buf ) ; } else { count += index - buf -> position ; break ; } if ( feof ( fp ) ) { index = buf -> limit ; break ; } buf_clear ( buf ) ; buf_fread ( buf , fp ) ; buf_flip ( buf ) ; if ( ferror ( fp ) ) { return -1 ; } } buf_set_position ( buf , index ) ; return count ; }
buf_fread_consume
 consumes all the delimiters returning the number of delimiters that it consumes.
buf_fread_consume consumes all the delimiters returning the number of delimiters that it consumes .