diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2017-01-19 23:33:53 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2017-02-08 17:27:13 +0000 |
commit | 2acd90e28a37a80f20e2780be7972764c699d9a0 (patch) | |
tree | 3b573bfb3d2a1586112e8ec7239bb0e5ca1c2be9 /utils/nsurl/private.h | |
parent | 95e5ede775fc842324b87d797ca00c7576b9a359 (diff) | |
download | netsurf-2acd90e28a37a80f20e2780be7972764c699d9a0.tar.gz netsurf-2acd90e28a37a80f20e2780be7972764c699d9a0.tar.bz2 |
nsurl: Consolidate conversion to string.
Diffstat (limited to 'utils/nsurl/private.h')
-rw-r--r-- | utils/nsurl/private.h | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/utils/nsurl/private.h b/utils/nsurl/private.h index f8ba51f67..bc3eb8c7e 100644 --- a/utils/nsurl/private.h +++ b/utils/nsurl/private.h @@ -107,31 +107,21 @@ enum nsurl_string_flags { NSURL_F_FRAGMENT = (1 << 11) }; -/** - * Get nsurl string info; total length, component lengths, & components present - * - * \param url NetSurf URL components - * \param url_s Updated to contain the string - * \param l Individual component lengths - * \param flags String flags - */ -void nsurl__get_string(const struct nsurl_components *url, char *url_s, - struct nsurl_component_lengths *l, - enum nsurl_string_flags flags); /** - * Get nsurl string info; total length, component lengths, & components present + * Convert a set of nsurl components to a single string * - * \param url NetSurf URL components - * \param parts Which parts of the URL are required in the string - * \param url_l Updated to total string length - * \param lengths Updated with individual component lengths - * \param pflags Updated to contain relevant string flags + * \param[in] components The URL components to stitch together. + * \param[in] parts The set of parts wanted in the string. + * \param[in] pre_padding Amount in bytes to pad the start of the string by. + * \param[out] url_s_out Returns allocated URL string. + * \param[out] url_l_out Returns byte length of string, excluding pre_padding. + * \return NSERROR_OK on success, appropriate error otherwise. */ -void nsurl__get_string_data(const struct nsurl_components *url, - nsurl_component parts, size_t *url_l, - struct nsurl_component_lengths *lengths, - enum nsurl_string_flags *pflags); +nserror nsurl__string( + const struct nsurl_components *components, + nsurl_component parts, size_t pre_padding, + char **url_s_out, size_t *url_l_out); /** * Calculate hash value |