chiark / gitweb /
journal: set the _SYSTEMD_UNIT field for messages from terminated processes
[elogind.git] / src / core / dbus.h
1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3 #ifndef foodbushfoo
4 #define foodbushfoo
5
6 /***
7   This file is part of systemd.
8
9   Copyright 2010 Lennart Poettering
10
11   systemd is free software; you can redistribute it and/or modify it
12   under the terms of the GNU Lesser General Public License as published by
13   the Free Software Foundation; either version 2.1 of the License, or
14   (at your option) any later version.
15
16   systemd is distributed in the hope that it will be useful, but
17   WITHOUT ANY WARRANTY; without even the implied warranty of
18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19   Lesser General Public License for more details.
20
21   You should have received a copy of the GNU Lesser General Public License
22   along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 ***/
24
25 #include <dbus/dbus.h>
26
27 #include "manager.h"
28
29 int bus_init(Manager *m, bool try_bus_connect);
30 void bus_done(Manager *m);
31
32 unsigned bus_dispatch(Manager *m);
33
34 void bus_watch_event(Manager *m, Watch *w, int events);
35 void bus_timeout_event(Manager *m, Watch *w, int events);
36
37 int bus_query_pid(Manager *m, const char *name);
38
39 int bus_broadcast(Manager *m, DBusMessage *message);
40
41 bool bus_has_subscriber(Manager *m);
42 bool bus_connection_has_subscriber(Manager *m, DBusConnection *c);
43
44 int bus_fdset_add_all(Manager *m, FDSet *fds);
45
46 void bus_broadcast_finished(Manager *m, usec_t kernel_usec, usec_t initrd_usec, usec_t userspace_usec, usec_t total_usec);
47
48 #define BUS_CONNECTION_SUBSCRIBED(m, c) dbus_connection_get_data((c), (m)->subscribed_data_slot)
49 #define BUS_PENDING_CALL_NAME(m, p) dbus_pending_call_get_data((p), (m)->name_data_slot)
50
51 extern const char * const bus_interface_table[];
52
53 #endif