summaryrefslogtreecommitdiff
path: root/utils/nsurl.h
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2012-10-06 14:06:38 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2012-10-06 14:06:38 +0100
commit40343b740d1b6d28ccf2083d22f3569606aedf62 (patch)
treef552745ae862733f29c364ca7f6379d34e997a7f /utils/nsurl.h
parent192b2285f5ef6b6d8e2bf60dcf6214193ca526b1 (diff)
downloadnetsurf-40343b740d1b6d28ccf2083d22f3569606aedf62.tar.gz
netsurf-40343b740d1b6d28ccf2083d22f3569606aedf62.tar.bz2
Add nusrl_parent function, to get parent path URL.
Diffstat (limited to 'utils/nsurl.h')
-rw-r--r--utils/nsurl.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/utils/nsurl.h b/utils/nsurl.h
index 96e7a76f8..3b140e7ac 100644
--- a/utils/nsurl.h
+++ b/utils/nsurl.h
@@ -241,4 +241,21 @@ nserror nsurl_defragment(const nsurl *url, nsurl **no_frag);
*/
nserror nsurl_refragment(const nsurl *url, lwc_string *frag, nsurl **new_url);
+
+/**
+ * Create a NetSurf URL object for URL with parent location of an existing URL.
+ *
+ * \param url NetSurf URL to create new NetSurf URL from
+ * \param new_url Returns new NetSurf URL with parent URL path
+ * \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.
+ *
+ * As well as stripping top most path segment, query and fragments are stripped.
+ */
+nserror nsurl_parent(const nsurl *url, nsurl **new_url);
+
#endif