diff options
author | Alejandro Colomar <alx@nginx.com> | 2022-10-30 13:13:09 +0100 |
---|---|---|
committer | Alejandro Colomar <alx@kernel.org> | 2022-11-12 20:22:07 +0100 |
commit | 04245f26f6f9dbca1bfb14ee084ba90ae91b5e07 (patch) | |
tree | 28c3c8c13102e513ccdaa69342879909f0618fcd | |
parent | b08dc96589cdbe65c206d36e2cd516b24967d394 (diff) | |
download | unit-04245f26f6f9dbca1bfb14ee084ba90ae91b5e07.tar.gz unit-04245f26f6f9dbca1bfb14ee084ba90ae91b5e07.tar.bz2 |
Split nxt_str_t struct declaration and definition.
This allows using the type in declarations before it's actually
defined, and also to move the typedef to another file.
Signed-off-by: Alejandro Colomar <alx@nginx.com>
Reviewed-by: Andrew Clayton <a.clayton@nginx.com>
-rw-r--r-- | src/nxt_string.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/nxt_string.h b/src/nxt_string.h index 18ea5490..41f7c238 100644 --- a/src/nxt_string.h +++ b/src/nxt_string.h @@ -45,6 +45,15 @@ (void) memcpy(dst, src, length) +typedef struct nxt_str_s nxt_str_t; + + +struct nxt_str_s { + size_t length; + u_char *start; +}; + + NXT_EXPORT void nxt_memcpy_lowcase(u_char *dst, const u_char *src, size_t length); NXT_EXPORT void nxt_memcpy_upcase(u_char *dst, const u_char *src, @@ -91,12 +100,6 @@ NXT_EXPORT u_char *nxt_rmemstrn(const u_char *s, const u_char *end, NXT_EXPORT size_t nxt_str_strip(const u_char *start, u_char *end); -typedef struct { - size_t length; - u_char *start; -} nxt_str_t; - - #define nxt_string(str) { nxt_length(str), (u_char *) str } #define nxt_string_zero(str) { sizeof(str), (u_char *) str } #define nxt_null_string { 0, NULL } |