skalibs

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

skaclient_putmsgv.c (439B)


      1 /* ISC license. */
      2 
      3 #include <skalibs/kolbak.h>
      4 #include <skalibs/skaclient.h>
      5 #include <skalibs/unixmessage.h>
      6 
      7 int skaclient_putmsgv_and_close (skaclient *a, unixmessagev const *m, unsigned char const *bits, unixmessage_handler_func_ref cb, void *result)
      8 {
      9   if (!kolbak_enqueue(&a->kq, cb, result)) return 0 ;
     10   if (!unixmessage_putv_and_close(&a->syncout, m, bits))
     11   {
     12     kolbak_unenqueue(&a->kq) ;
     13     return 0 ;
     14   }
     15   return 1 ;
     16 }