Mercurial > hg > nginx-site
changeset 1998:18404f5a5600
DevGuide: string initialization macros.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Wed, 14 Jun 2017 14:13:57 +0300 |
parents | eeb9cb8f8a54 |
children | 1b086de6a05b |
files | xml/en/docs/dev/development_guide.xml |
diffstat | 1 files changed, 30 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/xml/en/docs/dev/development_guide.xml +++ b/xml/en/docs/dev/development_guide.xml @@ -397,6 +397,36 @@ The following functions perform case con </list> </para> +<para> +The following macros simplify string initialization: +</para> + +<list type="bullet"> + +<listitem> +<literal>ngx_string(text)</literal> — static initializer for the +<literal>ngx_str_t</literal> type from the C string literal +<literal>text</literal> +</listitem> + +<listitem> +<literal>ngx_null_string</literal> — static empty string initializer for the +<literal>ngx_str_t</literal> type +</listitem> + +<listitem> +<literal>ngx_str_set(str, text)</literal> — initializes string +<literal>str</literal> of <literal>ngx_str_t *</literal> type with the C string +literal <literal>text</literal> +</listitem> + +<listitem> +<literal>ngx_str_null(str)</literal> — initializes string <literal>str</literal> +of <literal>ngx_str_t *</literal> type with the empty string +</listitem> + +</list> + </section>