~ubuntu-branches/ubuntu/wily/bluez/wily

« back to all changes in this revision

Viewing changes to gdbus/gdbus.h

ImportĀ upstreamĀ versionĀ 4.81

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 *
3
3
 *  D-Bus helper library
4
4
 *
5
 
 *  Copyright (C) 2004-2009  Marcel Holtmann <marcel@holtmann.org>
 
5
 *  Copyright (C) 2004-2010  Marcel Holtmann <marcel@holtmann.org>
6
6
 *
7
7
 *
8
8
 *  This program is free software; you can redistribute it and/or modify
40
40
DBusConnection *g_dbus_setup_bus(DBusBusType type, const char *name,
41
41
                                                        DBusError *error);
42
42
 
 
43
DBusConnection *g_dbus_setup_private(DBusBusType type, const char *name,
 
44
                                                        DBusError *error);
 
45
 
43
46
gboolean g_dbus_request_name(DBusConnection *connection, const char *name,
44
47
                                                        DBusError *error);
45
48
 
46
 
gboolean g_dbus_check_service(DBusConnection *connection, const char *name);
47
 
 
48
49
gboolean g_dbus_set_disconnect_function(DBusConnection *connection,
49
50
                                GDBusWatchFunction function,
50
51
                                void *user_data, DBusFreeFunction destroy);
54
55
typedef DBusMessage * (* GDBusMethodFunction) (DBusConnection *connection,
55
56
                                        DBusMessage *message, void *user_data);
56
57
 
 
58
typedef guint32 GDBusPendingReply;
 
59
 
 
60
typedef void (* GDBusSecurityFunction) (DBusConnection *connection,
 
61
                                                const char *action,
 
62
                                                gboolean interaction,
 
63
                                                GDBusPendingReply pending);
 
64
 
57
65
typedef enum {
58
66
        G_DBUS_METHOD_FLAG_DEPRECATED = (1 << 0),
59
67
        G_DBUS_METHOD_FLAG_NOREPLY    = (1 << 1),
68
76
        G_DBUS_PROPERTY_FLAG_DEPRECATED = (1 << 0),
69
77
} GDBusPropertyFlags;
70
78
 
 
79
typedef enum {
 
80
        G_DBUS_SECURITY_FLAG_DEPRECATED        = (1 << 0),
 
81
        G_DBUS_SECURITY_FLAG_BUILTIN           = (1 << 1),
 
82
        G_DBUS_SECURITY_FLAG_ALLOW_INTERACTION = (1 << 2),
 
83
} GDBusSecurityFlags;
 
84
 
71
85
typedef struct {
72
86
        const char *name;
73
87
        const char *signature;
74
88
        const char *reply;
75
89
        GDBusMethodFunction function;
76
90
        GDBusMethodFlags flags;
 
91
        unsigned int privilege;
77
92
} GDBusMethodTable;
78
93
 
79
94
typedef struct {
88
103
        GDBusPropertyFlags flags;
89
104
} GDBusPropertyTable;
90
105
 
 
106
typedef struct {
 
107
        unsigned int privilege;
 
108
        const char *action;
 
109
        GDBusSecurityFlags flags;
 
110
        GDBusSecurityFunction function;
 
111
} GDBusSecurityTable;
 
112
 
91
113
gboolean g_dbus_register_interface(DBusConnection *connection,
92
114
                                        const char *path, const char *name,
93
 
                                        GDBusMethodTable *methods,
94
 
                                        GDBusSignalTable *signals,
95
 
                                        GDBusPropertyTable *properties,
 
115
                                        const GDBusMethodTable *methods,
 
116
                                        const GDBusSignalTable *signals,
 
117
                                        const GDBusPropertyTable *properties,
96
118
                                        void *user_data,
97
119
                                        GDBusDestroyFunction destroy);
98
120
gboolean g_dbus_unregister_interface(DBusConnection *connection,
99
121
                                        const char *path, const char *name);
100
122
 
 
123
gboolean g_dbus_register_security(const GDBusSecurityTable *security);
 
124
gboolean g_dbus_unregister_security(const GDBusSecurityTable *security);
 
125
 
 
126
void g_dbus_pending_success(DBusConnection *connection,
 
127
                                        GDBusPendingReply pending);
 
128
void g_dbus_pending_error(DBusConnection *connection,
 
129
                                GDBusPendingReply pending,
 
130
                                const char *name, const char *format, ...)
 
131
                                        __attribute__((format(printf, 4, 5)));
 
132
void g_dbus_pending_error_valist(DBusConnection *connection,
 
133
                                GDBusPendingReply pending, const char *name,
 
134
                                        const char *format, va_list args);
 
135
 
101
136
DBusMessage *g_dbus_create_error(DBusMessage *message, const char *name,
102
 
                                                const char *format, ...);
 
137
                                                const char *format, ...)
 
138
                                        __attribute__((format(printf, 3, 4)));
103
139
DBusMessage *g_dbus_create_error_valist(DBusMessage *message, const char *name,
104
140
                                        const char *format, va_list args);
105
141
DBusMessage *g_dbus_create_reply(DBusMessage *message, int type, ...);
127
163
                                GDBusWatchFunction function,
128
164
                                void *user_data, GDBusDestroyFunction destroy);
129
165
guint g_dbus_add_signal_watch(DBusConnection *connection,
130
 
                                const char *rule, GDBusSignalFunction function,
131
 
                                void *user_data, GDBusDestroyFunction destroy);
 
166
                                const char *sender, const char *path,
 
167
                                const char *interface, const char *member,
 
168
                                GDBusSignalFunction function, void *user_data,
 
169
                                GDBusDestroyFunction destroy);
132
170
gboolean g_dbus_remove_watch(DBusConnection *connection, guint tag);
133
171
void g_dbus_remove_all_watches(DBusConnection *connection);
134
172