[libsoup] Rename SoupKnownStatusCode to SoupStatus



commit 7f9c7c8731821149ff42971fad18e2a9abbb4c10
Author: Dan Winship <danw gnome org>
Date:   Sat Jul 13 11:06:29 2013 -0400

    Rename SoupKnownStatusCode to SoupStatus
    
    Rename SoupKnownStatusCode to SoupStatus (so that the type name
    matches the enum values), and then, for backward-compatibility, add a
    new SoupKnownStatusCode enum with equivalent values so that
    introspection-using code that was doing "SoupKnownStatusCode.OK", etc,
    will still work.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684409

 docs/reference/libsoup-2.4-sections.txt |    3 +-
 libsoup/libsoup-2.4.sym                 |    1 +
 libsoup/soup-message.c                  |    2 +-
 libsoup/soup-proxy-uri-resolver.c       |    2 +-
 libsoup/soup-status.c                   |   15 ++++--
 libsoup/soup-status.h                   |   80 ++++++++++++++++++++++++++++++-
 6 files changed, 95 insertions(+), 8 deletions(-)
---
diff --git a/docs/reference/libsoup-2.4-sections.txt b/docs/reference/libsoup-2.4-sections.txt
index 4b6ebfd..2fb9134 100644
--- a/docs/reference/libsoup-2.4-sections.txt
+++ b/docs/reference/libsoup-2.4-sections.txt
@@ -199,13 +199,14 @@ SOUP_STATUS_IS_SUCCESSFUL
 SOUP_STATUS_IS_REDIRECTION
 SOUP_STATUS_IS_CLIENT_ERROR
 SOUP_STATUS_IS_SERVER_ERROR
-SoupKnownStatusCode
+SoupStatus
 soup_status_get_phrase
 soup_status_proxify
 <SUBSECTION>
 SOUP_HTTP_ERROR
 <SUBSECTION Private>
 soup_http_error_quark
+SoupKnownStatusCode
 </SECTION>
 
 <SECTION>
diff --git a/libsoup/libsoup-2.4.sym b/libsoup/libsoup-2.4.sym
index d0f22f6..be4cd7f 100644
--- a/libsoup/libsoup-2.4.sym
+++ b/libsoup/libsoup-2.4.sym
@@ -416,6 +416,7 @@ soup_socket_start_ssl
 soup_socket_write
 soup_ssl_supported
 soup_status_get_phrase
+soup_status_get_type
 soup_status_proxify
 soup_str_case_equal
 soup_str_case_hash
diff --git a/libsoup/soup-message.c b/libsoup/soup-message.c
index d18eab1..7613043 100644
--- a/libsoup/soup-message.c
+++ b/libsoup/soup-message.c
@@ -52,7 +52,7 @@
  *
  * Represents an HTTP message being sent or received.
  *
- * @status_code will normally be a #SoupKnownStatusCode, eg,
+ * @status_code will normally be a #SoupStatus value, eg,
  * %SOUP_STATUS_OK, though of course it might actually be an unknown
  * status code. @reason_phrase is the actual text returned from the
  * server, which may or may not correspond to the "standard"
diff --git a/libsoup/soup-proxy-uri-resolver.c b/libsoup/soup-proxy-uri-resolver.c
index 65f65d4..ca49b90 100644
--- a/libsoup/soup-proxy-uri-resolver.c
+++ b/libsoup/soup-proxy-uri-resolver.c
@@ -34,7 +34,7 @@ soup_proxy_uri_resolver_default_init (SoupProxyURIResolverInterface *iface)
 /**
  * SoupProxyURIResolverCallback:
  * @resolver: the #SoupProxyURIResolver
- * @status: a #SoupKnownStatusCode
+ * @status: a #SoupStatus
  * @proxy_uri: the resolved proxy URI, or %NULL
  * @user_data: data passed to soup_proxy_uri_resolver_get_proxy_uri_async()
  *
diff --git a/libsoup/soup-status.c b/libsoup/soup-status.c
index 7b048a8..6dbb9ed 100644
--- a/libsoup/soup-status.c
+++ b/libsoup/soup-status.c
@@ -68,7 +68,7 @@
  **/
 
 /**
- * SoupKnownStatusCode:
+ * SoupStatus:
  * @SOUP_STATUS_NONE: No status available. (Eg, the message has not
  * been sent yet)
  * @SOUP_STATUS_CANCELLED: Message was cancelled locally
@@ -150,14 +150,21 @@
  * 
  * These represent the known HTTP status code values, plus various
  * network and internal errors.
+ *
+ * Note that no libsoup functions take or return this type directly;
+ * any function that works with status codes will accept unrecognized
+ * status codes as well.
+ *
+ * Prior to 2.44 this type was called
+ * <literal>SoupKnownStatusCode</literal>, but the individual values
+ * have always had the names they have now.
  **/
 
 /**
  * SOUP_HTTP_ERROR:
  *
- * A #GError domain representing an HTTP status. Use a
- * #SoupKnownStatusCode for the <structfield>code</structfield>
- * value.
+ * A #GError domain representing an HTTP status. Use a #SoupStatus for
+ * the <structfield>code</structfield> value.
  **/
 
 
