ngx_tolower
(unsigned char c)¶ASCII の‘A’ から ‘Z’ を小文字に設定します。他の文字については同じ文字を返します。
パラメータ: |
|
---|---|
返り値: | 小文字の ‘a’ から ‘z’、あるいは入力文字 |
ngx_toupper
(unsigned char c)¶ASCII の‘A’ から ‘Z’ を大文字に設定します。他の文字については同じ文字を返します。
パラメータ: |
|
---|---|
返り値: | 大文字の ‘a’ から ‘z’、あるいは入力文字 |
ngx_strlow
(unsigned char *dst, unsigned char *src, size_t n)¶指定された長さの全体の文字列上でngx_tolower()
を実行します。destination は少なくとも元の長さと同じにあらかじめ割り当てられてなければなりません。
パラメータ: |
|
---|
ngx_strncmp
(const char *s1, const char *s2, size_t n)¶標準strncmp
関数へのエイリアス
パラメータ: |
|
---|---|
返り値: | 0 if the strings are equal, <0 if the first non-matching character in s1 is lower, >0 if the first non-matching character in s2 is higher |
ngx_strcmp
(const char *s1, const char *s2)¶標準strcmp
関数のエイリアス
パラメータ: |
|
---|---|
返り値: | 0 if the strings are equal, <0 if the first non-matching character in s1 is lower, >0 if the first non-matching character in s2 is higher |
ngx_strstr
(const char *s1, const char *s2)¶標準 strstr
関数のエイリアス
パラメータ: |
|
---|---|
返り値: | 最初の一致へのポインタ、あるいは一致しない場合は |
strchr
(const char *s1, int c)¶標準strchr
関数のエイリアス
パラメータ: |
|
---|---|
返り値: | 最初の一致へのポインタ、あるいは一致しない場合は |
ngx_strlchr
(unsigned char *p, unsigned char *last, unsigned char c)¶Searches a string based on the pointer to the beginning and end of the string for a given character. 文字の最初の一致へのポインタを返します。
パラメータ: |
|
---|---|
返り値: | 最初の一致へのポインタ、あるいは一致しない場合は |
memzero
(void *buf, size_t n)¶メモリの指定されたセクションの各バイトをゼロに設定する
パラメータ: |
|
---|
memset
(void *buf, int c, size_t n)¶標準memset
関数のエイリアス
パラメータ: |
|
---|
ngx_memcpy
(void *dst, const void *src, size_t n)¶標準memcpy
関数のエイリアスですが、結果へのポインタを返しません
パラメータ: |
|
---|
ngx_copy
(void *dst, const void *src, size_t n)¶コピーの後の結果のポインタを返す標準memcpy
関数のラッパー (dst
+ n
)
パラメータ: |
|
---|---|
返り値: |
|
ngx_memmove
(void *dst, const void *src, size_t n)¶標準memmove
関数のエイリアスですが、結果へのポインタを返しません
パラメータ: |
|
---|
ngx_movemem
(void *dst, const void *src, size_t n)¶コピーの後の結果のポインタを返す標準memmove
関数のラッパー (dst
+ n
)
パラメータ: |
|
---|---|
返り値: |
|
ngx_memcmp
(const void *s1, const void *s2, size_t n)¶標準memcmp関数のエイリアス
パラメータ: |
|
---|---|
返り値: | 0 if the strings are equal, <0 if the first non-matching character in s1 is lower, >0 if the first non-matching character in s2 is higher |
ngx_cpystrn
(unsigned char *dst, unsigned char *src, size_t n)¶あるメモリの場所から他の場所へ情報をコピーする。n
バイトがコピーされるかNULL
終端にぶつかると停止します。コピーが完了した場所のdst
のポインタを返す。
パラメータ: |
|
---|---|
返り値: |
|
ngx_pstrdup
(ngx_pool_t *pool, ngx_str_t *src)¶Creates a copy of a string into a newly allocated string in a memory pool created with ngx_create_pool()
パラメータ: |
|
---|---|
返り値: | 文字列のコピーへのポインタ |
ngx_sprintf
(unsigned char *buf, const char *fmt, ...)¶An sprintf
style wrapper around ngx_vslprintf()
パラメータ: |
|
---|---|
返り値: | 出力へのポインタ |
ngx_snprintf
(unsigned char *buf, size_t max, const char *fmt, ...)¶An snprintf
style wrapper around ngx_vslprintf()
パラメータ: |
|
---|---|
返り値: | 出力へのポインタ |
ngx_slprintf
(unsigned char *buf, unsigned char *last, const char *fmt, ...)¶A wrapper around ngx_vslprintf()
similar to snprintf
but instead of a maximum length specifier it takes a pointer to the end of the destination memory buffer.
パラメータ: |
|
---|---|
返り値: | 出力へのポインタ |
ngx_vslprintf
(unsigned char *buf, unsigned char *last, const char *fmt, va_list args)¶A function similar to the standard vsnprintf
but has additional possible format specifiers. また、長さの識別子の代わりに出力メモリバッファの最後へのポインタを取ります。
識別子 | 解説 |
---|---|
%P |
ngx_pid_t の内容 |
%M |
ngx_msec_t の内容 |
%V |
ngx_str_t のデータ |
%v |
ngx_http_variable_value_t のデータ |
パラメータ: |
|
---|
ngx_vsnprintf
(unsigned char *buf, size_t max, const char *fmt, va_list args)¶A function similar to the standard vsnprintf
which is implemented as a wrapper around ngx_vslprintf()
パラメータ: |
|
---|
ngx_strcasecmp
(unsigned char *s1, unsigned char *s2)¶An optimised function similar to the standard strcasecmp
パラメータ: |
|
---|---|
返り値: | 0 if the strings are equal, <0 if the first non-matching character in s1 is lower, >0 if the first non-matching character in s2 is higher |
ngx_strncasecmp
(unsigned char *s1, unsigned char *s2, size_t n)¶An optimised function similar to the standard strncasecmp
パラメータ: |
|
---|---|
返り値: | 0 if the strings are equal, <0 if the first non-matching character in s1 is lower, >0 if the first non-matching character in s2 is higher |
ngx_strnstr
(unsigned char *s1, char *s2, size_t n)¶標準strstr
に似ていますが、最大の検索長を持ちます。
パラメータ: |
|
---|---|
返り値: | 最初の一致へのポインタ、あるいは一致しない場合は |
ngx_strstrn
(unsigned char *s1, char *s2, size_t n)¶標準strstr
に似ていますが、s2
パラメータのための長さの指定子を持ちます。
パラメータ: |
|
---|---|
返り値: | 最初の一致へのポインタ、あるいは一致しない場合は |
ngx_strcasestrn
(unsigned char *s1, char *s2, size_t n)¶標準strcasestr
に似ていますが、s2
パラメータのための長さの指定子を持ちます。
パラメータ: |
|
---|---|
返り値: | 最初の一致へのポインタ、あるいは一致しない場合は |
ngx_strlcasestrn
(unsigned char *s1, unsigned char *last, unsigned char *s2, size_t n)¶標準strcasestr
に似ていますが、検索文字列内の最後の文字へのポインタと s2
パラメータのための長さの指定子を持ちます。
パラメータ: |
|
---|---|
返り値: | 最初の一致へのポインタ、あるいは一致しない場合は |
ngx_rstrncmp
(unsigned char *s1, unsigned char *s2, size_t n)¶標準strncmp
に似ていますが、文字列の最後から開始します。
パラメータ: |
|
---|---|
返り値: | 0 if the strings are equal, <0 if the first non-matching character in s1 is lower, >0 if the first non-matching character in s2 is higher |
ngx_rstrncasecmp
(unsigned char *s1, unsigned char *s2, size_t n)¶標準strncasecmp
に似ていますが、文字列の最後から開始します。
パラメータ: |
|
---|---|
返り値: | 0 if the strings are equal, <0 if the first non-matching character in s1 is lower, >0 if the first non-matching character in s2 is higher |
ngx_memn2cmp
(unsigned char *s1, unsigned char *s2, size_t n1, size_t n2)¶二つの指定されたメモリのセグメントの長さを比較します。
パラメータ: |
|
---|---|
返り値: | 0 if the strings are equal, <0 if the first non-matching character in s1 is lower, >0 if the first non-matching character in s2 is higher |
ngx_dns_strcmp
(unsigned char *s1, unsigned char *s2)¶ngx_strcmp()
に似ていますが、二つのDNSエントリを比較します。
パラメータ: |
|
---|---|
返り値: | 0 if the strings are equal, <0 if the first non-matching character in s1 is lower, >0 if the first non-matching character in s2 is higher |
ngx_filename_cmp
(unsigned char *s1, unsigned char *s2, size_t n)¶ngx_strncmp()
に似た関数ですが、二つのパスを比較します
パラメータ: |
|
---|---|
返り値: | 0 if the strings are equal, <0 if the first non-matching character in s1 is lower, >0 if the first non-matching character in s2 is higher |
ngx_atosz
(unsigned char *line, size_t n)¶テキスト文字列内の数を ssize_t
に変換します
パラメータ: |
|
---|---|
返り値: | 入力の |
ngx_atoof
(unsigned char *line, size_t n)¶テキスト文字列内の数を off_t
に変換します
パラメータ: |
|
---|---|
返り値: | 入力の |
ngx_atotm
(unsigned char *line, size_t n)¶テキスト文字列内の数を time_t
に変換します
パラメータ: |
|
---|---|
返り値: | 入力の |
ngx_hex_dump
(unsigned char *dst, unsigned char *src, size_t len)¶バイナリデータを印刷可能な文字列の16進数表現に変換します
注意
dst
は 2*len
に割り当てられなければなりません。dst
はこの関数によって NULL
で終了しないでしょう。
パラメータ: |
|
---|---|
返り値: |
|
ngx_base64_encoded_length
(int len)¶文字列のbase64エンコード長を計算するためのマクロEvaluates to (((len + 2) / 3) * 4)
. どのようなint型も使うことができます。
パラメータ: |
|
---|---|
返り値: | 出力の長さ |
ngx_base64_decoded_length
(int len)¶文字列のbase64デコード長を計算するためのマクロEvaluates to (((len + 3) / 4) * 3)
. どのようなint型も使うことができます。
パラメータ: |
|
---|---|
返り値: | 出力の長さ |
ngx_encode_base64
(ngx_str_t *dst, ngx_str_t *src)¶指定された入力テキストのBase64エンコード。
注意
ngx_base64_encoded_length()
は dst
のためにどれだけのメモリが割り当てられなければならないかを計算するために使われなければなりません。
パラメータ: |
|
---|
ngx_encode_base64url
(ngx_str_t *dst, ngx_str_t *src)¶指定された入力URLのBase64エンコード。
注意
ngx_base64_encoded_length()
は dst
のためにどれだけのメモリが割り当てられなければならないかを計算するために使われなければなりません。
パラメータ: |
|
---|
ngx_decode_base64
(ngx_str_t *dst, ngx_str_t *src)¶指定された入力のBase64デコード
注意
ngx_base64_decoded_length()
は dst
のためにどれだけのメモリが割り当てられなければならないかを計算するために使われなければなりません。
パラメータ: |
|
---|---|
返り値: | 成功時には |
ngx_decode_base64url
(ngx_str_t *dst, ngx_str_t *src)¶指定された入力URLのBase64デコード
注意
ngx_base64_decoded_length()
は dst
のためにどれだけのメモリが割り当てられなければならないかを計算するために使われなければなりません。
パラメータ: |
|
---|---|
返り値: | 成功時には |
ngx_utf8_decode
(unsigned char **p, size_t n)¶UTF8文字を検証します。The character pointer pointed to with p
is moved to the end of the character. 以下の表は返り値を示します:
値 | 意味 |
---|---|
0x80 - 0x10ffff | 有効な文字 |
0x110000 - 0xfffffffd | 無効な文字 |
0xfffffffe | 不完全な並び |
0xffffffff | エラー |
パラメータ: |
|
---|---|
返り値: | 上の表での状態 |
ngx_utf8_length
(unsigned char *p, size_t n)¶指定された文字列内のUTF8文字の数を返します。
パラメータ: |
|
---|---|
返り値: | 文字列内のUTF8文字の数、あるいは |
ngx_utf8_cpystrn
(unsigned char *dst, unsigned char *src, size_t n, size_t len)¶ある文字列から別の文字列へ無効な文字を無視しながら、有効なUTF8シーケンスをコピーする
パラメータ: |
|
---|---|
返り値: |
|
ngx_escape_uri
(unsigned char *dst, unsigned char *src, size_t size, ngx_uint_t type)¶URLをエスケープする異なるタイプはわずかに異なるエスケープアルゴリズムを使います。A dst
of NULL
will return the number of characters that would fill dst
. Otherwise a pointer to the end of data in dst
is returned.
種類 | 定義 |
---|---|
NGX_ESCAPE_URI |
標準URIをエスケープ |
NGX_ESCAPE_ARGS |
クエリ引数をエスケープ |
NGX_ESCAPE_URI_COMPONENT |
ドメインの後のURIをエスケープ |
NGX_ESCAPE_HTML |
SSI includeのためのURIをエスケープ |
NGX_ESCAPE_REFRESH |
refreshヘッダ内のURIをエスケープ |
NGX_ESCAPE_MEMCACHED |
memcached のURIをエスケープ |
NGX_ESCAPE_MAIL_AUTH |
メール認証URIをエスケープ |
パラメータ: |
|
---|---|
返り値: | A pointer to the end of the used |
ngx_unescape_uri
(unsigned char **dst, unsigned char **src, size_t size, ngx_uint_t type)¶URIをアンエスケープする異なるタイプはわずかに異なるアンエスケープアルゴリズムを使います。
種類 | 定義 |
---|---|
NGX_UNESCAPE_URI |
標準URIをアンエスケープ |
NGX_UNESCAPE_REDIRECT |
リダイレクトURIをアンエスケープ |
パラメータ: |
|
---|
ngx_escape_html
(unsigned char *dst, unsigned char *src, size_t size)¶HTMLエンティティをエスケープ <
, >
, &
and "
. A dst
of NULL
will return the number of characters that would fill dst
. そうでなければdst
内のデータの最後へのポインタが返されます。
パラメータ: |
|
---|---|
返り値: | A pointer to the end of the used |
ngx_escape_json
(unsigned char *dst, unsigned char *src, size_t size)¶JSONエンティティのエスケープ \
, "
と 0x1f。A dst
of NULL
will return the number of characters that would fill dst
. そうでなければdst
内のデータの最後へのポインタが返されます。
パラメータ: |
|
---|---|
返り値: | A pointer to the end of the used |
ngx_sort
(void *base, size_t n, size_t size, ngx_int_t (*cmp)(const void *, const void *))¶An insertion sort algorithm with a template similar to the standard C qsort
function. Sorts fixed-length data based on the results of a comparitor callback cmp
. cmp
should return -1
to left, 1
to shift right and 0 to not shift.
パラメータ: |
|
---|
ngx_qsort
(void* base, size_t num, size_t size, int (*compar)(const void*,const void*))¶標準qsort
関数のエイリアス
パラメータ: |
|
---|
ngx_hash
(ngx_uint_t key, unsigned char c)¶1文字のハッシュを生成するマクロ。以下で定義されます:
((ngx_uint_t) key * 31 + c)
完全なハッシュを生成するために文字列全体の上で実行されるように設計されています
パラメータ: |
|
---|---|
返り値: | 更新されたキー |
ngx_hash_strlow
(unsigned char *dst, unsigned char *src, size_t n)¶指定された文字列を、各文字上でngx_tolower()
を使って小文字に設定し、それを dst
に格納し、 ngx_hash()
を使って文字列からハッシュを生成します
パラメータ: |
|
---|---|
返り値: |
|
ngx_regex_compile
(ngx_regex_compile_t *rc)¶事前定義された ngx_regex_compile_t
構造に基づいた正規表現をコンパイルします。
パラメータ: |
|
---|---|
返り値: | 成功時には |
ngx_regex_exec
(ngx_regex_compile_t *re, ngx_str_t *s, int *captures, int size)¶A macro wrapper around pcre_exec
to execute the regular expression
パラメータ: |
|
---|---|
結果: | 成功時には |
ngx_regex_exec_array
(ngx_array_t *a, ngx_str_t *s, ngx_log_t *log)¶文字列に対して正規表現の配列を実行する。これは、一致の詳細ではなく、一致したかどうかのみを返します
パラメータ: |
|
---|---|
返り値: | 一致を見つけた場合は |