LCOV - code coverage report
Current view: top level - shared - fdset.h (source / functions) Hit Total Coverage
Test: main_coverage.info Lines: 1 1 100.0 %
Date: 2019-08-22 15:41:25 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /* SPDX-License-Identifier: LGPL-2.1+ */
       2             : #pragma once
       3             : 
       4             : #include <stdbool.h>
       5             : 
       6             : #include "hashmap.h"
       7             : #include "macro.h"
       8             : #include "set.h"
       9             : 
      10             : typedef struct FDSet FDSet;
      11             : 
      12             : FDSet* fdset_new(void);
      13             : FDSet* fdset_free(FDSet *s);
      14             : 
      15             : int fdset_put(FDSet *s, int fd);
      16             : int fdset_put_dup(FDSet *s, int fd);
      17             : 
      18             : bool fdset_contains(FDSet *s, int fd);
      19             : int fdset_remove(FDSet *s, int fd);
      20             : 
      21             : int fdset_new_array(FDSet **ret, const int *fds, size_t n_fds);
      22             : int fdset_new_fill(FDSet **ret);
      23             : int fdset_new_listen_fds(FDSet **ret, bool unset);
      24             : 
      25             : int fdset_cloexec(FDSet *fds, bool b);
      26             : 
      27             : int fdset_close_others(FDSet *fds);
      28             : 
      29             : unsigned fdset_size(FDSet *fds);
      30             : bool fdset_isempty(FDSet *fds);
      31             : 
      32             : int fdset_iterate(FDSet *s, Iterator *i);
      33             : 
      34             : int fdset_steal_first(FDSet *fds);
      35             : 
      36             : void fdset_close(FDSet *fds);
      37             : 
      38             : #define FDSET_FOREACH(fd, fds, i) \
      39             :         for ((i) = ITERATOR_FIRST, (fd) = fdset_iterate((fds), &(i)); (fd) >= 0; (fd) = fdset_iterate((fds), &(i)))
      40             : 
      41          11 : DEFINE_TRIVIAL_CLEANUP_FUNC(FDSet*, fdset_free);
      42             : #define _cleanup_fdset_free_ _cleanup_(fdset_freep)

Generated by: LCOV version 1.14