virdbus.h 1.5 KB
Newer Older
1 2 3
/*
 * virdbus.h: helper for using DBus
 *
4
 * Copyright (C) 2012-2013 Red Hat, Inc.
5 6 7 8 9 10 11 12 13 14 15 16
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
17
 * License along with this library.  If not, see
O
Osier Yang 已提交
18
 * <http://www.gnu.org/licenses/>.
19 20 21 22 23 24
 *
 */

#ifndef __VIR_DBUS_H__
# define __VIR_DBUS_H__

25
# ifdef WITH_DBUS
26
#  undef interface /* Work around namespace pollution in mingw's rpc.h */
27 28 29
#  include <dbus/dbus.h>
# else
#  define DBusConnection void
30
#  define DBusMessage void
31 32 33 34
# endif
# include "internal.h"

DBusConnection *virDBusGetSystemBus(void);
35
DBusConnection *virDBusGetSessionBus(void);
36

37 38 39 40
int virDBusCallMethod(DBusConnection *conn,
                      DBusMessage **reply,
                      const char *destination,
                      const char *path,
41
                      const char *iface,
42 43 44 45 46
                      const char *member,
                      const char *types, ...);
int virDBusMessageRead(DBusMessage *msg,
                       const char *types, ...);

47
#endif /* __VIR_DBUS_H__ */