From a112bfb6769fd393b0903f9262a8e1913407eda8 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Fri, 28 Oct 2011 19:18:14 +0000 Subject: Function for adding fragment onto nsurl. svn path=/trunk/netsurf/; revision=13087 --- utils/nsurl.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'utils/nsurl.h') diff --git a/utils/nsurl.h b/utils/nsurl.h index c708e0483..46496f212 100644 --- a/utils/nsurl.h +++ b/utils/nsurl.h @@ -212,7 +212,7 @@ nserror nsurl_join(const nsurl *base, const char *rel, nsurl **joined); /** * Create a NetSurf URL object without a fragment from a NetSurf URL * - * \param base NetSurf URL to create new NetSurf URL from + * \param url NetSurf URL to create new NetSurf URL from * \param no_frag Returns new NetSurf URL without fragment * \return NSERROR_OK on success, appropriate error otherwise * @@ -223,4 +223,22 @@ nserror nsurl_join(const nsurl *base, const char *rel, nsurl **joined); */ nserror nsurl_defragment(const nsurl *url, nsurl **no_frag); + +/** + * Create a NetSurf URL object, adding a fragment to an existing URL object + * + * \param url NetSurf URL to create new NetSurf URL from + * \param frag Fragment to add + * \param new_url Returns new NetSurf URL without fragment + * \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_destroy when they are finished with + * the created object. + * + * Any fragment in url is replaced with frag in new_url. + */ +nserror nsurl_refragment(const nsurl *url, lwc_string *frag, nsurl **new_url); + #endif -- cgit v1.2.3