diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-11-18 18:49:01 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-11-18 18:49:01 -0800 |
| commit | 143b6322f8217cfdbef8f3171d55d10348d1be37 (patch) | |
| tree | 60eef8b31cf320c97c1affbbf80a968d6a63e583 /docs/ref/migrate/nng1.md | |
| parent | dd4695f9492b4f30978e9043d7d6925bfe15a715 (diff) | |
| download | nng-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 'docs/ref/migrate/nng1.md')
| -rw-r--r-- | docs/ref/migrate/nng1.md | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/docs/ref/migrate/nng1.md b/docs/ref/migrate/nng1.md index ddad9ff7..1d903215 100644 --- a/docs/ref/migrate/nng1.md +++ b/docs/ref/migrate/nng1.md @@ -166,14 +166,21 @@ The use of `*` to act as a wild card meaning all local interface addresses is removed. The empty string already performs this function, and unlike `*` is RFC compliant. -## URL Structure Members - -The details of [`nng_url`] have changed as follows: - -- `u_port` is no longer a string, but a `uint16_t` -- `u_scheme` is a `const char *` +## URL Structure Changes + +The details of [`nng_url`] have changed significantly, and direct +access of the structure is no longer permitted. Intead new +accessors functions are provided: + +- `u_scheme` is replaced by [`nng_url_scheme`]. +- `u_port` is replaced by [`nng_url_port`], but this returns a `uint16_t`. +- `u_hostname` is replaced by [`nng_url_hostname`]. +- `u_path` is replaced by [`nng_url_path`]. +- `u_query` is replaced by [`nng_url_query`]. +- `u_fragment` is replaced by [`nng_url_fragment`]. +- `u_userinfo` is replaced by [`nng_url_userinfo`]. - `u_requri` is removed - it can be easily formulated from the other fields. -- `u_host` is removed - use `u_hostname` and `u_port` to construct if needed +- `u_host` is removed - use [`nng_url_hostname`] and [`nng_url_port`] to construct if needed - `u_rawurl` is removed - a "cooked" URL can be obtained from the new [`nng_url_sprintf`] function. {{#include ../xref.md}} |
