Debian Codegraph @

src/shared/notify-recv.h

raw
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3
4 #include "shared-forward.h"
5
6 int notify_socket_prepare_full(
7 sd_event *event,
8 int64_t priority,
9 sd_event_io_handler_t handler,
10 void *userdata,
11 bool accept_fds,
12 char **ret_path,
13 sd_event_source **ret_event_source);
14
15 static inline int notify_socket_prepare(
16 sd_event *event,
17 int64_t priority,
18 sd_event_io_handler_t handler,
19 void *userdata,
20 char **ret_path) {
21
22 return notify_socket_prepare_full(event, priority, handler, userdata, false, ret_path, NULL);
23 }
24
25 int notify_recv_with_fds(
26 int fd,
27 char **ret_text,
28 struct ucred *ret_ucred,
29 PidRef *ret_pidref,
30 FDSet **ret_fds);
31
32 static inline int notify_recv(int fd, char **ret_text, struct ucred *ret_ucred, PidRef *ret_pidref) {
33 return notify_recv_with_fds(fd, ret_text, ret_ucred, ret_pidref, NULL);
34 }
35
36 int notify_recv_with_fds_strv(
37 int fd,
38 char ***ret_list,
39 struct ucred *ret_ucred,
40 PidRef *ret_pidref,
41 FDSet **ret_fds);
42
43 static inline int notify_recv_strv(int fd, char ***ret_list, struct ucred *ret_ucred, PidRef *ret_pidref) {
44 return notify_recv_with_fds_strv(fd, ret_list, ret_ucred, ret_pidref, NULL);
45 }