LCOV - code coverage report
Current view: top level - src/server - manios.c (source / functions) Hit Total Coverage
Test: burp-coverage-clean.info Lines: 19 20 95.0 %
Date: 2017-08-09 Functions: 2 2 100.0 %

          Line data    Source code
       1             : #include "../burp.h"
       2             : #include "../alloc.h"
       3             : #include "manios.h"
       4             : #include "manio.h"
       5             : 
       6             : static struct manios *manios_alloc(void)
       7             : {
       8          18 :         return (struct manios *)calloc_w(1, sizeof(struct manios), __func__);
       9             : }
      10             : 
      11          18 : struct manios *manios_open_phase2(struct sdirs *sdirs, man_off_t *p1pos,
      12             :         enum protocol p)
      13             : {
      14          18 :         struct manios *m=NULL;
      15          18 :         if(!(m=manios_alloc())
      16          18 :           || !(m->current=manio_open(sdirs->cmanifest, "rb", p))
      17          18 :           || !(m->phase1=manio_open_phase1(sdirs->phase1data, "rb", p))
      18          18 :           || !(m->changed=manio_open_phase2(sdirs->changed, "ab", p))
      19          18 :           || !(m->unchanged=manio_open_phase2(sdirs->unchanged, "ab", p))
      20          18 :           || (p1pos && manio_seek(m->phase1, p1pos)))
      21           0 :                 manios_close(&m);
      22          18 :         return m;
      23             : }
      24             : 
      25          36 : int manios_close(struct manios **manios)
      26             : {
      27          36 :         int ret=0;
      28          36 :         if(!manios || !*manios) return 0;
      29          18 :         ret|=manio_close(&(*manios)->current);
      30          18 :         ret|=manio_close(&(*manios)->phase1);
      31          18 :         ret|=manio_close(&(*manios)->changed);
      32          18 :         ret|=manio_close(&(*manios)->unchanged);
      33          18 :         free_v((void **)manios);
      34          18 :         return ret;
      35             : }

Generated by: LCOV version 1.10