diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2013-09-10 17:32:35 +0200 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2014-09-03 12:17:28 +0200 |
commit | 3e6598acbaceac2353848d860a8b8e7c692e1a4f (patch) | |
tree | b433925a69de3dd69b5c93757901ddfdd0b2b168 | |
parent | aacef5693171592a632cef8f9374ccef2ed40eae (diff) |
Add rest_proxy_call_get_function()
There are rest_proxy_call_[gs]et_method() methods, a
rest_proxy_call_set_function() method, but no corresponding getter.
Adding it makes the API more consistent.
https://bugzilla.gnome.org/show_bug.cgi?id=708358
(cherry picked from commit 3513c3d80c4b5f60ab6531e5514a538f3e93f85e)
-rw-r--r-- | docs/reference/rest/rest-sections.txt | 1 | ||||
-rw-r--r-- | rest/rest-proxy-call.c | 23 | ||||
-rw-r--r-- | rest/rest-proxy-call.h | 2 |
3 files changed, 26 insertions, 0 deletions
diff --git a/docs/reference/rest/rest-sections.txt b/docs/reference/rest/rest-sections.txt index 1418001..fbb121b 100644 --- a/docs/reference/rest/rest-sections.txt +++ b/docs/reference/rest/rest-sections.txt @@ -30,6 +30,7 @@ RestProxyCallError rest_proxy_call_set_method rest_proxy_call_get_method rest_proxy_call_set_function +rest_proxy_call_get_function rest_proxy_call_add_header rest_proxy_call_add_headers rest_proxy_call_add_headers_from_valist diff --git a/rest/rest-proxy-call.c b/rest/rest-proxy-call.c index b2dbb65..03c1874 100644 --- a/rest/rest-proxy-call.c +++ b/rest/rest-proxy-call.c @@ -262,6 +262,29 @@ rest_proxy_call_set_function (RestProxyCall *call, } /** + * rest_proxy_call_get_function: + * @call: The #RestProxyCall + * + * Get the REST function that is going to be called on the proxy. + * + * Returns: The REST "function" for the current call, see also + * rest_proxy_call_set_function(). This string is owned by the #RestProxyCall + * and should not be freed. + * Since: 0.7.92 + */ +const char * +rest_proxy_call_get_function (RestProxyCall *call) +{ + RestProxyCallPrivate *priv; + + g_return_val_if_fail (REST_IS_PROXY_CALL (call), NULL); + priv = GET_PRIVATE (call); + + return priv->function; +} + + +/** * rest_proxy_call_add_header: * @call: The #RestProxyCall * @header: The name of the header to set diff --git a/rest/rest-proxy-call.h b/rest/rest-proxy-call.h index 1e96afd..4b8f983 100644 --- a/rest/rest-proxy-call.h +++ b/rest/rest-proxy-call.h @@ -109,6 +109,8 @@ const char * rest_proxy_call_get_method (RestProxyCall *call); void rest_proxy_call_set_function (RestProxyCall *call, const gchar *function); +const char * rest_proxy_call_get_function (RestProxyCall *call); + void rest_proxy_call_add_header (RestProxyCall *call, const gchar *header, const gchar *value); |