~ubuntu-branches/ubuntu/trusty/obexd/trusty-proposed

« back to all changes in this revision

Viewing changes to gdbus/gdbus.h

  • Committer: Bazaar Package Importer
  • Author(s): Nobuhiro Iwamatsu
  • Date: 2011-01-12 20:35:41 UTC
  • mfrom: (1.1.9 upstream) (0.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110112203541-gzwqrgiqycxch0n0
Tags: 0.39-1
New upstream release.

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-2010  Marcel Holtmann <marcel@holtmann.org>
 
5
 *  Copyright (C) 2004-2011  Marcel Holtmann <marcel@holtmann.org>
6
6
 *
7
7
 *
8
8
 *  This program is free software; you can redistribute it and/or modify
55
55
typedef DBusMessage * (* GDBusMethodFunction) (DBusConnection *connection,
56
56
                                        DBusMessage *message, void *user_data);
57
57
 
 
58
typedef guint32 GDBusPendingReply;
 
59
 
 
60
typedef void (* GDBusSecurityFunction) (DBusConnection *connection,
 
61
                                                const char *action,
 
62
                                                gboolean interaction,
 
63
                                                GDBusPendingReply pending);
 
64
 
58
65
typedef enum {
59
66
        G_DBUS_METHOD_FLAG_DEPRECATED = (1 << 0),
60
67
        G_DBUS_METHOD_FLAG_NOREPLY    = (1 << 1),
69
76
        G_DBUS_PROPERTY_FLAG_DEPRECATED = (1 << 0),
70
77
} GDBusPropertyFlags;
71
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
 
72
85
typedef struct {
73
86
        const char *name;
74
87
        const char *signature;
75
88
        const char *reply;
76
89
        GDBusMethodFunction function;
77
90
        GDBusMethodFlags flags;
 
91
        unsigned int privilege;
78
92
} GDBusMethodTable;
79
93
 
80
94
typedef struct {
89
103
        GDBusPropertyFlags flags;
90
104
} GDBusPropertyTable;
91
105
 
 
106
typedef struct {
 
107
        unsigned int privilege;
 
108
        const char *action;
 
109
        GDBusSecurityFlags flags;
 
110
        GDBusSecurityFunction function;
 
111
} GDBusSecurityTable;
 
112
 
92
113
gboolean g_dbus_register_interface(DBusConnection *connection,
93
114
                                        const char *path, const char *name,
94
115
                                        const GDBusMethodTable *methods,
99
120
gboolean g_dbus_unregister_interface(DBusConnection *connection,
100
121
                                        const char *path, const char *name);
101
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
 
102
136
DBusMessage *g_dbus_create_error(DBusMessage *message, const char *name,
103
137
                                                const char *format, ...)
104
138
                                        __attribute__((format(printf, 3, 4)));