blob: dcc6095508a22a4c6aa6fca4002dbe99323f996f [file] [log] [blame]
David Sodmanbbcb0522014-09-19 10:34:07 -07001/*
2 * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7#ifndef DBUS_H_
8#define DBUS_H_
9
10#include <dbus/dbus.h>
11#include <stdbool.h>
12#include <memory.h>
13#include <stdio.h>
14
15typedef struct _dbus_t dbus_t;
16
17typedef void (*dbus_message_handler_t)(dbus_t*, void*);
18
19dbus_t* dbus_init();
20bool dbus_method_call(dbus_t* dbus, const char* service_name,
21 const char* service_path, const char* service_interface,
22 const char* method, int* param);
23bool dbus_signal_match_handler(
24 dbus_t* dbus,
25 const char* signal,
26 const char* path,
27 const char* interface,
28 const char* rule,
29 dbus_message_handler_t handler,
30 void *user_data);
31void dbus_wait_for_messages(dbus_t *dbus);
32void dbus_stop_wait(dbus_t* dbus);
33void dbus_destroy(dbus_t* dbus);
34
35
36#endif // DBUS_H_