Fix more warnings
[lash.git] / dbus / signal.h
blob455f2375a8c0c1d3d22aa1c1bfddc54b891fc4f4
1 /*
2 * LASH
4 * Copyright (C) 2008 Juuso Alasuutari <juuso.alasuutari@gmail.com>
5 * Copyright (C) 2008 Nedko Arnaudov
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef __LASH_DBUS_SIGNAL_H__
23 #define __LASH_DBUS_SIGNAL_H__
25 #include <dbus/dbus.h>
27 #include "dbus/types.h"
29 struct _signal_msg
31 DBusConnection *connection;
32 DBusMessage *message;
35 struct _signal_arg
37 const char *name;
38 const char *type;
41 struct _signal
43 const char *name;
44 const signal_arg_t *args;
47 void
48 signal_new_single(service_t *service,
49 const char *path,
50 const char *interface,
51 const char *name,
52 int type,
53 const void *arg);
55 void
56 signal_new_valist(service_t *service,
57 const char *path,
58 const char *interface,
59 const char *name,
60 int type,
61 ...);
63 #define SIGNAL_ARGS_BEGIN(signal_name) \
64 static const struct _signal_arg signal_name ## _args_dtor[] = \
67 #define SIGNAL_ARG_DESCRIBE(arg_name, arg_type) \
68 { \
69 .name = arg_name, \
70 .type = arg_type \
73 #define SIGNAL_ARGS_END \
74 { \
75 .name = NULL, \
76 .type = NULL \
77 } \
80 #define SIGNALS_BEGIN \
81 static const struct _signal signals_dtor[] = \
84 #define SIGNAL_DESCRIBE(signal_name) \
85 { \
86 .name = # signal_name, \
87 .args = signal_name ## _args_dtor \
90 #define SIGNALS_END \
91 { \
92 .name = NULL, \
93 .args = NULL \
94 } \
97 #endif /* __LASH_DBUS_SIGNAL_H__ */