linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@profusion.mobi>
To: linux-bluetooth@vger.kernel.org
Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Subject: [PATCH RESEND BlueZ v6 04/13] gdbus: add and use helpers for table declarations
Date: Fri, 18 May 2012 00:23:28 -0300	[thread overview]
Message-ID: <1337311417-1245-5-git-send-email-lucas.demarchi@profusion.mobi> (raw)
In-Reply-To: <1337311417-1245-1-git-send-email-lucas.demarchi@profusion.mobi>

---
 gdbus/gdbus.h  |   86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 gdbus/object.c |    3 +-
 2 files changed, 88 insertions(+), 1 deletion(-)

diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
index e5e7938..8354633 100644
--- a/gdbus/gdbus.h
+++ b/gdbus/gdbus.h
@@ -118,6 +118,92 @@ typedef struct {
 	GDBusSecurityFunction function;
 } GDBusSecurityTable;
 
+#define GDBUS_ARGS(args...) (const GDBusArgInfo[]) { args, { } }
+
+#define _GDBUS_METHOD(_name, _signature, _reply, _in_args, _out_args, _function) \
+	.name = _name, \
+	.signature = _signature, \
+	.reply = _reply, \
+	.in_args = _in_args, \
+	.out_args = _out_args, \
+	.function = _function
+
+#define _GDBUS_ASYNC_METHOD(_name, _signature, _reply, _in_args, _out_args, _function) \
+	.name = _name, \
+	.signature = _signature, \
+	.reply = _reply, \
+	.in_args = _in_args, \
+	.out_args = _out_args, \
+	.function = _function, \
+	.flags = G_DBUS_METHOD_FLAG_ASYNC
+
+#define _GDBUS_DEPRECATED_METHOD(_name, _signature, _reply, _in_args, _out_args, _function) \
+	.name = _name, \
+	.signature = _signature, \
+	.reply = _reply, \
+	.in_args = _in_args, \
+	.out_args = _out_args, \
+	.function = _function, \
+	.flags = G_DBUS_METHOD_FLAG_DEPRECATED
+
+#define _GDBUS_DEPRECATED_ASYNC_METHOD(_name, _signature, _reply, _in_args, _out_args, _function) \
+	.name = _name, \
+	.signature = _signature, \
+	.reply = _reply, \
+	.in_args = _in_args, \
+	.out_args = _out_args, \
+	.function = _function, \
+	.flags = G_DBUS_METHOD_FLAG_ASYNC | G_DBUS_METHOD_FLAG_DEPRECATED
+
+#define _GDBUS_SIGNAL(_name, _signature, _args) \
+	.name = _name, \
+	.signature = _signature, \
+	.args = _args
+
+#define _GDBUS_DEPRECATED_SIGNAL(_name, _signature, _args) \
+	.name = _name, \
+	.signature = _signature, \
+	.args = _args, \
+	.flags = G_DBUS_SIGNAL_FLAG_DEPRECATED
+
+/* Helpers with no signature and reply */
+
+#define GDBUS_METHOD(_name, _in_args, _out_args, _function) \
+	.name = _name, \
+	.in_args = _in_args, \
+	.out_args = _out_args, \
+	.function = _function
+
+#define GDBUS_ASYNC_METHOD(_name, _in_args, _out_args, _function) \
+	.name = _name, \
+	.in_args = _in_args, \
+	.out_args = _out_args, \
+	.function = _function, \
+	.flags = G_DBUS_METHOD_FLAG_ASYNC
+
+#define GDBUS_DEPRECATED_METHOD(_name, _in_args, _out_args, _function) \
+	.name = _name, \
+	.in_args = _in_args, \
+	.out_args = _out_args, \
+	.function = _function, \
+	.flags = G_DBUS_METHOD_FLAG_DEPRECATED
+
+#define GDBUS_DEPRECATED_ASYNC_METHOD(_name, _in_args, _out_args, _function) \
+	.name = _name, \
+	.in_args = _in_args, \
+	.out_args = _out_args, \
+	.function = _function, \
+	.flags = G_DBUS_METHOD_FLAG_ASYNC | G_DBUS_METHOD_FLAG_DEPRECATED
+
+#define GDBUS_SIGNAL(_name, _args) \
+	.name = _name, \
+	.args = _args
+
+#define GDBUS_DEPRECATED_SIGNAL(_name, _args) \
+	.name = _name, \
+	.args = _args, \
+	.flags = G_DBUS_SIGNAL_FLAG_DEPRECATED
+
 gboolean g_dbus_register_interface(DBusConnection *connection,
 					const char *path, const char *name,
 					const GDBusMethodTable *methods,
diff --git a/gdbus/object.c b/gdbus/object.c
index 0ef6c80..2ddc574 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -497,7 +497,8 @@ done:
 }
 
 static const GDBusMethodTable introspect_methods[] = {
-	{ "Introspect",	"",	"s", introspect	},
+	{ _GDBUS_METHOD("Introspect", "", "s", NULL,
+			GDBUS_ARGS({ "xml", "s" }), introspect) },
 	{ }
 };
 
-- 
1.7.10.2


  parent reply	other threads:[~2012-05-18  3:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-18  3:23 [PATCH RESEND BlueZ v6 00/13] Better D-Bus introspection Lucas De Marchi
2012-05-18  3:23 ` [PATCH RESEND BlueZ v6 01/13] Constify GDBus method tables Lucas De Marchi
2012-05-18  3:23 ` [PATCH RESEND BlueZ v6 02/13] Constify GDBus signal tables Lucas De Marchi
2012-05-18  3:23 ` [PATCH RESEND BlueZ v6 03/13] gdbus: add argument info to methods and signals Lucas De Marchi
2012-05-18  3:23 ` Lucas De Marchi [this message]
2012-05-18  3:23 ` [PATCH RESEND BlueZ v6 05/13] Convert GDBus methods to use macro helpers Lucas De Marchi
2012-05-18  3:23 ` [PATCH RESEND BlueZ v6 06/13] gdbus: use GDBusArgInfo to generate introspection Lucas De Marchi
2012-05-18  3:23 ` [PATCH RESEND BlueZ v6 07/13] gdbus: loop over args to check message signature Lucas De Marchi
2012-05-18  3:23 ` [PATCH RESEND BlueZ v6 08/13] Do not set signature and reply in GDBus tables Lucas De Marchi
2012-05-18  3:23 ` [PATCH RESEND BlueZ v6 09/13] gdbus: remove signature and reply from tables Lucas De Marchi
2012-05-18  3:23 ` [PATCH RESEND BlueZ v6 10/13] gdbus: add Deprecated annotation in introspection Lucas De Marchi
2012-05-18  3:23 ` [PATCH RESEND BlueZ v6 11/13] gdbus: add Method.NoReply " Lucas De Marchi
2012-05-18  3:23 ` [PATCH RESEND BlueZ v6 12/13] gdbus: do not check signature twice Lucas De Marchi
2012-05-18  3:23 ` [PATCH RESEND BlueZ v6 13/13] adapter: " Lucas De Marchi
2012-05-18  3:37 ` [PATCH RESEND BlueZ v6 00/13] Better D-Bus introspection Marcel Holtmann

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=1337311417-1245-5-git-send-email-lucas.demarchi@profusion.mobi \
    --to=lucas.demarchi@profusion.mobi \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).