kolbak_queue_init.c (261B)
1 /* ISC license. */ 2 3 #include <errno.h> 4 5 #include <skalibs/kolbak.h> 6 7 int kolbak_queue_init (kolbak_queue *q, kolbak_closure *s, size_t len) 8 { 9 if (len < 2) return (errno = EINVAL, 0) ; 10 q->x = s ; 11 q->n = len ; 12 q->head = 0 ; 13 q->tail = 0 ; 14 return 1 ; 15 }