summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2024-05-24 15:37:26 +0100
committerAndrew Clayton <a.clayton@nginx.com>2024-05-24 15:37:26 +0100
commit7b19a06c9aa3e658eea4a87622ac74d67c10173f (patch)
treea8e7b5cc97388891bfdcb74f3956016076f3fbc4 /src
parentc38bcee10334a35548cdf54064ff7c11a0d66ed3 (diff)
downloadunit-7b19a06c9aa3e658eea4a87622ac74d67c10173f.tar.gz
unit-7b19a06c9aa3e658eea4a87622ac74d67c10173f.tar.bz2
tstr: Constify the 'str' parameter to nxt_tstr_compile()
This allows you to then define strings like static const nxt_str_t my_str = nxt_string("string"); Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'src')
-rw-r--r--src/nxt_tstr.c2
-rw-r--r--src/nxt_tstr.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/nxt_tstr.c b/src/nxt_tstr.c
index edf6860a..fde4822d 100644
--- a/src/nxt_tstr.c
+++ b/src/nxt_tstr.c
@@ -81,7 +81,7 @@ nxt_tstr_state_new(nxt_mp_t *mp, nxt_bool_t test)
nxt_tstr_t *
-nxt_tstr_compile(nxt_tstr_state_t *state, nxt_str_t *str,
+nxt_tstr_compile(nxt_tstr_state_t *state, const nxt_str_t *str,
nxt_tstr_flags_t flags)
{
u_char *p;
diff --git a/src/nxt_tstr.h b/src/nxt_tstr.h
index 3e842f81..a156732d 100644
--- a/src/nxt_tstr.h
+++ b/src/nxt_tstr.h
@@ -38,7 +38,7 @@ typedef enum {
nxt_tstr_state_t *nxt_tstr_state_new(nxt_mp_t *mp, nxt_bool_t test);
-nxt_tstr_t *nxt_tstr_compile(nxt_tstr_state_t *state, nxt_str_t *str,
+nxt_tstr_t *nxt_tstr_compile(nxt_tstr_state_t *state, const nxt_str_t *str,
nxt_tstr_flags_t flags);
nxt_int_t nxt_tstr_test(nxt_tstr_state_t *state, nxt_str_t *str, u_char *error);
nxt_int_t nxt_tstr_state_done(nxt_tstr_state_t *state, u_char *error);