From 04245f26f6f9dbca1bfb14ee084ba90ae91b5e07 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sun, 30 Oct 2022 13:13:09 +0100 Subject: 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 Reviewed-by: Andrew Clayton --- src/nxt_string.h | 15 +++++++++------ 1 file 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 } -- cgit