diff --git a/libsoup/soup-status.h b/libsoup/soup-status.h
index 669c122..fb4147c 100644
--- a/libsoup/soup-status.h
+++ b/libsoup/soup-status.h
@@ -91,7 +91,7 @@ typedef enum {
        SOUP_STATUS_HTTP_VERSION_NOT_SUPPORTED      = 505,
        SOUP_STATUS_INSUFFICIENT_STORAGE            = 507, /* WebDAV search */
        SOUP_STATUS_NOT_EXTENDED                    = 510  /* RFC 2774 */
-} SoupKnownStatusCode;
+} SoupStatus;
 
 const char *soup_status_get_phrase (guint status_code);
 SOUP_AVAILABLE_IN_2_26
@@ -100,6 +100,84 @@ guint       soup_status_proxify    (guint status_code);
 #define SOUP_HTTP_ERROR soup_http_error_quark()
 GQuark soup_http_error_quark (void);
 
+#ifndef SOUP_DISABLE_DEPRECATED
+/* For introspection purposes, we create a duplicate enum type under
+ * the deprecated type name, since some (all?) bindings don't handle
+ * enum type typedefs the way we want.
+ */
+typedef enum {
+       SOUP_KNOWN_STATUS_CODE_NONE,
+
+       SOUP_KNOWN_STATUS_CODE_CANCELLED                       = 1,
+       SOUP_KNOWN_STATUS_CODE_CANT_RESOLVE,
+       SOUP_KNOWN_STATUS_CODE_CANT_RESOLVE_PROXY,
+       SOUP_KNOWN_STATUS_CODE_CANT_CONNECT,
+       SOUP_KNOWN_STATUS_CODE_CANT_CONNECT_PROXY,
+       SOUP_KNOWN_STATUS_CODE_SSL_FAILED,
+       SOUP_KNOWN_STATUS_CODE_IO_ERROR,
+       SOUP_KNOWN_STATUS_CODE_MALFORMED,
+       SOUP_KNOWN_STATUS_CODE_TRY_AGAIN,
+       SOUP_KNOWN_STATUS_CODE_TOO_MANY_REDIRECTS,
+       SOUP_KNOWN_STATUS_CODE_TLS_FAILED,
+
+       SOUP_KNOWN_STATUS_CODE_CONTINUE                        = 100,
+       SOUP_KNOWN_STATUS_CODE_SWITCHING_PROTOCOLS             = 101,
+       SOUP_KNOWN_STATUS_CODE_PROCESSING                      = 102,
+
+       SOUP_KNOWN_STATUS_CODE_OK                              = 200,
+       SOUP_KNOWN_STATUS_CODE_CREATED                         = 201,
+       SOUP_KNOWN_STATUS_CODE_ACCEPTED                        = 202,
+       SOUP_KNOWN_STATUS_CODE_NON_AUTHORITATIVE               = 203,
+       SOUP_KNOWN_STATUS_CODE_NO_CONTENT                      = 204,
+       SOUP_KNOWN_STATUS_CODE_RESET_CONTENT                   = 205,
+       SOUP_KNOWN_STATUS_CODE_PARTIAL_CONTENT                 = 206,
+       SOUP_KNOWN_STATUS_CODE_MULTI_STATUS                    = 207,
+
+       SOUP_KNOWN_STATUS_CODE_MULTIPLE_CHOICES                = 300,
+       SOUP_KNOWN_STATUS_CODE_MOVED_PERMANENTLY               = 301,
+       SOUP_KNOWN_STATUS_CODE_FOUND                           = 302,
+       SOUP_KNOWN_STATUS_CODE_MOVED_TEMPORARILY               = 302,
+       SOUP_KNOWN_STATUS_CODE_SEE_OTHER                       = 303,
+       SOUP_KNOWN_STATUS_CODE_NOT_MODIFIED                    = 304,
+       SOUP_KNOWN_STATUS_CODE_USE_PROXY                       = 305,
+       SOUP_KNOWN_STATUS_CODE_NOT_APPEARING_IN_THIS_PROTOCOL  = 306,
+       SOUP_KNOWN_STATUS_CODE_TEMPORARY_REDIRECT              = 307,
+
+       SOUP_KNOWN_STATUS_CODE_BAD_REQUEST                     = 400,
+       SOUP_KNOWN_STATUS_CODE_UNAUTHORIZED                    = 401,
+       SOUP_KNOWN_STATUS_CODE_PAYMENT_REQUIRED                = 402,
+       SOUP_KNOWN_STATUS_CODE_FORBIDDEN                       = 403,
+       SOUP_KNOWN_STATUS_CODE_NOT_FOUND                       = 404,
+       SOUP_KNOWN_STATUS_CODE_METHOD_NOT_ALLOWED              = 405,
+       SOUP_KNOWN_STATUS_CODE_NOT_ACCEPTABLE                  = 406,
+       SOUP_KNOWN_STATUS_CODE_PROXY_AUTHENTICATION_REQUIRED   = 407,
+       SOUP_KNOWN_STATUS_CODE_PROXY_UNAUTHORIZED              = 
SOUP_KNOWN_STATUS_CODE_PROXY_AUTHENTICATION_REQUIRED,
+       SOUP_KNOWN_STATUS_CODE_REQUEST_TIMEOUT                 = 408,
+       SOUP_KNOWN_STATUS_CODE_CONFLICT                        = 409,
+       SOUP_KNOWN_STATUS_CODE_GONE                            = 410,
+       SOUP_KNOWN_STATUS_CODE_LENGTH_REQUIRED                 = 411,
+       SOUP_KNOWN_STATUS_CODE_PRECONDITION_FAILED             = 412,
+       SOUP_KNOWN_STATUS_CODE_REQUEST_ENTITY_TOO_LARGE        = 413,
+       SOUP_KNOWN_STATUS_CODE_REQUEST_URI_TOO_LONG            = 414,
+       SOUP_KNOWN_STATUS_CODE_UNSUPPORTED_MEDIA_TYPE          = 415,
+       SOUP_KNOWN_STATUS_CODE_REQUESTED_RANGE_NOT_SATISFIABLE = 416,
+       SOUP_KNOWN_STATUS_CODE_INVALID_RANGE                   = 
SOUP_KNOWN_STATUS_CODE_REQUESTED_RANGE_NOT_SATISFIABLE,
+       SOUP_KNOWN_STATUS_CODE_EXPECTATION_FAILED              = 417,
+       SOUP_KNOWN_STATUS_CODE_UNPROCESSABLE_ENTITY            = 422,
+       SOUP_KNOWN_STATUS_CODE_LOCKED                          = 423,
+       SOUP_KNOWN_STATUS_CODE_FAILED_DEPENDENCY               = 424,
+
+       SOUP_KNOWN_STATUS_CODE_INTERNAL_SERVER_ERROR           = 500,
+       SOUP_KNOWN_STATUS_CODE_NOT_IMPLEMENTED                 = 501,
+       SOUP_KNOWN_STATUS_CODE_BAD_GATEWAY                     = 502,
+       SOUP_KNOWN_STATUS_CODE_SERVICE_UNAVAILABLE             = 503,
+       SOUP_KNOWN_STATUS_CODE_GATEWAY_TIMEOUT                 = 504,
+       SOUP_KNOWN_STATUS_CODE_HTTP_VERSION_NOT_SUPPORTED      = 505,
+       SOUP_KNOWN_STATUS_CODE_INSUFFICIENT_STORAGE            = 507,
+       SOUP_KNOWN_STATUS_CODE_NOT_EXTENDED                    = 510
+} SoupKnownStatusCode;
+#endif
+
 G_END_DECLS
 
 #endif /* SOUP_STATUS_H */


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