summaryrefslogtreecommitdiff
path: root/src/libunixonacid/kolbak_unenqueue.c
blob: 894beeab51f8501ca16472b961de5d17e0e22449 (plain)
1
2
3
4
5
6
7
8
9
10
11
/* ISC license. */

#include <errno.h>
#include <skalibs/kolbak.h>

int kolbak_unenqueue (kolbak_queue_t *q)
{
  if (q->head == q->tail) return (errno = EINVAL, 0) ;
  q->tail = (q->tail + q->n - 1) % q->n ;
  return 1 ;
}