]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/shared/fdset.h
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / shared / fdset.h
index 907acd76dd6a50aa9373d33afbea6428e6812fec..864ab676f72d9062cd442a91f0ad255088518f90 100644 (file)
@@ -1,5 +1,4 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
+/* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
 /***
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <stdbool.h>
+
+#include "hashmap.h"
+#include "macro.h"
 #include "set.h"
-#include "util.h"
 
 typedef struct FDSet FDSet;
 
 FDSet* fdset_new(void);
-void fdset_free(FDSet *s);
+FDSet* fdset_free(FDSet *s);
 
 int fdset_put(FDSet *s, int fd);
 int fdset_put_dup(FDSet *s, int fd);
@@ -35,17 +37,21 @@ int fdset_put_dup(FDSet *s, int fd);
 bool fdset_contains(FDSet *s, int fd);
 int fdset_remove(FDSet *s, int fd);
 
-int fdset_new_fill(FDSet **_s);
-int fdset_new_listen_fds(FDSet **_s, bool unset);
+int fdset_new_array(FDSet **ret, const int *fds, unsigned n_fds);
+int fdset_new_fill(FDSet **ret);
+int fdset_new_listen_fds(FDSet **ret, bool unset);
 
 int fdset_cloexec(FDSet *fds, bool b);
 
 int fdset_close_others(FDSet *fds);
 
 unsigned fdset_size(FDSet *fds);
+bool fdset_isempty(FDSet *fds);
 
 int fdset_iterate(FDSet *s, Iterator *i);
 
+int fdset_steal_first(FDSet *fds);
+
 #define FDSET_FOREACH(fd, fds, i) \
         for ((i) = ITERATOR_FIRST, (fd) = fdset_iterate((fds), &(i)); (fd) >= 0; (fd) = fdset_iterate((fds), &(i)))