135c4bbdfSmrg/* 235c4bbdfSmrg * Copyright © 2013 Red Hat, Inc. 335c4bbdfSmrg * 435c4bbdfSmrg * Permission is hereby granted, free of charge, to any person obtaining a 535c4bbdfSmrg * copy of this software and associated documentation files (the "Software"), 635c4bbdfSmrg * to deal in the Software without restriction, including without limitation 735c4bbdfSmrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 835c4bbdfSmrg * and/or sell copies of the Software, and to permit persons to whom the 935c4bbdfSmrg * Software is furnished to do so, subject to the following conditions: 1035c4bbdfSmrg * 1135c4bbdfSmrg * The above copyright notice and this permission notice (including the next 1235c4bbdfSmrg * paragraph) shall be included in all copies or substantial portions of the 1335c4bbdfSmrg * Software. 1435c4bbdfSmrg * 1535c4bbdfSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1635c4bbdfSmrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1735c4bbdfSmrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 1835c4bbdfSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1935c4bbdfSmrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 2035c4bbdfSmrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 2135c4bbdfSmrg * DEALINGS IN THE SOFTWARE. 2235c4bbdfSmrg * 2335c4bbdfSmrg * Author: Hans de Goede <hdegoede@redhat.com> 2435c4bbdfSmrg */ 2535c4bbdfSmrg 2635c4bbdfSmrg#ifndef DBUS_CORE_H 2735c4bbdfSmrg#define DBUS_CORE_H 2835c4bbdfSmrg 2935c4bbdfSmrg#ifdef NEED_DBUS 3035c4bbdfSmrg#include <dbus/dbus.h> 3135c4bbdfSmrg 3235c4bbdfSmrgtypedef void (*dbus_core_connect_hook) (DBusConnection * connection, 3335c4bbdfSmrg void *data); 3435c4bbdfSmrgtypedef void (*dbus_core_disconnect_hook) (void *data); 3535c4bbdfSmrg 3635c4bbdfSmrgstruct dbus_core_hook { 3735c4bbdfSmrg dbus_core_connect_hook connect; 3835c4bbdfSmrg dbus_core_disconnect_hook disconnect; 3935c4bbdfSmrg void *data; 4035c4bbdfSmrg 4135c4bbdfSmrg struct dbus_core_hook *next; 4235c4bbdfSmrg}; 4335c4bbdfSmrg 4435c4bbdfSmrgint dbus_core_init(void); 4535c4bbdfSmrgvoid dbus_core_fini(void); 4635c4bbdfSmrgint dbus_core_add_hook(struct dbus_core_hook *hook); 4735c4bbdfSmrgvoid dbus_core_remove_hook(struct dbus_core_hook *hook); 4835c4bbdfSmrg 4935c4bbdfSmrg#else 5035c4bbdfSmrg 5135c4bbdfSmrg#define dbus_core_init() 5235c4bbdfSmrg#define dbus_core_fini() 5335c4bbdfSmrg 5435c4bbdfSmrg#endif 5535c4bbdfSmrg 5635c4bbdfSmrg#endif 57