From f2121d1c0f36ef3951e0570552e70f9450f0fab5 Mon Sep 17 00:00:00 2001 From: John-Mark Bell Date: Sun, 22 Apr 2018 02:59:44 +0000 Subject: NSURL: add ability to create replacement scheme --- utils/nsurl.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'utils/nsurl.h') diff --git a/utils/nsurl.h b/utils/nsurl.h index f97562bf0..054baf26b 100644 --- a/utils/nsurl.h +++ b/utils/nsurl.h @@ -300,6 +300,25 @@ nserror nsurl_replace_query(const nsurl *url, const char *query, nsurl **new_url); +/** + * Create a NetSurf URL object, with scheme replaced + * + * \param url NetSurf URL to create new NetSurf URL from + * \param scheme Scheme to use + * \param new_url Returns new NetSurf URL with scheme provided + * \return NSERROR_OK on success, appropriate error otherwise + * + * If return value != NSERROR_OK, nothing will be returned in new_url. + * + * It is up to the client to call nsurl_unref when they are finished with + * the created object. + * + * Any scheme component in url is replaced with scheme in new_url. + */ +nserror nsurl_replace_scheme(const nsurl *url, lwc_string *scheme, + nsurl **new_url); + + /** * Attempt to find a nice filename for a URL. * -- cgit v1.2.3