aboutsummaryrefslogtreecommitdiff
path: root/src/core/url.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-11-18 18:49:01 -0800
committerGarrett D'Amore <garrett@damore.org>2024-11-18 18:49:01 -0800
commit143b6322f8217cfdbef8f3171d55d10348d1be37 (patch)
tree60eef8b31cf320c97c1affbbf80a968d6a63e583 /src/core/url.c
parentdd4695f9492b4f30978e9043d7d6925bfe15a715 (diff)
downloadnng-143b6322f8217cfdbef8f3171d55d10348d1be37.tar.gz
nng-143b6322f8217cfdbef8f3171d55d10348d1be37.tar.bz2
nng-143b6322f8217cfdbef8f3171d55d10348d1be37.zip
Introduce accessors for nng_url struct and make it opaque.
This provides safety by ensuring that applications do not depend on the size or layout of nng_url itself.
Diffstat (limited to 'src/core/url.c')
-rw-r--r--src/core/url.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/core/url.c b/src/core/url.c
index 6e17e8c7..4be730cc 100644
--- a/src/core/url.c
+++ b/src/core/url.c
@@ -687,3 +687,45 @@ nni_url_to_address(nng_sockaddr *sa, const nng_url *url)
nni_aio_fini(&aio);
return (rv);
}
+
+const char *
+nng_url_scheme(const nng_url *url)
+{
+ return (url->u_scheme);
+}
+
+uint16_t
+nng_url_port(const nng_url *url)
+{
+ return (url->u_port);
+}
+
+const char *
+nng_url_hostname(const nng_url *url)
+{
+ return (url->u_hostname);
+}
+
+const char *
+nng_url_path(const nng_url *url)
+{
+ return (url->u_path);
+}
+
+const char *
+nng_url_query(const nng_url *url)
+{
+ return (url->u_query);
+}
+
+const char *
+nng_url_userinfo(const nng_url *url)
+{
+ return (url->u_userinfo);
+}
+
+const char *
+nng_url_fragment(const nng_url *url)
+{
+ return (url->u_fragment);
+}