[libsoup/wip/remove-deprecations: 27/49] Make more APIs private
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/wip/remove-deprecations: 27/49] Make more APIs private
- Date: Tue, 30 Jun 2020 21:56:34 +0000 (UTC)
commit 1e4ad68a697f5e875c857ee6717e8fd01fcc08f6
Author: Patrick Griffis <pgriffis igalia com>
Date: Tue Mar 10 18:21:08 2020 -0700
Make more APIs private
libsoup/Soup-2.4.metadata | 1 -
libsoup/auth/soup-auth-negotiate.c | 2 +-
libsoup/content-sniffer/soup-brotli-decompressor.h | 4 --
libsoup/cookies/soup-cookie-jar.c | 2 +-
libsoup/cookies/soup-cookie.c | 2 +-
libsoup/include/soup-installed.h | 1 -
libsoup/meson.build | 22 +++++---
libsoup/soup-address.c | 2 +-
libsoup/soup-connection.c | 2 +-
libsoup/soup-connection.h | 8 +++
libsoup/soup-logger.c | 1 +
libsoup/soup-message-client-io.c | 1 +
libsoup/soup-message-headers.c | 2 +-
libsoup/soup-message-io.c | 2 +-
libsoup/soup-message-private.h | 3 ++
libsoup/soup-message-server-io.c | 2 +-
libsoup/soup-message.c | 14 +++++
libsoup/soup-misc-private.h | 51 -------------------
libsoup/soup-misc.c | 3 --
libsoup/soup-misc.h | 59 ++++++++++++++--------
libsoup/soup-request-data.c | 2 +-
libsoup/soup-server.c | 2 +-
libsoup/soup-session-async.c | 2 +-
libsoup/soup-session.c | 2 +-
libsoup/soup-uri.c | 2 +-
libsoup/soup.h | 1 -
tests/connection-test.c | 2 +
tests/meson.build | 4 +-
tests/misc-test.c | 1 +
29 files changed, 99 insertions(+), 103 deletions(-)
---
diff --git a/libsoup/Soup-2.4.metadata b/libsoup/Soup-2.4.metadata
index 0c247f32..9a45ca2e 100644
--- a/libsoup/Soup-2.4.metadata
+++ b/libsoup/Soup-2.4.metadata
@@ -11,7 +11,6 @@ XMLRPCError parent="Soup.XMLRPC" name="Error"
HTTPVersion.http_* name="http_(.+)"
// Report upstream
-add_* skip=false type="unowned GLib.TimeoutSource"
Auth
// Factory method
.new symbol_type="function"
diff --git a/libsoup/auth/soup-auth-negotiate.c b/libsoup/auth/soup-auth-negotiate.c
index 1fdf142d..1ceac3b0 100644
--- a/libsoup/auth/soup-auth-negotiate.c
+++ b/libsoup/auth/soup-auth-negotiate.c
@@ -20,7 +20,7 @@
#include "soup-headers.h"
#include "soup-message.h"
#include "soup-message-private.h"
-#include "soup-misc-private.h"
+#include "soup-misc.h"
#include "soup-uri.h"
/**
diff --git a/libsoup/content-sniffer/soup-brotli-decompressor.h
b/libsoup/content-sniffer/soup-brotli-decompressor.h
index 7dade46c..5c99155f 100644
--- a/libsoup/content-sniffer/soup-brotli-decompressor.h
+++ b/libsoup/content-sniffer/soup-brotli-decompressor.h
@@ -29,10 +29,6 @@ G_BEGIN_DECLS
SOUP_AVAILABLE_IN_2_68
G_DECLARE_FINAL_TYPE (SoupBrotliDecompressor, soup_brotli_decompressor, SOUP, BROTLI_DECOMPRESSOR, GObject)
-SOUP_AVAILABLE_IN_2_68
SoupBrotliDecompressor *soup_brotli_decompressor_new (void);
-SOUP_AVAILABLE_IN_2_68
-GType soup_brotli_decompressor_get_type (void) G_GNUC_CONST;
-
G_END_DECLS
diff --git a/libsoup/cookies/soup-cookie-jar.c b/libsoup/cookies/soup-cookie-jar.c
index 45878f30..c610c598 100644
--- a/libsoup/cookies/soup-cookie-jar.c
+++ b/libsoup/cookies/soup-cookie-jar.c
@@ -13,7 +13,7 @@
#include "soup-cookie-jar.h"
#include "soup-message-private.h"
-#include "soup-misc-private.h"
+#include "soup-misc.h"
#include "soup.h"
/**
diff --git a/libsoup/cookies/soup-cookie.c b/libsoup/cookies/soup-cookie.c
index cf538831..5fa4c251 100644
--- a/libsoup/cookies/soup-cookie.c
+++ b/libsoup/cookies/soup-cookie.c
@@ -13,7 +13,7 @@
#include <string.h>
#include "soup-cookie.h"
-#include "soup-misc-private.h"
+#include "soup-misc.h"
#include "soup.h"
/**
diff --git a/libsoup/include/soup-installed.h b/libsoup/include/soup-installed.h
index b908c389..56fa31fe 100644
--- a/libsoup/include/soup-installed.h
+++ b/libsoup/include/soup-installed.h
@@ -35,7 +35,6 @@ extern "C" {
#include <libsoup/soup-logger.h>
#include <libsoup/soup-message.h>
#include <libsoup/soup-method.h>
-#include <libsoup/soup-misc.h>
#include <libsoup/soup-multipart.h>
#include <libsoup/soup-multipart-input-stream.h>
#include <libsoup/soup-request.h>
diff --git a/libsoup/meson.build b/libsoup/meson.build
index 754b60dd..1f8a4622 100644
--- a/libsoup/meson.build
+++ b/libsoup/meson.build
@@ -90,7 +90,7 @@ soup_sources = [
'soup-version.c',
]
-soup_headers = [
+soup_installed_headers = [
'auth/soup-auth-basic.h',
'auth/soup-auth-digest.h',
'auth/soup-auth-ntlm.h',
@@ -123,6 +123,10 @@ soup_headers = [
'soup-socket-private.h',
]
+soup_private_enum_headers = [
+ 'soup-connection.h',
+]
+
soup_introspection_headers = [
'auth/soup-auth.h',
'auth/soup-auth-domain.h',
@@ -166,7 +170,6 @@ soup_introspection_headers = [
'soup-message-body.h',
'soup-message-headers.h',
'soup-method.h',
- 'soup-misc.h',
'soup-multipart.h',
'soup-multipart-input-stream.h',
'soup-request.h',
@@ -189,7 +192,6 @@ soup_installed_headers = soup_introspection_headers
if brotlidec_dep.found()
soup_sources += 'content-sniffer/soup-brotli-decompressor.c'
- soup_headers += 'content-sniffer/soup-brotli-decompressor.h'
endif
@@ -217,6 +219,10 @@ soup_enums = gnome.mkenums('soup-enum-types',
soup_enum_h = soup_enums[1]
soup_enum_c = soup_enums[0]
+soup_private_enums = gnome.mkenums_simple('soup-private-enum-types',
+ sources : soup_private_enum_headers,
+)
+
libsoup_c_args = [
'-DG_LOG_DOMAIN="@0@"'.format(meson.project_name()),
'-DLIBSOUP_COMPILATION'
@@ -244,9 +250,11 @@ libsoup_includes = [
]
libsoup = library('soup-@0@'.format(apiversion),
- soup_sources,
- soup_headers,
- soup_enums,
+ sources : [
+ soup_sources,
+ soup_private_enums,
+ soup_enums,
+ ],
version : libversion,
soversion : soversion,
darwin_versions: darwin_versions,
@@ -259,7 +267,7 @@ libsoup = library('soup-@0@'.format(apiversion),
libsoup_static = static_library('soup-static',
sources : [
soup_sources,
- soup_headers,
+ soup_private_enums,
soup_enums,
],
c_args : libsoup_c_args,
diff --git a/libsoup/soup-address.c b/libsoup/soup-address.c
index 5d66710f..2157ed06 100644
--- a/libsoup/soup-address.c
+++ b/libsoup/soup-address.c
@@ -15,7 +15,7 @@
#include "soup-address.h"
#include "soup.h"
-#include "soup-misc-private.h"
+#include "soup-misc.h"
/**
* SECTION:soup-address
diff --git a/libsoup/soup-connection.c b/libsoup/soup-connection.c
index 1b9a4fee..d4af0e9e 100644
--- a/libsoup/soup-connection.c
+++ b/libsoup/soup-connection.c
@@ -13,7 +13,7 @@
#include "soup.h"
#include "soup-message-queue.h"
#include "soup-socket-private.h"
-#include "soup-misc-private.h"
+#include "soup-private-enum-types.h"
typedef struct {
SoupSocket *socket;
diff --git a/libsoup/soup-connection.h b/libsoup/soup-connection.h
index 45e80b2c..f1a8f376 100644
--- a/libsoup/soup-connection.h
+++ b/libsoup/soup-connection.h
@@ -34,6 +34,14 @@ typedef struct {
GType soup_connection_get_type (void);
+typedef enum {
+ SOUP_CONNECTION_NEW,
+ SOUP_CONNECTION_CONNECTING,
+ SOUP_CONNECTION_IDLE,
+ SOUP_CONNECTION_IN_USE,
+ SOUP_CONNECTION_REMOTE_DISCONNECTED,
+ SOUP_CONNECTION_DISCONNECTED
+} SoupConnectionState;
#define SOUP_CONNECTION_REMOTE_URI "remote-uri"
#define SOUP_CONNECTION_SOCKET_PROPERTIES "socket-properties"
diff --git a/libsoup/soup-logger.c b/libsoup/soup-logger.c
index 59ee0e4e..2ba6ce52 100644
--- a/libsoup/soup-logger.c
+++ b/libsoup/soup-logger.c
@@ -17,6 +17,7 @@
#include "soup-logger.h"
#include "soup-connection.h"
#include "soup-message-private.h"
+#include "soup-misc.h"
#include "soup.h"
/**
diff --git a/libsoup/soup-message-client-io.c b/libsoup/soup-message-client-io.c
index 8fead4b0..1a60360f 100644
--- a/libsoup/soup-message-client-io.c
+++ b/libsoup/soup-message-client-io.c
@@ -16,6 +16,7 @@
#include "soup.h"
#include "soup-connection.h"
#include "soup-message-queue.h"
+#include "soup-misc.h"
#include "soup-socket-private.h"
static guint
diff --git a/libsoup/soup-message-headers.c b/libsoup/soup-message-headers.c
index e70909b2..166e7be3 100644
--- a/libsoup/soup-message-headers.c
+++ b/libsoup/soup-message-headers.c
@@ -13,7 +13,7 @@
#include "soup-message-headers.h"
#include "soup.h"
-#include "soup-misc-private.h"
+#include "soup-misc.h"
/**
* SECTION:soup-message-headers
diff --git a/libsoup/soup-message-io.c b/libsoup/soup-message-io.c
index fca76a43..c8655186 100644
--- a/libsoup/soup-message-io.c
+++ b/libsoup/soup-message-io.c
@@ -21,7 +21,7 @@
#include "soup-filter-input-stream.h"
#include "soup-message-private.h"
#include "soup-message-queue.h"
-#include "soup-misc-private.h"
+#include "soup-misc.h"
typedef enum {
SOUP_MESSAGE_IO_CLIENT,
diff --git a/libsoup/soup-message-private.h b/libsoup/soup-message-private.h
index a6d602fb..ddc99ab4 100644
--- a/libsoup/soup-message-private.h
+++ b/libsoup/soup-message-private.h
@@ -173,4 +173,7 @@ void soup_message_set_content_sniffer (SoupMessage *msg
void soup_message_set_bytes_for_sniffing (SoupMessage *msg,
gsize bytes);
+const char *soup_http_version_to_string (SoupHTTPVersion version);
+
+
#endif /* __SOUP_MESSAGE_PRIVATE_H__ */
diff --git a/libsoup/soup-message-server-io.c b/libsoup/soup-message-server-io.c
index 71e943b6..2e30b227 100644
--- a/libsoup/soup-message-server-io.c
+++ b/libsoup/soup-message-server-io.c
@@ -16,7 +16,7 @@
#include "soup.h"
#include "soup-message-private.h"
-#include "soup-misc-private.h"
+#include "soup-misc.h"
#include "soup-socket-private.h"
static SoupURI *
diff --git a/libsoup/soup-message.c b/libsoup/soup-message.c
index fee53d29..04487cde 100644
--- a/libsoup/soup-message.c
+++ b/libsoup/soup-message.c
@@ -2248,3 +2248,17 @@ soup_message_set_bytes_for_sniffing (SoupMessage *msg, gsize bytes)
priv->bytes_for_sniffing = bytes;
}
+
+const char *
+soup_http_version_to_string (SoupHTTPVersion version)
+{
+ switch (version) {
+ case SOUP_HTTP_1_0:
+ return "HTTP/1.0";
+ case SOUP_HTTP_1_1:
+ return "HTTP/1.1";
+ }
+
+ g_assert_not_reached ();
+ return "";
+}
diff --git a/libsoup/soup-misc.c b/libsoup/soup-misc.c
index 2cf6b0f6..a0df9c56 100644
--- a/libsoup/soup-misc.c
+++ b/libsoup/soup-misc.c
@@ -12,7 +12,6 @@
#include <string.h>
#include "soup-misc.h"
-#include "soup-misc-private.h"
/**
* SECTION:soup-misc
@@ -20,8 +19,6 @@
*
**/
-const gboolean soup_ssl_supported = TRUE;
-
/**
* soup_str_case_hash:
* @key: ASCII string to hash
diff --git a/libsoup/soup-misc.h b/libsoup/soup-misc.h
index f2729a1e..ab5dff0c 100644
--- a/libsoup/soup-misc.h
+++ b/libsoup/soup-misc.h
@@ -7,25 +7,23 @@
#define __SOUP_MISC_H__ 1
#include "soup-types.h"
+#include "soup-message.h"
+#include "soup-message-headers.h"
G_BEGIN_DECLS
/* Non-default-GMainContext operations */
-SOUP_AVAILABLE_IN_2_4
GSource *soup_add_io_watch (GMainContext *async_context,
GIOChannel *chan,
GIOCondition condition,
GIOFunc function,
gpointer data);
-SOUP_AVAILABLE_IN_2_4
GSource *soup_add_idle (GMainContext *async_context,
GSourceFunc function,
gpointer data);
-SOUP_AVAILABLE_IN_2_24
GSource *soup_add_completion (GMainContext *async_context,
GSourceFunc function,
gpointer data);
-SOUP_AVAILABLE_IN_2_4
GSource *soup_add_timeout (GMainContext *async_context,
guint interval,
GSourceFunc function,
@@ -33,16 +31,13 @@ GSource *soup_add_timeout (GMainContext *async_context,
/* Misc utils */
-SOUP_AVAILABLE_IN_2_4
guint soup_str_case_hash (gconstpointer key);
-SOUP_AVAILABLE_IN_2_4
gboolean soup_str_case_equal (gconstpointer v1,
gconstpointer v2);
/* character classes */
-SOUP_AVAILABLE_IN_2_4
-const char soup_char_attributes[];
+extern const char soup_char_attributes[];
#define SOUP_CHAR_URI_PERCENT_ENCODED 0x01
#define SOUP_CHAR_URI_GEN_DELIMS 0x02
#define SOUP_CHAR_URI_SUB_DELIMS 0x04
@@ -55,20 +50,44 @@ const char soup_char_attributes[];
#define soup_char_is_uri_unreserved(ch) (!(soup_char_attributes[(guchar)ch] &
(SOUP_CHAR_URI_PERCENT_ENCODED | SOUP_CHAR_URI_GEN_DELIMS | SOUP_CHAR_URI_SUB_DELIMS)))
#define soup_char_is_token(ch) (!(soup_char_attributes[(guchar)ch] & (SOUP_CHAR_HTTP_SEPARATOR
| SOUP_CHAR_HTTP_CTL)))
-/* SSL stuff */
-SOUP_AVAILABLE_IN_2_4
-const gboolean soup_ssl_supported;
+char *soup_uri_decoded_copy (const char *str, int length, int *decoded_length);
+char *soup_uri_to_string_internal (SoupURI *uri, gboolean just_path_and_query,
+ gboolean include_password, gboolean force_port);
+gboolean soup_uri_is_http (SoupURI *uri, char **aliases);
+gboolean soup_uri_is_https (SoupURI *uri, char **aliases);
-/* Part of a debugging API */
+/* At some point it might be possible to mark additional methods
+ * safe or idempotent...
+ */
+#define SOUP_METHOD_IS_SAFE(method) (method == SOUP_METHOD_GET || \
+ method == SOUP_METHOD_HEAD || \
+ method == SOUP_METHOD_OPTIONS || \
+ method == SOUP_METHOD_PROPFIND || \
+ method == SOUP_METHOD_TRACE)
+
+#define SOUP_METHOD_IS_IDEMPOTENT(method) (method == SOUP_METHOD_GET || \
+ method == SOUP_METHOD_HEAD || \
+ method == SOUP_METHOD_OPTIONS || \
+ method == SOUP_METHOD_PROPFIND || \
+ method == SOUP_METHOD_TRACE || \
+ method == SOUP_METHOD_PUT || \
+ method == SOUP_METHOD_DELETE)
+
+GSource *soup_add_completion_reffed (GMainContext *async_context,
+ GSourceFunc function,
+ gpointer data,
+ GDestroyNotify dnotify);
+
+guint soup_message_headers_get_ranges_internal (SoupMessageHeaders *hdrs,
+ goffset total_length,
+ gboolean check_satisfiable,
+ SoupRange **ranges,
+ int *length);
+
+SoupAddress *soup_address_new_from_gsockaddr (GSocketAddress *addr);
-typedef enum {
- SOUP_CONNECTION_NEW,
- SOUP_CONNECTION_CONNECTING,
- SOUP_CONNECTION_IDLE,
- SOUP_CONNECTION_IN_USE,
- SOUP_CONNECTION_REMOTE_DISCONNECTED,
- SOUP_CONNECTION_DISCONNECTED
-} SoupConnectionState;
+gboolean soup_host_matches_host (const gchar *host,
+ const gchar *compare_with);
G_END_DECLS
diff --git a/libsoup/soup-request-data.c b/libsoup/soup-request-data.c
index 3e075073..7bdffd89 100644
--- a/libsoup/soup-request-data.c
+++ b/libsoup/soup-request-data.c
@@ -29,7 +29,7 @@
#include "soup-request-data.h"
#include "soup.h"
-#include "soup-misc-private.h"
+#include "soup-misc.h"
/**
* SECTION:soup-request-data
diff --git a/libsoup/soup-server.c b/libsoup/soup-server.c
index e25a9872..89bd01de 100644
--- a/libsoup/soup-server.c
+++ b/libsoup/soup-server.c
@@ -16,7 +16,7 @@
#include "soup-server.h"
#include "soup.h"
#include "soup-message-private.h"
-#include "soup-misc-private.h"
+#include "soup-misc.h"
#include "soup-path-map.h"
#include "soup-socket-private.h"
#include "websocket/soup-websocket.h"
diff --git a/libsoup/soup-session-async.c b/libsoup/soup-session-async.c
index c1879890..3d67f66a 100644
--- a/libsoup/soup-session-async.c
+++ b/libsoup/soup-session-async.c
@@ -14,7 +14,7 @@
#include "soup-session-private.h"
#include "soup-message-private.h"
#include "soup-message-queue.h"
-#include "soup-misc-private.h"
+#include "soup-misc.h"
/**
* SECTION:soup-session-async
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index 7fd992c9..9c8f629c 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -17,7 +17,7 @@
#include "cache/soup-cache-private.h"
#include "soup-connection.h"
#include "soup-message-private.h"
-#include "soup-misc-private.h"
+#include "soup-misc.h"
#include "soup-message-queue.h"
#include "soup-session-private.h"
#include "soup-socket-private.h"
diff --git a/libsoup/soup-uri.c b/libsoup/soup-uri.c
index c01b3e3b..02ed0d06 100644
--- a/libsoup/soup-uri.c
+++ b/libsoup/soup-uri.c
@@ -14,7 +14,7 @@
#include "soup-uri.h"
#include "soup.h"
-#include "soup-misc-private.h"
+#include "soup-misc.h"
/**
* SECTION:soup-uri
diff --git a/libsoup/soup.h b/libsoup/soup.h
index 266a3f05..c0131d9f 100644
--- a/libsoup/soup.h
+++ b/libsoup/soup.h
@@ -35,7 +35,6 @@ extern "C" {
#include "soup-logger.h"
#include "soup-message.h"
#include "soup-method.h"
-#include "soup-misc.h"
#include "soup-multipart.h"
#include "soup-multipart-input-stream.h"
#include "soup-request.h"
diff --git a/tests/connection-test.c b/tests/connection-test.c
index 0bd19e2f..9b451176 100644
--- a/tests/connection-test.c
+++ b/tests/connection-test.c
@@ -5,6 +5,8 @@
#include "test-utils.h"
+#include "soup-connection.h"
+
#include <gio/gnetworking.h>
SoupServer *server;
diff --git a/tests/meson.build b/tests/meson.build
index 0ce2ba80..dd227876 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -7,10 +7,10 @@ abs_installed_tests_execdir = join_paths(prefix, installed_tests_execdir)
if cc.get_id() == 'msvc'
test_utils = static_library(test_utils_name, test_utils_name + '.c',
- dependencies : libsoup_dep)
+ dependencies : libsoup_static_dep)
else
test_utils = library(test_utils_name, test_utils_name + '.c',
- dependencies : libsoup_dep,
+ dependencies : libsoup_static_dep,
install : installed_tests_enabled,
install_dir : installed_tests_execdir,
)
diff --git a/tests/misc-test.c b/tests/misc-test.c
index 8cbda80a..9e7eef2e 100644
--- a/tests/misc-test.c
+++ b/tests/misc-test.c
@@ -4,6 +4,7 @@
*/
#include "test-utils.h"
+#include "soup-connection.h"
SoupServer *server, *ssl_server;
SoupURI *base_uri, *ssl_base_uri;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]