[libsoup/wip/xclaesse/xmlrpc: 6/10] xmlrpc: Deprecate old API and fix doc
- From: Xavier Claessens <xclaesse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/wip/xclaesse/xmlrpc: 6/10] xmlrpc: Deprecate old API and fix doc
- Date: Tue, 23 Jun 2015 14:47:35 +0000 (UTC)
commit 75191c0b717c767a36033aa0a339ee32468a9bee
Author: Xavier Claessens <xavier claessens collabora com>
Date: Sat Jun 13 09:56:32 2015 -0400
xmlrpc: Deprecate old API and fix doc
https://bugzilla.gnome.org/show_bug.cgi?id=746495
docs/reference/libsoup-2.4-sections.txt | 20 +++++++-----
libsoup/soup-value-utils.c | 30 +++++++++++++++++++
libsoup/soup-value-utils.h | 16 ++++++++++
libsoup/soup-version.c | 10 ++++++
libsoup/soup-version.h.in | 15 +++++++++
libsoup/soup-xmlrpc-variant.c | 44 +++++++++++++++++++---------
libsoup/soup-xmlrpc-variant.h | 3 ++
libsoup/soup-xmlrpc.c | 49 ++++++++++++-------------------
libsoup/soup-xmlrpc.h | 12 ++++++--
9 files changed, 144 insertions(+), 55 deletions(-)
---
diff --git a/docs/reference/libsoup-2.4-sections.txt b/docs/reference/libsoup-2.4-sections.txt
index c7312b8..521f3a2 100644
--- a/docs/reference/libsoup-2.4-sections.txt
+++ b/docs/reference/libsoup-2.4-sections.txt
@@ -830,25 +830,31 @@ soup_form_encode_urlencoded_list
<FILE>soup-xmlrpc</FILE>
<TITLE>XMLRPC Support</TITLE>
<SUBSECTION>
+SOUP_XMLRPC_ERROR
+SoupXMLRPCError
+SOUP_XMLRPC_FAULT
+SoupXMLRPCFault
+<SUBSECTION>
soup_xmlrpc_build_request
soup_xmlrpc_message_new
+soup_xmlrpc_parse_response
soup_xmlrpc_new_custom
soup_xmlrpc_new_datetime
<SUBSECTION>
+SoupXMLRPCParams
+soup_xmlrpc_params_free
+soup_xmlrpc_params_parse
+soup_xmlrpc_parse_request
+soup_xmlrpc_parse_request_full
soup_xmlrpc_build_response
-soup_xmlrpc_message_set_response
soup_xmlrpc_build_fault
-soup_xmlrpc_set_fault
+soup_xmlrpc_message_set_response
soup_xmlrpc_message_set_fault
<SUBSECTION>
-SOUP_XMLRPC_FAULT
-SoupXMLRPCFault
-<SUBSECTION>
soup_xmlrpc_build_method_call
soup_xmlrpc_request_new
soup_xmlrpc_parse_method_response
soup_xmlrpc_extract_method_response
-<SUBSECTION>
soup_xmlrpc_parse_method_call
soup_xmlrpc_extract_method_call
soup_xmlrpc_build_method_response
@@ -856,8 +862,6 @@ soup_xmlrpc_set_response
soup_xmlrpc_set_fault
<SUBSECTION Private>
soup_xmlrpc_error_quark
-SOUP_XMLRPC_ERROR
-SoupXMLRPCError
soup_xmlrpc_fault_quark
</SECTION>
diff --git a/libsoup/soup-value-utils.c b/libsoup/soup-value-utils.c
index 5ae0a69..2afb0e9 100644
--- a/libsoup/soup-value-utils.c
+++ b/libsoup/soup-value-utils.c
@@ -23,6 +23,8 @@
*
* They are written for use with soup-xmlrpc, but they also work with
* types not used by XML-RPC.
+ *
+ * Deprecated: Use #GVariant API instead.
**/
/**
@@ -34,6 +36,8 @@
* Copies an argument of type @type from @args into @val. @val will
* point directly to the value in @args rather than copying it, so you
* must g_value_copy() it if you want it to remain valid.
+ *
+ * Deprecated: Use #GVariant API instead.
**/
/**
@@ -45,6 +49,8 @@
* Extracts a value of type @type from @val into @args. The return
* value will point to the same data as @val rather than being a copy
* of it.
+ *
+ * Deprecated: Use #GVariant API instead.
**/
static void
@@ -62,6 +68,8 @@ soup_value_hash_value_free (gpointer val)
*
* Return value: (element-type utf8 GValue) (transfer full): a new
* empty #GHashTable
+ *
+ * Deprecated: Use #GVariant API instead.
**/
GHashTable *
soup_value_hash_new (void)
@@ -99,6 +107,7 @@ soup_value_hash_insert_valist (GHashTable *hash, const char *first_key,
* with soup_value_hash_insert(), the keys and values are copied
* rather than being inserted directly.
*
+ * Deprecated: Use #GVariant API instead.
* Return value: (element-type utf8 GValue) (transfer full): a new
* #GHashTable, initialized with the given values
**/
@@ -123,6 +132,8 @@ soup_value_hash_new_with_vals (const char *first_key, ...)
*
* Inserts @value into @hash. (Unlike with g_hash_table_insert(), both
* the key and the value are copied).
+ *
+ * Deprecated: Use #GVariant API instead.
**/
void
soup_value_hash_insert_value (GHashTable *hash, const char *key, GValue *value)
@@ -143,6 +154,8 @@ soup_value_hash_insert_value (GHashTable *hash, const char *key, GValue *value)
*
* Inserts the provided value of type @type into @hash. (Unlike with
* g_hash_table_insert(), both the key and the value are copied).
+ *
+ * Deprecated: Use #GVariant API instead.
**/
void
soup_value_hash_insert (GHashTable *hash, const char *key, GType type, ...)
@@ -166,6 +179,8 @@ soup_value_hash_insert (GHashTable *hash, const char *key, GType type, ...)
* Inserts the given data into @hash. As with
* soup_value_hash_insert(), the keys and values are copied rather
* than being inserted directly.
+ *
+ * Deprecated: Use #GVariant API instead.
**/
void
soup_value_hash_insert_vals (GHashTable *hash, const char *first_key, ...)
@@ -187,6 +202,7 @@ soup_value_hash_insert_vals (GHashTable *hash, const char *first_key, ...)
* Looks up @key in @hash and stores its value into the provided
* location.
*
+ * Deprecated: Use #GVariant API instead.
* Return value: %TRUE if @hash contained a value with key @key and
* type @type, %FALSE if not.
**/
@@ -217,6 +233,7 @@ soup_value_hash_lookup (GHashTable *hash, const char *key, GType type, ...)
*
* Looks up a number of keys in @hash and returns their values.
*
+ * Deprecated: Use #GVariant API instead.
* Return value: %TRUE if all of the keys were found, %FALSE
* if any were missing; note that you will generally need to
* initialize each destination variable to a reasonable default
@@ -266,6 +283,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
* by %G_TYPE_INVALID. (The array will contain copies of the provided
* data rather than pointing to the passed-in data directly.)
*
+ * Deprecated: Use #GVariant API instead.
* Return value: (nullable): a new #GValueArray, or %NULL if an error
* occurred.
**/
@@ -294,6 +312,7 @@ soup_value_array_from_args (va_list args)
* terminated by %G_TYPE_INVALID. The returned values will point to the
* same memory as the values in the array.
*
+ * Deprecated: Use #GVariant API instead.
* Return value: success or failure
**/
gboolean
@@ -321,6 +340,7 @@ soup_value_array_to_args (GValueArray *array, va_list args)
* Creates a new %GValueArray. (This is just a wrapper around
* g_value_array_new(), for naming consistency purposes.)
*
+ * Deprecated: Use #GVariant API instead.
* Return value: a new %GValueArray
**/
GValueArray *
@@ -354,6 +374,7 @@ soup_value_array_append_valist (GValueArray *array,
* Creates a new %GValueArray and copies the provided values
* into it.
*
+ * Deprecated: Use #GVariant API instead.
* Return value: a new %GValueArray
**/
GValueArray *
@@ -379,6 +400,8 @@ soup_value_array_new_with_vals (GType first_type, ...)
* Inserts the provided value of type @type into @array as with
* g_value_array_insert(). (The provided data is copied rather than
* being inserted directly.)
+ *
+ * Deprecated: Use #GVariant API instead.
**/
void
soup_value_array_insert (GValueArray *array, guint index_, GType type, ...)
@@ -401,6 +424,8 @@ soup_value_array_insert (GValueArray *array, guint index_, GType type, ...)
* Appends the provided value of type @type to @array as with
* g_value_array_append(). (The provided data is copied rather than
* being inserted directly.)
+ *
+ * Deprecated: Use #GVariant API instead.
**/
void
soup_value_array_append (GValueArray *array, GType type, ...)
@@ -424,6 +449,8 @@ soup_value_array_append (GValueArray *array, GType type, ...)
* Appends the provided values into @array as with
* g_value_array_append(). (The provided data is copied rather than
* being inserted directly.)
+ *
+ * Deprecated: Use #GVariant API instead.
**/
void
soup_value_array_append_vals (GValueArray *array, GType first_type, ...)
@@ -445,6 +472,7 @@ soup_value_array_append_vals (GValueArray *array, GType first_type, ...)
* Gets the @index_ element of @array and stores its value into the
* provided location.
*
+ * Deprecated: Use #GVariant API instead.
* Return value: %TRUE if @array contained a value with index @index_
* and type @type, %FALSE if not.
**/
@@ -489,6 +517,8 @@ soup_byte_array_free (GByteArray *ba)
*
* glib did not used to define a #GType for #GByteArray, so libsoup
* defines this one itself.
+ *
+ * Deprecated: Use #GVariant API instead.
**/
typedef GByteArray SoupByteArray;
G_DEFINE_BOXED_TYPE (SoupByteArray, soup_byte_array, soup_byte_array_copy, soup_byte_array_free)
diff --git a/libsoup/soup-value-utils.h b/libsoup/soup-value-utils.h
index 1ff4235..2a50abc 100644
--- a/libsoup/soup-value-utils.h
+++ b/libsoup/soup-value-utils.h
@@ -29,51 +29,67 @@ G_STMT_START { \
g_free (getv_error); \
} G_STMT_END
+SOUP_DEPRECATED_IN_2_52
GHashTable *soup_value_hash_new (void);
+SOUP_DEPRECATED_IN_2_52
GHashTable *soup_value_hash_new_with_vals (const char *first_key,
...) G_GNUC_NULL_TERMINATED;
+SOUP_DEPRECATED_IN_2_52
void soup_value_hash_insert_value (GHashTable *hash,
const char *key,
GValue *value);
+SOUP_DEPRECATED_IN_2_52
void soup_value_hash_insert (GHashTable *hash,
const char *key,
GType type,
...);
+SOUP_DEPRECATED_IN_2_52
void soup_value_hash_insert_vals (GHashTable *hash,
const char *first_key,
...) G_GNUC_NULL_TERMINATED;
+SOUP_DEPRECATED_IN_2_52
gboolean soup_value_hash_lookup (GHashTable *hash,
const char *key,
GType type,
...);
+SOUP_DEPRECATED_IN_2_52
gboolean soup_value_hash_lookup_vals (GHashTable *hash,
const char *first_key,
...) G_GNUC_NULL_TERMINATED;
+SOUP_DEPRECATED_IN_2_52
GValueArray *soup_value_array_from_args (va_list args);
+SOUP_DEPRECATED_IN_2_52
gboolean soup_value_array_to_args (GValueArray *array,
va_list args);
+SOUP_DEPRECATED_IN_2_52
GValueArray *soup_value_array_new (void);
+SOUP_DEPRECATED_IN_2_52
GValueArray *soup_value_array_new_with_vals (GType first_type,
...) G_GNUC_NULL_TERMINATED;
+SOUP_DEPRECATED_IN_2_52
void soup_value_array_insert (GValueArray *array,
guint index_,
GType type,
...);
+SOUP_DEPRECATED_IN_2_52
void soup_value_array_append (GValueArray *array,
GType type,
...);
+SOUP_DEPRECATED_IN_2_52
void soup_value_array_append_vals (GValueArray *array,
GType first_type,
...) G_GNUC_NULL_TERMINATED;
+SOUP_DEPRECATED_IN_2_52
gboolean soup_value_array_get_nth (GValueArray *array,
guint index_,
GType type,
...);
+SOUP_DEPRECATED_IN_2_52
GType soup_byte_array_get_type (void);
#define SOUP_TYPE_BYTE_ARRAY (soup_byte_array_get_type ())
diff --git a/libsoup/soup-version.c b/libsoup/soup-version.c
index 478eb4e..99c3b53 100644
--- a/libsoup/soup-version.c
+++ b/libsoup/soup-version.c
@@ -325,3 +325,13 @@ soup_check_version (guint major,
*
* Since: 2.50
*/
+
+/**
+ * SOUP_VERSION_2_52:
+ *
+ * A macro that evaluates to the 2.52 version of libsoup, in a format
+ * that can be used by %SOUP_VERSION_MIN_REQUIRED and
+ * %SOUP_VERSION_MAX_ALLOWED.
+ *
+ * Since: 2.52
+ */
diff --git a/libsoup/soup-version.h.in b/libsoup/soup-version.h.in
index 148b5e9..fb10386 100644
--- a/libsoup/soup-version.h.in
+++ b/libsoup/soup-version.h.in
@@ -50,6 +50,7 @@ gboolean soup_check_version (guint major,
#define SOUP_VERSION_2_46 (SOUP_ENCODE_VERSION (2, 46))
#define SOUP_VERSION_2_48 (SOUP_ENCODE_VERSION (2, 48))
#define SOUP_VERSION_2_50 (SOUP_ENCODE_VERSION (2, 50))
+#define SOUP_VERSION_2_52 (SOUP_ENCODE_VERSION (2, 52))
/* evaluates to the current stable version; for development cycles,
* this means the next stable target
@@ -286,6 +287,20 @@ gboolean soup_check_version (guint major,
# define SOUP_AVAILABLE_IN_2_50
#endif
+#if SOUP_VERSION_MIN_REQUIRED >= SOUP_VERSION_2_52
+# define SOUP_DEPRECATED_IN_2_52 GLIB_DEPRECATED
+# define SOUP_DEPRECATED_IN_2_52_FOR(f) GLIB_DEPRECATED_FOR(f)
+#else
+# define SOUP_DEPRECATED_IN_2_52
+# define SOUP_DEPRECATED_IN_2_52_FOR(f)
+#endif
+
+#if SOUP_VERSION_MAX_ALLOWED < SOUP_VERSION_2_52
+# define SOUP_AVAILABLE_IN_2_52 GLIB_UNAVAILABLE(2, 50)
+#else
+# define SOUP_AVAILABLE_IN_2_52
+#endif
+
G_END_DECLS
#endif /* SOUP_VERSION_H */
diff --git a/libsoup/soup-xmlrpc-variant.c b/libsoup/soup-xmlrpc-variant.c
index 86da7dd..9ef813d 100644
--- a/libsoup/soup-xmlrpc-variant.c
+++ b/libsoup/soup-xmlrpc-variant.c
@@ -248,21 +248,26 @@ fail:
*
* @params is a #GVariant tuple representing the method parameters.
*
- * Limitations that will cause method to return %FALSE and set @error:
- * - maybes and uint64 cannot be serialized.
- * - Dictionaries must have string keys.
- *
- * Special cases:
- * - "a{s*}" are serialized as <struct>
+ * Serialization details:
+ * - "a{s*}" and "{s*}" are serialized as <struct>
* - "ay" are serialized as <base64>
- * - tuples are serialized as <array>
- * - variants created by soup_xmlrpc_new_datetime() are serialized as
+ * - Other arrays and tuples are serialized as <array>
+ * - booleans are serialized as <boolean>
+ * - byte, int16, uint16 and int32 are serialized as <int>
+ * - uint32 and int64 are serialized as nonstandard <i8>
+ * - doubles are serialized as <double>
+ * - Strings, object-paths and signatures are serialized as <string>
+ * - Variants (i.e. "v" type) are unwrapped and their child is serialized.
+ * - #GVariant created by soup_xmlrpc_new_datetime() are serialized as
* <dateTime.iso8601>
- * - uint32 and int64 are serialized as unstandard <i8>
+ * - Other types are not supported and will return %NULL and set @error.
+ * This notably includes: uint64, maybes and dictionaries with non-string
+ * keys.
*
* If @params is floating, it is consumed.
*
* Return value: the text of the methodCall, or %NULL on error.
+ * Since: 2.52
**/
gchar *
soup_xmlrpc_build_request (const gchar *method_name,
@@ -336,6 +341,7 @@ fail:
*
* Returns: (transfer full): a #SoupMessage encoding the
* indicated XML-RPC request, or %NULL on error.
+ * Since: 2.52
**/
SoupMessage *
soup_xmlrpc_message_new (const gchar *uri,
@@ -370,6 +376,7 @@ soup_xmlrpc_message_new (const gchar *uri,
* If @value is floating, it is consumed.
*
* Returns: the text of the methodResponse, or %NULL on error.
+ * Since: 2.52
**/
gchar *
soup_xmlrpc_build_response (GVariant *value, GError **error)
@@ -423,6 +430,7 @@ soup_xmlrpc_build_response (GVariant *value, GError **error)
* If @value is floating, it is consumed.
*
* Returns: %TRUE on success, %FALSE otherwise.
+ * Since: 2.52
**/
gboolean
soup_xmlrpc_message_set_response (SoupMessage *msg, GVariant *value, GError **error)
@@ -980,6 +988,8 @@ fail:
*
* Opaque structure containing an XML-RPC value. Can be parsed using
* soup_xmlrpc_params_parse() and freed with soup_xmlrpc_params_free().
+ *
+ * Since: 2.52
*/
struct _SoupXMLRPCParams
{
@@ -991,6 +1001,8 @@ struct _SoupXMLRPCParams
* @self: a SoupXMLRPCParams
*
* Free a #SoupXMLRPCParams returned by soup_xmlrpc_parse_request().
+ *
+ * Since: 2.52
*/
void
soup_xmlrpc_params_free (SoupXMLRPCParams *self)
@@ -1024,6 +1036,7 @@ soup_xmlrpc_params_new (xmlNode *node)
* See soup_xmlrpc_parse_request_full() for deserialization details.
*
* Returns: (transfer full): a new #GVariant, or %NULL
+ * Since: 2.52
*/
GVariant *
soup_xmlrpc_params_parse (SoupXMLRPCParams *self,
@@ -1053,6 +1066,7 @@ soup_xmlrpc_params_parse (SoupXMLRPCParams *self,
* instead.
*
* Returns: (transfer full): method's name, or %NULL on error.
+ * Since: 2.52
**/
gchar *
soup_xmlrpc_parse_request (const gchar *method_call,
@@ -1122,11 +1136,7 @@ fail:
* soup_xmlrpc_parse_request() should be used instead if the method name must be
* known to determine @parameters' signature.
*
- * Limitations that will cause method to return %NULL and set @error:
- * - @signature must not have maybes.
- * - Dictionaries must have string keys.
- *
- * Special cases:
+ * Deserialization details:
* - If @signalture is provided, <int> and <i4> can be deserialized
* to byte, int16, uint16, int32, uint32, int64, uint64 or handle. Otherwise
* it will be int32. If the value is out of range for the target type it will
@@ -1139,8 +1149,11 @@ fail:
* - <string> will be deserialized to "s". @signalture could define
* another type ("o" or "g").
* - <dateTime.iso8601> will be deserialized to int64 unix timestamp.
+ * - @signature must not have maybes, otherwise an @error is returned.
+ * - Dictionaries must have string keys, otherwise an @error is returned.
*
* Returns: (transfer full): method's name, or %NULL on error.
+ * Since: 2.52
**/
gchar *
soup_xmlrpc_parse_request_full (const gchar *method_call,
@@ -1187,6 +1200,7 @@ soup_xmlrpc_parse_request_full (const gchar *method_call,
* See soup_xmlrpc_parse_request_full() for deserialization details.
*
* Returns: (transfer full): a new #GVariant, or %NULL
+ * Since: 2.52
**/
GVariant *
soup_xmlrpc_parse_response (const gchar *method_response,
@@ -1279,6 +1293,7 @@ fail:
* node containing @value. See soup_xmlrpc_build_request().
*
* Returns: a floating #GVariant.
+ * Since: 2.52
*/
GVariant *
soup_xmlrpc_new_custom (const gchar *type, const gchar *value)
@@ -1295,6 +1310,7 @@ soup_xmlrpc_new_custom (const gchar *type, const gchar *value)
* node. See soup_xmlrpc_build_request().
*
* Returns: a floating #GVariant.
+ * Since: 2.52
*/
GVariant *
soup_xmlrpc_new_datetime (time_t timestamp)
diff --git a/libsoup/soup-xmlrpc-variant.h b/libsoup/soup-xmlrpc-variant.h
index c7d5c34..c428ab3 100644
--- a/libsoup/soup-xmlrpc-variant.h
+++ b/libsoup/soup-xmlrpc-variant.h
@@ -41,6 +41,9 @@ gchar *soup_xmlrpc_parse_request_full (const gchar *method_call,
GError **error);
gchar *soup_xmlrpc_build_response (GVariant *value,
GError **error);
+gchar *soup_xmlrpc_build_fault (gint fault_code,
+ const gchar *fault_format,
+ ...) G_GNUC_PRINTF (2, 3);
gboolean soup_xmlrpc_message_set_response (SoupMessage *msg,
GVariant *value,
GError **error);
diff --git a/libsoup/soup-xmlrpc.c b/libsoup/soup-xmlrpc.c
index 493fca9..c09c8c7 100644
--- a/libsoup/soup-xmlrpc.c
+++ b/libsoup/soup-xmlrpc.c
@@ -22,6 +22,10 @@
*
**/
+/* This whole file is pretty much deprecated and replaced by
+ * soup-xmlrpc-variant.c */
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
static xmlNode *find_real_node (xmlNode *node);
static gboolean insert_value (xmlNode *parent, GValue *value);
@@ -96,13 +100,7 @@ insert_value (xmlNode *parent, GValue *value)
if (!struct_node)
return FALSE;
-#ifdef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-#endif
} else if (type == G_TYPE_VALUE_ARRAY) {
-#ifdef G_GNUC_END_IGNORE_DEPRECATIONS
-G_GNUC_END_IGNORE_DEPRECATIONS
-#endif
GValueArray *va = g_value_get_boxed (value);
xmlNode *node;
int i;
@@ -150,6 +148,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
* For structs, use a #GHashTable that maps strings to #GValue;
* soup_value_hash_new() and related methods can help with this.
*
+ * Deprecated: Use soup_xmlrpc_build_request() instead.
* Return value: (nullable): the text of the methodCall, or %NULL on
* error
**/
@@ -202,13 +201,8 @@ soup_xmlrpc_request_newv (const char *uri, const char *method_name, va_list args
body = soup_xmlrpc_build_method_call (method_name, params->values,
params->n_values);
-#ifdef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-#endif
g_value_array_free (params);
-#ifdef G_GNUC_END_IGNORE_DEPRECATIONS
-G_GNUC_END_IGNORE_DEPRECATIONS
-#endif
+
if (!body)
return NULL;
@@ -231,6 +225,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
* and then a value of the appropriate type, finally terminated by
* %G_TYPE_INVALID.
*
+ * Deprecated: Use soup_xmlrpc_message_new() instead.
* Return value: (transfer full): a #SoupMessage encoding the
* indicated XML-RPC request.
**/
@@ -257,6 +252,7 @@ soup_xmlrpc_request_new (const char *uri, const char *method_name, ...)
* The glib type to XML-RPC type mapping is as with
* soup_xmlrpc_build_method_call(), qv.
*
+ * Deprecated: Use soup_xmlrpc_build_response() instead.
* Return value: (nullable): the text of the methodResponse, or %NULL
* on error
**/
@@ -378,6 +374,8 @@ soup_xmlrpc_build_fault (int fault_code, const char *fault_format, ...)
* Sets the status code and response body of @msg to indicate a
* successful XML-RPC call, with a return value given by @type and the
* following varargs argument, of the type indicated by @type.
+ *
+ * Deprecated: Use soup_xmlrpc_message_set_response() instead.
**/
void
soup_xmlrpc_set_response (SoupMessage *msg, GType type, ...)
@@ -407,6 +405,8 @@ soup_xmlrpc_set_response (SoupMessage *msg, GType type, ...)
* Sets the status code and response body of @msg to indicate an
* unsuccessful XML-RPC call, with the error described by @fault_code
* and @fault_format.
+ *
+ * Deprecated: Use soup_xmlrpc_message_set_fault() instead.
**/
void
soup_xmlrpc_set_fault (SoupMessage *msg, int fault_code,
@@ -558,9 +558,6 @@ parse_value (xmlNode *xmlvalue, GValue *value)
if (!data || strcmp ((const char *)data->name, "data") != 0)
return FALSE;
-#ifdef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-#endif
array = g_value_array_new (1);
for (xval = find_real_node (data->children);
xval;
@@ -577,9 +574,6 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
}
g_value_init (value, G_TYPE_VALUE_ARRAY);
g_value_take_boxed (value, array);
-#ifdef G_GNUC_END_IGNORE_DEPRECATIONS
-G_GNUC_END_IGNORE_DEPRECATIONS
-#endif
} else
return FALSE;
@@ -598,6 +592,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
* soup_xmlrpc_extract_method_call(), which is more convenient if you
* know in advance what the types of the parameters will be.
*
+ * Deprecated: Use soup_xmlrpc_parse_request_full() instead.
* Return value: success or failure.
**/
gboolean
@@ -629,9 +624,6 @@ soup_xmlrpc_parse_method_call (const char *method_call, int length,
if (strcmp ((const char *)node->name, "params") != 0)
goto fail;
-#ifdef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-#endif
*params = soup_value_array_new ();
param = find_real_node (node->children);
while (param && !strcmp ((const char *)param->name, "param")) {
@@ -646,9 +638,6 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
param = find_real_node (param->next);
}
-#ifdef G_GNUC_END_IGNORE_DEPRECATIONS
-G_GNUC_END_IGNORE_DEPRECATIONS
-#endif
} else
*params = soup_value_array_new ();
@@ -680,6 +669,7 @@ fail:
* See also soup_xmlrpc_parse_method_call(), which can be used if
* you don't know the types of the parameters.
*
+ * Deprecated: Use soup_xmlrpc_parse_request_full() instead.
* Return value: success or failure.
**/
gboolean
@@ -698,13 +688,8 @@ soup_xmlrpc_extract_method_call (const char *method_call, int length,
success = soup_value_array_to_args (params, args);
va_end (args);
-#ifdef G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-#endif
g_value_array_free (params);
-#ifdef G_GNUC_END_IGNORE_DEPRECATIONS
-G_GNUC_END_IGNORE_DEPRECATIONS
-#endif
+
return success;
}
@@ -723,6 +708,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
* soup_xmlrpc_parse_method_response() will return %FALSE, but @error
* will be unset.)
*
+ * Deprecated: Use soup_xmlrpc_parse_response() instead.
* Return value: %TRUE if a return value was parsed, %FALSE if the
* response could not be parsed, or contained a fault.
**/
@@ -809,6 +795,7 @@ fail:
* at all, soup_xmlrpc_extract_method_response() will return %FALSE,
* but @error will be unset.)
*
+ * Deprecated: Use soup_xmlrpc_parse_response() instead.
* Return value: %TRUE if a return value was parsed, %FALSE if the
* response was of the wrong type, or contained a fault.
**/
@@ -896,3 +883,5 @@ find_real_node (xmlNode *node)
node = node->next;
return node;
}
+
+G_GNUC_END_IGNORE_DEPRECATIONS
diff --git a/libsoup/soup-xmlrpc.h b/libsoup/soup-xmlrpc.h
index d25e380..c0bc6c1 100644
--- a/libsoup/soup-xmlrpc.h
+++ b/libsoup/soup-xmlrpc.h
@@ -11,16 +11,20 @@
G_BEGIN_DECLS
/* XML-RPC client */
+SOUP_DEPRECATED_IN_2_52_FOR(soup_xmlrpc_build_request)
char *soup_xmlrpc_build_method_call (const char *method_name,
GValue *params,
int n_params);
+SOUP_DEPRECATED_IN_2_52_FOR(soup_xmlrpc_message_new)
SoupMessage *soup_xmlrpc_request_new (const char *uri,
const char *method_name,
...);
+SOUP_DEPRECATED_IN_2_52_FOR(soup_xmlrpc_parse_response)
gboolean soup_xmlrpc_parse_method_response (const char *method_response,
int length,
GValue *value,
GError **error);
+SOUP_DEPRECATED_IN_2_52_FOR(soup_xmlrpc_parse_response)
gboolean soup_xmlrpc_extract_method_response (const char *method_response,
int length,
GError **error,
@@ -28,21 +32,23 @@ gboolean soup_xmlrpc_extract_method_response (const char *method_response,
...);
/* XML-RPC server */
+SOUP_DEPRECATED_IN_2_52_FOR(soup_xmlrpc_parse_request_full)
gboolean soup_xmlrpc_parse_method_call (const char *method_call,
int length,
char **method_name,
GValueArray **params);
+SOUP_DEPRECATED_IN_2_52_FOR(soup_xmlrpc_parse_request_full)
gboolean soup_xmlrpc_extract_method_call (const char *method_call,
int length,
char **method_name,
...);
+SOUP_DEPRECATED_IN_2_52_FOR(soup_xmlrpc_build_response)
char *soup_xmlrpc_build_method_response (GValue *value);
-char *soup_xmlrpc_build_fault (int fault_code,
- const char *fault_format,
- ...) G_GNUC_PRINTF (2, 3);
+SOUP_DEPRECATED_IN_2_52_FOR(soup_xmlrpc_message_set_response)
void soup_xmlrpc_set_response (SoupMessage *msg,
GType type,
...);
+SOUP_DEPRECATED_IN_2_52_FOR(soup_xmlrpc_message_set_fault)
void soup_xmlrpc_set_fault (SoupMessage *msg,
int fault_code,
const char *fault_format,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]