[PATCH 2/4] Core: Add ngx_strtok_r()

Vesa Jääskeläinen vesa.jaaskelainen at vaisala.com
Wed Jul 12 14:07:05 UTC 2023


# HG changeset patch
# User Vesa Jääskeläinen <vesa.jaaskelainen at vaisala.com>
# Date 1689169165 -10800
#      Wed Jul 12 16:39:25 2023 +0300
# Node ID 7226cadb2d145a1feb5313c50eaadd87c6e49f51
# Parent  57f9cc8ef8ce24385ebb7bb4cf3150299bc8ed91
Core: Add ngx_strtok_r()

Add wrapper define for strtok_r().

diff -r 57f9cc8ef8ce -r 7226cadb2d14 src/core/ngx_string.h
--- a/src/core/ngx_string.h	Wed Jul 12 16:39:11 2023 +0300
+++ b/src/core/ngx_string.h	Wed Jul 12 16:39:25 2023 +0300
@@ -63,6 +63,8 @@
 size_t ngx_strnlen(u_char *p, size_t n);
 
 #define ngx_strchr(s1, c)   strchr((const char *) s1, (int) c)
+#define ngx_strtok_r(str, delim, saveptr) \
+    strtok_r((char *) str, (const char *) delim, (char **) saveptr)
 
 static ngx_inline u_char *
 ngx_strlchr(u_char *p, u_char *last, u_char c)


More information about the nginx-devel mailing list