about summary refs log tree commit diff
path: root/src/libunixonacid/kolbak_call.c
blob: fce2add415bf023b0118e4cb6025b6eba713259e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* ISC license. */

#include <errno.h>

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

int kolbak_call (unixmessage const *m, kolbak_queue *q)
{
  if (q->head == q->tail) return (errno = EILSEQ, 0) ;
  if (!(*q->x[q->head].f)(m, q->x[q->head].data)) return 0 ;
  q->head = (q->head + 1) % q->n ;
  return 1 ;
}