summaryrefslogtreecommitdiff
path: root/utils/nsurl.h
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2018-04-22 02:59:44 +0000
committerJohn-Mark Bell <jmb@netsurf-browser.org>2018-04-22 11:39:12 +0000
commitf2121d1c0f36ef3951e0570552e70f9450f0fab5 (patch)
tree58e875790295199f1c6f84070ebd4bb1a0174d6a /utils/nsurl.h
parenta6014cae157107ec868816fcccf8689a5d6cc766 (diff)
downloadnetsurf-f2121d1c0f36ef3951e0570552e70f9450f0fab5.tar.gz
netsurf-f2121d1c0f36ef3951e0570552e70f9450f0fab5.tar.bz2
NSURL: add ability to create replacement scheme
Diffstat (limited to 'utils/nsurl.h')
-rw-r--r--utils/nsurl.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/utils/nsurl.h b/utils/nsurl.h
index f97562bf0..054baf26b 100644
--- a/utils/nsurl.h
+++ b/utils/nsurl.h
@@ -301,6 +301,25 @@ nserror nsurl_replace_query(const nsurl *url, const char *query,
/**
+ * 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.
*
* \param url A NetSurf URL object to create a filename from