094ce0c76ced0d6df5ef20550dd76590260e9ea9
[libicd-wpa] / dbus-helper.h
1 /**
2   @file dbus-helper.h
3
4   Copyright (C) 2004 Nokia Corporation. All rights reserved.
5
6   @author Janne Ylälehto <janne.ylalehto@nokia.com>
7   @author Jouni Malinen <j@w1.fi> and contributors
8   @author Javier S. Pedro <javispedro@javispedro.com>
9
10   This program is free software; you can redistribute it and/or modify it
11   under the terms of the GNU General Public License as published by the
12   Free Software Foundation; either version 2 of the License, or (at your
13   option) any later version.
14
15   This program is distributed in the hope that it will be useful, but
16   WITHOUT ANY WARRANTY; without even the implied warranty of
17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18   General Public License for more details.
19
20   You should have received a copy of the GNU General Public License along
21   with this program; if not, write to the Free Software Foundation, Inc.,
22   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23
24 */
25 #ifndef _DBUS_HELPER_H_
26 #define _DBUS_HELPER_H_
27
28 #ifndef DBUS_API_SUBJECT_TO_CHANGE
29 # define DBUS_API_SUBJECT_TO_CHANGE
30 # include <dbus/dbus.h>
31 #endif
32
33 void append_dbus_args(DBusMessage *message, int first_arg_type, ...);
34
35 int send_and_unref(DBusConnection *connection, DBusMessage *message);
36
37 int send_invalid_args(DBusConnection *connection, DBusMessage *message);
38
39 DBusMessage *new_dbus_signal(const char *path,
40                              const char *interface,
41                              const char *name,
42                              const char *destination);
43
44 DBusMessage *new_dbus_method_call(const char *service,
45                                   const char *path,
46                                   const char *interface,
47                                   const char *method);
48
49 DBusMessage *new_dbus_method_return(DBusMessage *message);
50
51 DBusMessage *new_dbus_error(DBusMessage *message, const char *name);
52
53 int dbus_dict_open_write(DBusMessageIter *iter,
54                                      DBusMessageIter *iter_dict);
55 int dbus_dict_close_write(DBusMessageIter *iter,
56                                       DBusMessageIter *iter_dict);
57
58 int dbus_dict_append_string(DBusMessageIter *iter_dict,
59                                         const char *key, const char *value);
60                                       
61 int dbus_dict_append_int32(DBusMessageIter *iter_dict,
62                                        const char *key,
63                                        const dbus_int32_t value);
64
65 #endif /* _DBUD_HELPER_H_ */