[PATCH] Get access to the IN argument count of an action



---
 libgupnp/gupnp-service.c |   12 +++++++++++-
 libgupnp/gupnp-service.h |    4 ++++
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/libgupnp/gupnp-service.c b/libgupnp/gupnp-service.c
index 9890c01..8a5d6ca 100644
--- a/libgupnp/gupnp-service.c
+++ b/libgupnp/gupnp-service.c
@@ -199,6 +199,8 @@ struct _GUPnPServiceAction {
         xmlNode      *node;
 
         GString      *response_str;
+
+        guint         argument_count;
 };
 
 GUPnPServiceAction *
@@ -517,6 +519,12 @@ gupnp_service_action_get_gvalue (GUPnPServiceAction *action,
         return val;
 }
 
+guint
+gupnp_service_action_get_argument_count (GUPnPServiceAction *action)
+{
+    return action->argument_count;
+}
+
 /**
  * gupnp_service_action_set:
  * @action: A #GUPnPServiceAction
@@ -885,7 +893,7 @@ control_server_handler (SoupServer        *server,
         GUPnPService *service;
         GUPnPContext *context;
         xmlDoc *doc;
-        xmlNode *action_node;
+        xmlNode *action_node, *node;
         const char *soap_action;
         const char *accept_encoding;
         char *action_name;
@@ -963,6 +971,8 @@ control_server_handler (SoupServer        *server,
         action->response_str = new_action_response_str (action_name,
                                                         soap_action);
         action->context      = g_object_ref (context);
+        for (node = action->node->children; node; node = node->next)
+                action->argument_count++;
 
         /* Get accepted encodings */
         accept_encoding = soup_message_headers_get_list (msg->request_headers,
diff --git a/libgupnp/gupnp-service.h b/libgupnp/gupnp-service.h
index 1f56882..be9819a 100644
--- a/libgupnp/gupnp-service.h
+++ b/libgupnp/gupnp-service.h
@@ -160,6 +160,10 @@ gupnp_service_action_return_error (GUPnPServiceAction *action,
 SoupMessage *
 gupnp_service_action_get_message  (GUPnPServiceAction *action);
 
+guint
+gupnp_service_action_get_argument_count
+                                  (GUPnPServiceAction *action);
+
 void
 gupnp_service_notify              (GUPnPService *service,
                                    ...) G_GNUC_NULL_TERMINATED;
-- 
1.7.5.4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]