deps/kb_meme/meme-5.0.1/src/buffer.c
/*
 * buf_compact
 * moves data between the position and the limit to the begining
 * sets the position to after the data and the limit to the capacity
 */
buf_compact
moves data between the position and the limit to the begining
sets the position to after the data and the limit to the capacity
buf_compact moves data between the position and the limit to the begining sets the position to after the data and the limit to the capacity
void buf_compact(BUF_T *buf) {
  int len;
  char *src, *dest;
  len = (buf->limit - buf->position);
  src = (buf->buffer)+(buf->position);
  dest = buf->buffer;
  memmove(dest, src, len*sizeof(char));
  buf->position = len;
  buf->limit = buf->capacity;
  buf->mark = -1;
}
void buf_compact ( BUF_T * buf ) { int len ; char * src , * dest ; len = ( buf -> limit - buf -> position ) ; src = ( buf -> buffer ) + ( buf -> position ) ; dest = buf -> buffer ; memmove ( dest , src , len * sizeof ( char ) ) ; buf -> position = len ; buf -> limit = buf -> capacity ; buf -> mark = -1 ; }
buf_compact
 moves data between the position and the limit to the begining
 sets the position to after the data and the limit to the capacity
buf_compact moves data between the position and the limit to the begining sets the position to after the data and the limit to the capacity