diff options
-rw-r--r-- | src/nxt_string.c | 2 | ||||
-rw-r--r-- | src/nxt_string.h | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/nxt_string.c b/src/nxt_string.c index 39f472e9..8c86f3b0 100644 --- a/src/nxt_string.c +++ b/src/nxt_string.c @@ -9,6 +9,8 @@ extern inline void nxt_ustr2str(char *restrict dst, const u_char *restrict src, size_t length); +extern inline void nxt_usts2str(char *restrict dst, + const nxt_str_t *restrict src); nxt_str_t * diff --git a/src/nxt_string.h b/src/nxt_string.h index 62459987..ae5d3179 100644 --- a/src/nxt_string.h +++ b/src/nxt_string.h @@ -122,6 +122,8 @@ typedef struct { NXT_EXPORT inline void nxt_ustr2str(char *restrict dst, const u_char *restrict src, size_t length); +NXT_EXPORT inline void nxt_usts2str(char *restrict dst, + const nxt_str_t *restrict src); NXT_EXPORT nxt_str_t *nxt_str_alloc(nxt_mp_t *mp, size_t length); NXT_EXPORT nxt_str_t *nxt_str_dup(nxt_mp_t *mp, nxt_str_t *dst, @@ -179,4 +181,11 @@ nxt_ustr2str(char *restrict dst, const u_char *restrict src, size_t length) } +inline void +nxt_usts2str(char *restrict dst, const nxt_str_t *restrict src) +{ + nxt_ustr2str(dst, src->start, src->length); +} + + #endif /* _NXT_STRING_H_INCLUDED_ */ |