summaryrefslogtreecommitdiff
path: root/utils/nsurl/private.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/nsurl/private.h')
-rw-r--r--utils/nsurl/private.h37
1 files changed, 36 insertions, 1 deletions
diff --git a/utils/nsurl/private.h b/utils/nsurl/private.h
index 67945e2e7..e78f83042 100644
--- a/utils/nsurl/private.h
+++ b/utils/nsurl/private.h
@@ -128,7 +128,7 @@ enum nsurl_string_flags {
* \param[out] url_l_out Returns byte length of string, excluding pre_padding.
* \return NSERROR_OK on success, appropriate error otherwise.
*/
-nserror nsurl__string(
+nserror nsurl__components_to_string(
const struct nsurl_components *components,
nsurl_component parts, size_t pre_padding,
char **url_s_out, size_t *url_l_out);
@@ -142,6 +142,41 @@ void nsurl__calc_hash(nsurl *url);
+
+/**
+ * Destroy components
+ *
+ * \param c url components
+ */
+static inline void nsurl__components_destroy(struct nsurl_components *c)
+{
+ if (c->scheme)
+ lwc_string_unref(c->scheme);
+
+ if (c->username)
+ lwc_string_unref(c->username);
+
+ if (c->password)
+ lwc_string_unref(c->password);
+
+ if (c->host)
+ lwc_string_unref(c->host);
+
+ if (c->port)
+ lwc_string_unref(c->port);
+
+ if (c->path)
+ lwc_string_unref(c->path);
+
+ if (c->query)
+ lwc_string_unref(c->query);
+
+ if (c->fragment)
+ lwc_string_unref(c->fragment);
+}
+
+
+
#ifdef NSURL_DEBUG
/**
* Dump a NetSurf URL's internal components