skalibs

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

bufalloc_timed_flush.c (419B)


      1 /* ISC license. */
      2 
      3 #include <skalibs/bufalloc.h>
      4 #include <skalibs/functypes.h>
      5 #include <skalibs/unix-timed.h>
      6 
      7 static int bufalloc_isnonempty (bufalloc *ba)
      8 {
      9   return !!bufalloc_len(ba) ;
     10 }
     11 
     12 int bufalloc_timed_flush (bufalloc *ba, tain const *deadline, tain *stamp)
     13 {
     14   return timed_flush(ba, (init_func_ref)&bufalloc_getfd, (init_func_ref)&bufalloc_isnonempty, (init_func_ref)&bufalloc_flush, deadline, stamp) ;
     15 }