URI template processor.
More...
URI template processor.
A parser and processor for URI templates up to level 3 expression types according to RFC 6570.
- See also
- RFC 6570
◆ ut_process_expand()
int ut_process_expand |
( |
const char * |
ut, |
|
|
size_t |
ut_len, |
|
|
const ut_process_var_t * |
vars, |
|
|
size_t |
vars_len, |
|
|
char * |
uri, |
|
|
size_t * |
uri_len |
|
) |
| |
Expands a URI template by a given value set.
- Precondition
(vars_len == 0) || (vars != NULL)
-
(uri != NULL) && (uri_len > 0)
- Parameters
-
[in] | ut | A URI template. |
[in] | ut_len | Length of ut . |
[in] | vars | A set of variable-value pairs. |
[in] | vars_len | The length of vars . |
[out] | uri | The resulting URI. |
[in,out] | uri_len | The maximum length for uri on in, the actual length of uri on out. |
- Returns
- The length of
uri
on success
-
-EINVAL, when
ut
is not parseable.
-
-ENOBUFS, when
uri_len
is too small to fit the resulting URI. Potentially broken data will be written to uri
.
◆ ut_process_str_expand()
static int ut_process_str_expand |
( |
const char * |
ut, |
|
|
const ut_process_var_t * |
vars, |
|
|
size_t |
vars_len, |
|
|
char * |
uri, |
|
|
size_t * |
uri_len |
|
) |
| |
|
inlinestatic |
Expands a URI template by a given value set.
- Precondition
(vars_len == 0) || (vars != NULL)
-
(uri != NULL) && (uri_len > 0)
- Parameters
-
[in] | ut | A \0 -terminated URI template. |
[in] | vars | A set of variable-value pairs. |
[in] | vars_len | The length of vars . |
[out] | uri | The resulting URI. |
[in,out] | uri_len | The maximum length for uri on in, the actual length of uri on out. |
- Returns
- The length of
uri
on success
-
-EINVAL, when
ut
is not parseable.
-
-ENOENT, when any ut_process_var_t::name in
vars
contains an invalid character.
-
-ENOBUFS, when
uri_len
is too small to fit the resulting URI. A truncated version of the resulting URI will then be stored in uri
.
Definition at line 88 of file ut_process.h.