From 7dc1b4f45dcee0c21a26f63d967a41de9423094c Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Tue, 21 May 2019 12:06:49 +0200 Subject: [PATCH] sys/sock/util: allow overriding of SOCK_*_MAXLEN --- sys/include/net/sock/util.h | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/sys/include/net/sock/util.h b/sys/include/net/sock/util.h index 1f69a9d1d3..6e04f64e6e 100644 --- a/sys/include/net/sock/util.h +++ b/sys/include/net/sock/util.h @@ -99,13 +99,30 @@ bool sock_udp_ep_equal(const sock_udp_ep_t *a, const sock_udp_ep_t *b); * @name helper definitions * @{ */ -#define SOCK_SCHEME_MAXLEN (16U) /**< maximum length of the scheme part - for sock_urlsplit. Ensures a hard - limit on the string iterator */ -#define SOCK_HOSTPORT_MAXLEN (64U) /**< maximum length of host:port part for - sock_urlsplit() */ -#define SOCK_URLPATH_MAXLEN (64U) /**< maximum length path for - sock_urlsplit() */ + +/** + * @brief maximum length of the scheme part for sock_urlsplit. + * + * Ensures a hard limit on the string iterator + * */ +#ifndef SOCK_SCHEME_MAXLEN +#define SOCK_SCHEME_MAXLEN (16U) +#endif + +/** + * @brief maximum length of host:port part for sock_urlsplit() + */ +#ifndef SOCK_HOSTPORT_MAXLEN +#define SOCK_HOSTPORT_MAXLEN (64U) +#endif + +/** + * @brief maximum length path for sock_urlsplit() + */ +#ifndef SOCK_URLPATH_MAXLEN +#define SOCK_URLPATH_MAXLEN (64U) +#endif + /** @} */ #ifdef __cplusplus