diff options
-rw-r--r-- | utils/nsurl.c | 9 | ||||
-rw-r--r-- | utils/nsurl.h | 11 |
2 files changed, 20 insertions, 0 deletions
diff --git a/utils/nsurl.c b/utils/nsurl.c index bae757324..328513364 100644 --- a/utils/nsurl.c +++ b/utils/nsurl.c @@ -1436,6 +1436,15 @@ const char *nsurl_access(const nsurl *url) /* exported interface, documented in nsurl.h */ +size_t nsurl_length(const nsurl *url) +{ + assert(url != NULL); + + return url->length; +} + + +/* exported interface, documented in nsurl.h */ nserror nsurl_join(const nsurl *base, const char *rel, nsurl **joined) { struct url_markers m; diff --git a/utils/nsurl.h b/utils/nsurl.h index ceb29bc97..c708e0483 100644 --- a/utils/nsurl.h +++ b/utils/nsurl.h @@ -183,6 +183,17 @@ const char *nsurl_access(const nsurl *url); /** + * Find the length of a NetSurf URL object's URL, as returned by nsurl_access + * + * \param url NetSurf URL to find length of. + * \return the required string + * + * The returned length excludes the trailing '\0'. + */ +size_t nsurl_length(const nsurl *url); + + +/** * Join a base url to a relative link part, creating a new NetSurf URL object * * \param base NetSurf URL containing the base to join rel to |