summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@nginx.com>2022-10-30 13:13:09 +0100
committerAlejandro Colomar <alx@nginx.com>2022-11-16 13:04:08 +0100
commitbdcbcf3dacb20a8a532e3318efc1af23577f5ba2 (patch)
tree4d3da4934583b4bb3b1662daeabacac571756c7b
parent5ab7ae702c0e4a65653ba346bd5bf20506224842 (diff)
Split nxt_str_t struct declaration and definition.str-v3
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>
-rw-r--r--src/nxt_string.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/nxt_string.h b/src/nxt_string.h
index ae5d3179..21a7f56e 100644
--- a/src/nxt_string.h
+++ b/src/nxt_string.h
@@ -49,6 +49,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,
@@ -95,12 +104,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 }