[gupnp/gupnp-1.4] ServiceAction: Deprecate ServiceAction.return
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gupnp/gupnp-1.4] ServiceAction: Deprecate ServiceAction.return
- Date: Mon, 3 Jan 2022 14:22:36 +0000 (UTC)
commit e6949b0f551c0778a847c66d5b767d1cd300607c
Author: Jens Georg <mail jensge org>
Date: Mon Jan 3 15:21:38 2022 +0100
ServiceAction: Deprecate ServiceAction.return
Since "return" is a keyword in some languages, use return_success
instead.
doc/gupnp-sections.txt | 3 ++-
examples/light-server.c | 6 +++---
libgupnp/gupnp-service.c | 15 ++++++++++++++-
libgupnp/gupnp-service.h | 5 ++++-
tests/test-bugs.c | 4 ++--
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,9 +694,22 @@ 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);
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]