From 13832a453a6a4433b4dc62fb0092810671e8751e Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 30 Oct 2014 22:26:03 +0000 Subject: Add a nsurl_nice, which can replace url_nice. --- utils/nsurl.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'utils/nsurl.h') diff --git a/utils/nsurl.h b/utils/nsurl.h index 435df73bd..ec00dede9 100644 --- a/utils/nsurl.h +++ b/utils/nsurl.h @@ -284,6 +284,19 @@ nserror nsurl_replace_query(const nsurl *url, const char *query, nsurl **new_url); +/** + * Attempt to find a nice filename for a URL. + * + * \param url A NetSurf URL object to create a filename from + * \param result Updated to caller-owned string with filename + * \param remove_extensions remove any extensions from the filename + * \return NSERROR_OK on success, appropriate error otherwise + * + * Caller must ensure string result string is freed, if NSERROR_OK returned. + */ +nserror nsurl_nice(const nsurl *url, char **result, bool remove_extensions); + + /** * Create a NetSurf URL object for URL with parent location of an existing URL. * -- cgit v1.2.3