From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 3/6] gdbus: Introduce GDBusInterfaceFlags
Date: Sun, 23 Dec 2012 17:24:55 +0200 [thread overview]
Message-ID: <1356276298-13795-3-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1356276298-13795-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The flags should be passed in g_dbus_register_interface_with_flags,
currently there only one flag which is G_DBUS_INTERFACE_FLAG_EXPERIMENTAL
which works similarly to G_DBUS_METHOD_FLAG_EXPERIMENTAL but for the
whole interface.
---
gdbus/gdbus.h | 13 +++++++++++++
gdbus/object.c | 20 ++++++++++++++++++++
2 files changed, 33 insertions(+)
diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
index 64f5d62..f49d9f0 100644
--- a/gdbus/gdbus.h
+++ b/gdbus/gdbus.h
@@ -31,6 +31,7 @@ extern "C" {
#include <dbus/dbus.h>
#include <glib.h>
+typedef enum GDBusInterfaceFlags GDBusInterfaceFlags;
typedef enum GDBusMethodFlags GDBusMethodFlags;
typedef enum GDBusSignalFlags GDBusSignalFlags;
typedef enum GDBusPropertyFlags GDBusPropertyFlags;
@@ -88,6 +89,10 @@ typedef void (* GDBusSecurityFunction) (DBusConnection *connection,
gboolean interaction,
GDBusPendingReply pending);
+enum GDBusInterfaceFlags {
+ G_DBUS_INTERFACE_FLAG_EXPERIMENTAL = (1 << 0),
+};
+
enum GDBusMethodFlags {
G_DBUS_METHOD_FLAG_DEPRECATED = (1 << 0),
G_DBUS_METHOD_FLAG_NOREPLY = (1 << 1),
@@ -211,6 +216,14 @@ gboolean g_dbus_register_interface(DBusConnection *connection,
const GDBusPropertyTable *properties,
void *user_data,
GDBusDestroyFunction destroy);
+gboolean g_dbus_register_interface_with_flags(DBusConnection *connection,
+ const char *path, const char *name,
+ GDBusInterfaceFlags flags,
+ const GDBusMethodTable *methods,
+ const GDBusSignalTable *signals,
+ const GDBusPropertyTable *properties,
+ void *user_data,
+ GDBusDestroyFunction destroy);
gboolean g_dbus_unregister_interface(DBusConnection *connection,
const char *path, const char *name);
diff --git a/gdbus/object.c b/gdbus/object.c
index 180d48c..510763a 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -1350,6 +1350,26 @@ gboolean g_dbus_register_interface(DBusConnection *connection,
return TRUE;
}
+gboolean g_dbus_register_interface_with_flags(DBusConnection *connection,
+ const char *path, const char *name,
+ GDBusInterfaceFlags flags,
+ const GDBusMethodTable *methods,
+ const GDBusSignalTable *signals,
+ const GDBusPropertyTable *properties,
+ void *user_data,
+ GDBusDestroyFunction destroy)
+{
+ if (flags & G_DBUS_INTERFACE_FLAG_EXPERIMENTAL) {
+ const char *env = g_getenv("GDBUS_EXPERIMENTAL");
+ if (g_strcmp0(env, "1") != 0)
+ return FALSE;
+ }
+
+ return g_dbus_register_interface(connection, path, name, methods,
+ signals, properties, user_data,
+ destroy);
+}
+
gboolean g_dbus_unregister_interface(DBusConnection *connection,
const char *path, const char *name)
{
--
1.7.11.7
next prev parent reply other threads:[~2012-12-23 15:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-23 15:24 [PATCH BlueZ 1/6] gdbus: Introduce G_DBUS_METHOD_FLAG_EXPERIMENTAL Luiz Augusto von Dentz
2012-12-23 15:24 ` [PATCH BlueZ 2/6] media: Enable RegisterPlayer and UnregisterPlayer methods as experimental Luiz Augusto von Dentz
2012-12-23 15:24 ` Luiz Augusto von Dentz [this message]
2012-12-23 16:09 ` [PATCH BlueZ 3/6] gdbus: Introduce GDBusInterfaceFlags Marcel Holtmann
2012-12-23 16:27 ` Luiz Augusto von Dentz
2012-12-23 16:30 ` Marcel Holtmann
2012-12-23 15:24 ` [PATCH BlueZ 4/6] gdbus: Call check_signals when sending signals with g_dbus_send_message Luiz Augusto von Dentz
2012-12-23 16:10 ` Marcel Holtmann
2012-12-23 16:31 ` Luiz Augusto von Dentz
2012-12-23 16:40 ` Marcel Holtmann
2012-12-23 15:24 ` [PATCH BlueZ 5/6] player: Enable MediaPlayer1 interface as experimental Luiz Augusto von Dentz
2012-12-23 15:24 ` [PATCH BlueZ 6/6] AVRCP: Fix not checking for media_player_controller_create Luiz Augusto von Dentz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1356276298-13795-3-git-send-email-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.