summaryrefslogtreecommitdiff
path: root/src/libunixonacid/buffer_timed_flush.c
blob: d6882435e01a06d0de6fe58b1bcc79beabb489e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* ISC license. */

#include <skalibs/buffer.h>
#include <skalibs/functypes.h>
#include <skalibs/unix-timed.h>

static int buffer_isnonempty (buffer *b)
{
  return !buffer_isempty(b) ;
}

int buffer_timed_flush (buffer *b, tain const *deadline, tain *stamp)
{
  return timed_flush(b, (init_func_ref)&buffer_getfd, (init_func_ref)&buffer_isnonempty, (init_func_ref)&buffer_flush, deadline, stamp) ;
}