diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2015-07-23 00:05:22 +0100 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2015-10-24 15:12:57 +0100 |
commit | 65b510fbc3ad822ab8c75e6d94eaee5b6ceb07a4 (patch) | |
tree | e90ae621688c1b4e974e901e12ecfb03bfb059be /utils/nsurl.h | |
parent | 5206518a75d34cdf03a5118276e7ba4c106b6bfc (diff) | |
download | netsurf-65b510fbc3ad822ab8c75e6d94eaee5b6ceb07a4.tar.gz netsurf-65b510fbc3ad822ab8c75e6d94eaee5b6ceb07a4.tar.bz2 |
Rework IDN URL retrieval to return an nserror
Diffstat (limited to 'utils/nsurl.h')
-rw-r--r-- | utils/nsurl.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/utils/nsurl.h b/utils/nsurl.h index 07d73f17f..383b35711 100644 --- a/utils/nsurl.h +++ b/utils/nsurl.h @@ -181,17 +181,21 @@ const char *nsurl_access(const nsurl *url); /** - * Access a NetSurf URL object as a UTF-8 string (for human readable IDNA) + * Access a NetSurf URL object as a UTF-8 string (for human readable IDNs) * * \param url NetSurf URL to retrieve a string pointer for. - * \return the required string + * \param url_s Returns a url string + * \param url_l Returns length of url_s + * \return NSERROR_OK on success, appropriate error otherwise + * + * If return value != NSERROR_OK, nothing will be returned in url_s or url_l. * - * It is up to the client to free the returned string when they have - * finished with it. + * The string returned in url_s is owned by the client and it is up to them + * to free it. It includes a trailing '\0'. * - * The returned string has a trailing '\0'. + * The length returned in url_l excludes the trailing '\0'. */ -char *nsurl_access_utf8(const nsurl *url); +nserror nsurl_access_utf8(const nsurl *url, char **url_s, size_t *url_l); /** |