summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2022-01-03 15:21:38 +0100
committerJens Georg <mail@jensge.org>2022-01-03 15:21:38 +0100
commite6949b0f551c0778a847c66d5b767d1cd300607c (patch)
tree15c3e2749340ea72cf4526ef1f7e1d9460e92d03
parentd1fc08f9665510cda54e43243eb4b065a4482ab7 (diff)
downloadgupnp-e6949b0f551c0778a847c66d5b767d1cd300607c.tar.gz
ServiceAction: Deprecate ServiceAction.return
Since "return" is a keyword in some languages, use return_success instead.
-rw-r--r--doc/gupnp-sections.txt3
-rw-r--r--examples/light-server.c6
-rw-r--r--libgupnp/gupnp-service.c15
-rw-r--r--libgupnp/gupnp-service.h5
-rw-r--r--tests/test-bugs.c4
5 files changed, 25 insertions, 8 deletions
diff --git a/doc/gupnp-sections.txt b/doc/gupnp-sections.txt
index acff531..28b4fad 100644
--- a/doc/gupnp-sections.txt
+++ b/doc/gupnp-sections.txt
@@ -135,8 +135,9 @@ gupnp_service_action_set
gupnp_service_action_set_valist
gupnp_service_action_set_value
gupnp_service_action_set_values
-gupnp_service_action_return
+gupnp_service_action_return_success
gupnp_service_action_return_error
+gupnp_service_action_return
gupnp_service_action_get_message
gupnp_service_action_get_argument_count
gupnp_service_notify
diff --git a/examples/light-server.c b/examples/light-server.c
index 66f8566..246b4d6 100644
--- a/examples/light-server.c
+++ b/examples/light-server.c
@@ -69,7 +69,7 @@ set_target_cb (GUPnPService *service,
}
/* Return success to the client */
- gupnp_service_action_return (action);
+ gupnp_service_action_return_success (action);
}
/* GetTarget */
@@ -81,7 +81,7 @@ get_target_cb (G_GNUC_UNUSED GUPnPService *service,
gupnp_service_action_set (action,
"RetTargetValue", G_TYPE_BOOLEAN, status,
NULL);
- gupnp_service_action_return (action);
+ gupnp_service_action_return_success (action);
}
/* GetStatus */
@@ -93,7 +93,7 @@ get_status_cb (G_GNUC_UNUSED GUPnPService *service,
gupnp_service_action_set (action,
"ResultStatus", G_TYPE_BOOLEAN, status,
NULL);
- gupnp_service_action_return (action);
+ gupnp_service_action_return_success (action);
}
/*
diff --git a/libgupnp/gupnp-service.c b/libgupnp/gupnp-service.c
index f1bbb1d..2794ebc 100644
--- a/libgupnp/gupnp-service.c
+++ b/libgupnp/gupnp-service.c
@@ -694,10 +694,23 @@ gupnp_service_action_set_value (GUPnPServiceAction *action,
* @action: A #GUPnPServiceAction
*
* Return succesfully.
+ * Deprecated: 1.4.2: Use gupnp_service_action_return_success() instead
**/
void
gupnp_service_action_return (GUPnPServiceAction *action)
{
+ gupnp_service_action_return_success (action);
+}
+
+/**
+ * gupnp_service_action_return_success:
+ * @action: A #GUPnPServiceAction
+ *
+ * Return succesfully.
+ **/
+void
+gupnp_service_action_return_success (GUPnPServiceAction *action)
+{
g_return_if_fail (action != NULL);
soup_message_set_status (action->msg, SOUP_STATUS_OK);
@@ -902,7 +915,7 @@ query_state_variable (GUPnPService *service,
xmlFree (var_name);
}
- gupnp_service_action_return (action);
+ gupnp_service_action_return_success (action);
}
/* controlURL handler */
diff --git a/libgupnp/gupnp-service.h b/libgupnp/gupnp-service.h
index 8796686..08dfe74 100644
--- a/libgupnp/gupnp-service.h
+++ b/libgupnp/gupnp-service.h
@@ -106,8 +106,11 @@ gupnp_service_action_set_value (GUPnPServiceAction *action,
const char *argument,
const GValue *value);
+G_DEPRECATED_FOR (gupnp_service_action_return_success)
+void gupnp_service_action_return (GUPnPServiceAction *action);
+
void
-gupnp_service_action_return (GUPnPServiceAction *action);
+gupnp_service_action_return_success (GUPnPServiceAction *action);
void
gupnp_service_action_return_error (GUPnPServiceAction *action,
diff --git a/tests/test-bugs.c b/tests/test-bugs.c
index 9c514c5..03d4e48 100644
--- a/tests/test-bugs.c
+++ b/tests/test-bugs.c
@@ -90,7 +90,7 @@ test_bgo_696762_on_browse_call (G_GNUC_UNUSED GUPnPService *service,
g_assert (node != NULL);
g_assert_cmpstr ((const char *) node->name, ==, "SortCriteria");
node = node->next;
- gupnp_service_action_return (action);
+ gupnp_service_action_return_success (action);
}
static void
@@ -544,7 +544,7 @@ test_ggo_58_on_ping_call (GUPnPService *service,
GUPnPServiceAction *action,
gpointer user_data)
{
- gupnp_service_action_return (action);
+ gupnp_service_action_return_success (action);
}
static void