skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

kolbak_unenqueue.c (222B)


      1 /* ISC license. */
      2 
      3 #include <errno.h>
      4 
      5 #include <skalibs/kolbak.h>
      6 
      7 int kolbak_unenqueue (kolbak_queue *q)
      8 {
      9   if (q->head == q->tail) return (errno = EINVAL, 0) ;
     10   q->tail = (q->tail + q->n - 1) % q->n ;
     11   return 1 ;
     12 }