diff options
author | Alejandro Colomar <alx@nginx.com> | 2022-10-30 13:13:09 +0100 |
---|---|---|
committer | Alejandro Colomar <alx@nginx.com> | 2022-11-15 13:11:15 +0100 |
commit | ffd3e994e951b7080e23fc03297dfe5c8e81dffe (patch) | |
tree | 44629e5903fb2317e9ac37a383ca70f8be758e41 /src/nxt_string.h | |
parent | 5e0fe2cd1a8bef0b415451717eb5c313ce90f675 (diff) | |
download | unit-ffd3e994e951b7080e23fc03297dfe5c8e81dffe.tar.gz unit-ffd3e994e951b7080e23fc03297dfe5c8e81dffe.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.
Reviewed-by: Andrew Clayton <a.clayton@nginx.com>
Signed-off-by: Alejandro Colomar <alx@nginx.com>
Diffstat (limited to 'src/nxt_string.h')
-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 } |