diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2011-10-08 12:03:54 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2011-10-08 12:03:54 +0000 |
commit | 642d773e2f5da9c3a238e4ed37a3fda14179f4dc (patch) | |
tree | 17b7dd4f5fe1bd584e6b6f2752c3462117b9a18b | |
parent | 165cca27b0567c9ccf272f9f5b864e1a2177df37 (diff) | |
download | netsurf-642d773e2f5da9c3a238e4ed37a3fda14179f4dc.tar.gz netsurf-642d773e2f5da9c3a238e4ed37a3fda14179f4dc.tar.bz2 |
Add function to get at url length.
svn path=/trunk/netsurf/; revision=13003
-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 |